Slide 1

Slide 1 text

passing the Technical Interview 🛠 workshop

Slide 2

Slide 2 text

Who is this guy? Ben Edmunds Open Source Author PHP Town Hall Podcast More Than Code Podcast Sr Staff Eng @ Wayfair

Slide 3

Slide 3 text

Will Cover Technical interview process from Phone Screen to Offer

Slide 4

Slide 4 text

Won’t Cover Everything before the Phone Screen

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

My Last Job Search

Slide 7

Slide 7 text

Your Next Job Search

Slide 8

Slide 8 text

Prep

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

1
 Phone 
 Screen 2
 Manager 
 Screen 3
 Coding Test 4 Onsite Evals

Slide 11

Slide 11 text

Stages 0. Reach Out • Accepted application • Communication from Recruiter

Slide 12

Slide 12 text

1
 Phone 
 Screen 2
 Manager 
 Screen 3
 Coding Test 4 Onsite Evals

Slide 13

Slide 13 text

Stages 1. Phone Screen • High level • Why are you looking • What are you looking for • Pitch on company/role

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Stages 1. Phone Screen • Why • What PREP

Slide 16

Slide 16 text

Stages 1. Phone Screen • Structure of teams • Favorite projects PREP

Slide 17

Slide 17 text

Stages 1. Phone Screen • $ PREP

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

1
 Phone 
 Screen 2
 Manager 
 Screen 3
 Coding Test 4 Onsite Evals

Slide 20

Slide 20 text

Stages • High level but deeper tech • Experience with specific technologies • Pitch on Company/Role 2. Manager Screen

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Stages • Hard Problems • Best Projects • Failures • Technologies 2. Manager Screen PREP

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

1
 Phone 
 Screen 2
 Manager 
 Screen 3
 Coding Test 4 Onsite Evals

Slide 25

Slide 25 text

Stages 3. Coding Test • Take Home • or • Online Platform

Slide 26

Slide 26 text

Stages 3. Coding Test - Take Home • Small project • Designing architecture • Designing APIs • Solving algorithms

Slide 27

Slide 27 text

Stages 3. Coding Test - Online • Small problem(s) • Algorithmic problem • Time complexity • Space complexity

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Stages 3. Coding Test • Lite version of Coding and Sys Design on-site evals • Real world experience PREP

Slide 30

Slide 30 text

Stages 3. Coding Test • Sys Design & Architecture • Based on role 
 interviewing for PREP

Slide 31

Slide 31 text

Stages 3. Coding Test • APIs • REST • GraphQL • RPC PREP

Slide 32

Slide 32 text

Stages 3. Coding Test • Data Structures • Array, Stack, Queue, 
 BT, BST, Hash Table PREP

Slide 33

Slide 33 text

Stages 3. Coding Test • Algos • Common Techniques PREP

Slide 34

Slide 34 text

Stages 3. Coding Test • Algos • Pattern Matching PREP

Slide 35

Slide 35 text

Stages 3. Coding Test • Algos • Common Problems PREP + FizzBuzz, 8 Queens, Boggle, Subset Sum, etc

Slide 36

Slide 36 text

Stages 3. Coding Test • Algos • Improvements PREP

Slide 37

Slide 37 text

Stages 3. Coding Test • Sorting • Bubble Sort • Quick Sort • Merge Sort PREP

Slide 38

Slide 38 text

Stages 3. Coding Test • Fill knowledge gaps PREP

Slide 39

Slide 39 text

Stages 3. Coding Test • PRACTICE PREP

Slide 40

Slide 40 text

Time & Space Complexity

Slide 41

Slide 41 text

Complexity Time Complexity Space Complexity images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 42

Slide 42 text

Complexity Big O notation images:https://www.geeksforgeeks.org/analysis-algorithms-big-o-analysis/

Slide 43

Slide 43 text

Complexity O(1) $input = [1,2,3,4,5]; return $input[3];

Slide 44

Slide 44 text

Complexity O(log N) for ($i=0; $i<=count($input); $i*=2) {}

Slide 45

Slide 45 text

Complexity O(N) for ($i=0; $i<=count($input); $i++) {}

Slide 46

Slide 46 text

Complexity O(N log N) for ($i=0; $i<=count($input); $i++) { for ($j=0; $j<=count($input); $j*=2) {} }

Slide 47

Slide 47 text

Complexity O(N2) for ($i=0; $i<=count($input); $i++) { for ($j=0; $j<=count($input); $j++) {} }

Slide 48

Slide 48 text

Complexity O(N!) function factorial($n) { $factorial = 1; for ($i = 1; $i <= $n; $i++){ $factorial = $factorial * $i; } return $factorial; } for ($i = 0; $i <= factorial(8); $i++) { }

Slide 49

Slide 49 text

Data Structures

Slide 50

Slide 50 text

Data Structures Array Stack Queue Linked List Tree Graph Hash Table Linear Non-linear

Slide 51

Slide 51 text

Data Structures Array Stack Queue Linked List Linear Non-linear Tree Graph Hash Table

Slide 52

Slide 52 text

Data Structures array images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 53

Slide 53 text

Data Structures $array = ['Item1', 'Item2']; $array[0] => Item1

Slide 54

Slide 54 text

Data Structures $array = [ ['Item1-1', 'Item1-2'], ['Item2-1', 'Item2-2'], ]; $array[0][1] => Item1-2

Slide 55

Slide 55 text

Data Structures $array = [ 'namedIndex' => 'value' ]; $array['namedIndex'] => value

Slide 56

Slide 56 text

Data Structures stack images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 57

Slide 57 text

Data Structures $stack = [0, 1, 2]; array_pop($stack) => 2 var_dump($stack) => [0, 1]

Slide 58

Slide 58 text

Data Structures public isEmpty() : bool public pop() : mixed public push(mixed $value) : void

Slide 59

Slide 59 text

Data Structures $stack = new Stack([0, 1, 2]); $stack->pop() => 2 var_dump($stack) => [0, 1]

Slide 60

Slide 60 text

Data Structures $stack = new Stack([0, 1]); $stack->push() => 3 var_dump($stack) => [3, 0, 1]

Slide 61

Slide 61 text

Data Structures queue images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 62

Slide 62 text

Data Structures $queue = [0, 1, 2]; array_pop_first($queue) => 0 var_dump($queue) => [1, 2]

Slide 63

Slide 63 text

Data Structures public isEmpty() : bool public pop() : mixed public push(mixed $value) : void

Slide 64

Slide 64 text

Data Structures public isEmpty() : bool public dequeue() : mixed public enqueue(mixed $value) : void

Slide 65

Slide 65 text

Data Structures $queue = new Queue([0, 1, 2]); $queue->pop() => 0 var_dump($queue) => [1, 2]

Slide 66

Slide 66 text

Data Structures $queue = new Queue([1, 2]); $queue->push() => 3 var_dump($queue) => [1, 2, 3]

Slide 67

Slide 67 text

Data Structures linked list images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 68

Slide 68 text

Data Structures doubly linked list images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 69

Slide 69 text

Data Structures $l = new SplDoublyLinkedList; $l->push('a'); $l->push('b'); $l->push('c'); for ($l->rewind(); $l->valid(); $l->next()) { echo $l->current() . ', '; } => a, b, c

Slide 70

Slide 70 text

Data Structures $l = new SplDoublyLinkedList; $l->push('a'); $l->push('b'); $l->push('c'); $list->rewind(); echo $list->current() . ', '; $list->next(); echo $list->current() . ', '; $list->prev(); echo $list->current(); = > a, b, a

Slide 71

Slide 71 text

Data Structures hash table images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 72

Slide 72 text

Data Structures $hashMap = [ sha1('first') => 1, sha1('second') => 2 ]; $hashMap[sha1('first')] => 1

Slide 73

Slide 73 text

Data Structures $hashMap = []; for ($i=1; $i<=10; $i++){ $hash = $i % 3; $hashMap[$hash] = isset($hashMap[$hash]) ? $hashMap[$hash] + $i : $i; } $hashMap[0] => 18

Slide 74

Slide 74 text

Data Structures graph images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 75

Slide 75 text

Data Structures graph images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 76

Slide 76 text

Data Structures graph images: https://blog.devmountain.com/what-you-should-know-about-data-structures follow edges add to Queue process queue Breadth First Traversal

Slide 77

Slide 77 text

Data Structures https://www.tutorialspoint.com/data_structures_algorithms/breadth_first_traversal.htm

Slide 78

Slide 78 text

Data Structures graph images: https://blog.devmountain.com/what-you-should-know-about-data-structures follow edges add to Stack process stack Depth First Traversal

Slide 79

Slide 79 text

Data Structures https://www.tutorialspoint.com/data_structures_algorithms/breadth_first_traversal.htm

Slide 80

Slide 80 text

Data Structures tree images: https://blog.devmountain.com/what-you-should-know-about-data-structures

Slide 81

Slide 81 text

Data Structures binary search tree (BST) https://delboy1978uk.wordpress.com/2018/02/06/binary-search-trees-in-php/

Slide 82

Slide 82 text

Data Structures binary search tree (BST) 23? https://delboy1978uk.wordpress.com/2018/02/06/binary-search-trees-in-php/

Slide 83

Slide 83 text

Data Structures binary search tree (BST) 20? null https://delboy1978uk.wordpress.com/2018/02/06/binary-search-trees-in-php/

Slide 84

Slide 84 text

Data Structures binary search tree (BST) Breadth First Traversal https://delboy1978uk.wordpress.com/2018/02/06/binary-search-trees-in-php/ 5,2,11,1,4, 7,23,16,34

Slide 85

Slide 85 text

Data Structures binary search tree (BST) Depth First Traversal https://delboy1978uk.wordpress.com/2018/02/06/binary-search-trees-in-php/ 5, 2, 1, 4, 11, 7, 23, 16, 34

Slide 86

Slide 86 text

Data Structures class Node { public $left, $right, $data; function __construct($data) { $this->data = $data; } }

Slide 87

Slide 87 text

Data Structures class BST { public $rootNode; public function __construct($data=null) { if ($data !== null) { $this->rootNode = new Node($data); } }

Slide 88

Slide 88 text

Data Structures public function search($data) { $node = $this->rootNode; while($node) { if ($data < $node->data) { $node = $node->left; } else if ($data > $node->data) { $node = $node->right; } else { break; } } return $node; }

Slide 89

Slide 89 text

Data Structures trees IRL https://en.wikipedia.org/wiki/Radix_tree

Slide 90

Slide 90 text

Data Structures https://en.wikipedia.org/wiki/Radix_tree

Slide 91

Slide 91 text

Algorithms

Slide 92

Slide 92 text

Algorithms Techniques

Slide 93

Slide 93 text

Algorithms techniques brute force

Slide 94

Slide 94 text

Algorithms techniques divide and conquer

Slide 95

Slide 95 text

Algorithms techniques dynamic

Slide 96

Slide 96 text

Algorithms techniques greedy

Slide 97

Slide 97 text

Algorithms techniques recursive

Slide 98

Slide 98 text

Algorithms techniques backtracking

Slide 99

Slide 99 text

Algorithms Sorting

Slide 100

Slide 100 text

Algorithms quicksort https://en.wikipedia.org/wiki/Quicksort

Slide 101

Slide 101 text

Algorithms quicksort https://en.wikipedia.org/wiki/Quicksort O(n log n)

Slide 102

Slide 102 text

Algorithms merge sort https://en.wikipedia.org/wiki/Quicksort

Slide 103

Slide 103 text

Algorithms merge sort https://en.wikipedia.org/wiki/Quicksort O(n log n)

Slide 104

Slide 104 text

Algorithms Examples

Slide 105

Slide 105 text

Algorithms fizz buzz Write a program that prints the numbers from 1 to 100 and for multiples of ‘3’ print “Fizz” instead of the number and for the multiples of ‘5’ print “Buzz”.

Slide 106

Slide 106 text

Algorithms for ($i=1; $i<=100; $i++) { if ($i%3 === 0) { echo 'Fizz'; } else if ($i%5 === 0) { echo 'Buzz'; } else { echo $i; } }

Slide 107

Slide 107 text

Algorithms time complexity O(n) https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 108

Slide 108 text

Algorithms single number Given a non-empty array of integers, every element appears twice except for one. Find that single one.

Slide 109

Slide 109 text

Algorithms $input = [4, 1, 2, 1, 2]; $noDups = []; foreach ($input as $value) { $k = array_search($value, $noDups); if ($k === false) { $noDups[] = $value; } else { unset($noDups[$k]); } } echo $noDups[0];

Slide 110

Slide 110 text

Algorithms $input = [4, 1, 2, 1, 2]; $noDups = []; foreach ($input as $value) { $k = array_search($value, $noDups); if ($k === false) { $noDups[] = $value; } else { unset($noDups[$k]); } } echo $noDups[0];

Slide 111

Slide 111 text

Algorithms $input = [4, 1, 2, 1, 2]; $noDups = []; foreach ($input as $value) { $k = array_search($value, $noDups); if ($k === false) { $noDups[] = $value; } else { unset($noDups[$k]); } } echo $noDups[0];

Slide 112

Slide 112 text

Algorithms $input = [4, 1, 2, 1, 2]; $noDups = []; foreach ($input as $value) { $k = array_search($value, $noDups); if ($k === false) { $noDups[] = $value; } else { unset($noDups[$k]); } } echo $noDups[0];

Slide 113

Slide 113 text

Algorithms $input = [4, 1, 2, 1, 2]; $noDups = []; foreach ($input as $value) { $k = array_search($value, $noDups); if ($k === false) { $noDups[] = $value; } else { unset($noDups[$k]); } } echo $noDups[0];

Slide 114

Slide 114 text

Algorithms time complexity O(n2) https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 115

Slide 115 text

Algorithms $input = [4, 1, 2, 1, 2]; $hashmap = []; foreach ($input as $v) { $hashmap[$v] = isset($hashmap[$v]) ? $hashmap[$v]+1 : 1; } foreach ($hashmap as $k => $count) { if ($count === 1) { echo $k; break; } }

Slide 116

Slide 116 text

Algorithms $input = [4, 1, 2, 1, 2]; $hashmap = []; foreach ($input as $v) { $hashmap[$v] = isset($hashmap[$v]) ? $hashmap[$v]+1 : 1; } foreach ($hashmap as $k => $count) { if ($count === 1) { echo $k; break; } }

Slide 117

Slide 117 text

Algorithms $input = [4, 1, 2, 1, 2]; $hashmap = []; foreach ($input as $v) { $hashmap[$v] = isset($hashmap[$v]) ? $hashmap[$v]+1 : 1; } foreach ($hashmap as $k => $count) { if ($count === 1) { echo $k; break; } }

Slide 118

Slide 118 text

Algorithms $hashmap = array(3) { [4]=> int(1) [1]=> int(2) [2]=> int(2) }

Slide 119

Slide 119 text

Algorithms $input = [4, 1, 2, 1, 2]; $hashmap = []; foreach ($input as $v) { $hashmap[$v] = isset($hashmap[$v]) ? $hashmap[$v]+1 : 1; } foreach ($hashmap as $k => $count) { if ($count === 1) { echo $k; break; } }

Slide 120

Slide 120 text

Algorithms $input = [4, 1, 2, 1, 2]; $hashmap = []; foreach ($input as $v) { $hashmap[$v] = isset($hashmap[$v]) ? $hashmap[$v]+1 : 1; } foreach ($hashmap as $k => $count) { if ($count === 1) { echo $k; break; } }

Slide 121

Slide 121 text

Algorithms time complexity O(n)

Slide 122

Slide 122 text

Algorithms 8 queens Place eight queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal.

Slide 123

Slide 123 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 124

Slide 124 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 125

Slide 125 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 126

Slide 126 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 127

Slide 127 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 128

Slide 128 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 129

Slide 129 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 130

Slide 130 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 131

Slide 131 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 132

Slide 132 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 133

Slide 133 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 134

Slide 134 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 135

Slide 135 text

Algorithms public function run() : bool { // 8 to the power of 8 = // 16,777,216 possible board configurations $board = $this->generateBoard($hash); if (!$this->hasCollisions($board)) { return true; } $this->run($hash-1); }

Slide 136

Slide 136 text

Algorithms time complexity Brute Force = O(nn) https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 137

Slide 137 text

Algorithms https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 138

Slide 138 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 139

Slide 139 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 140

Slide 140 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 141

Slide 141 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 142

Slide 142 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 143

Slide 143 text

Algorithms 8 queens https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 144

Slide 144 text

Algorithms interface SolverInterface { public function getBoard() : array; public function format() : string; public function hasCollision(int $row, int $col) : bool; public function run(int $col) : bool; } class NQueensSolver implements SolverInterface {}

Slide 145

Slide 145 text

Algorithms $solver = new NQueensSolver(8); $solver->run(); $expectedBoard = [ [1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0] ]; echo 'Tests ' . ($solver->getBoard() === $expectedBoard ? 'passed 🎉' : 'failed 🚨');

Slide 146

Slide 146 text

Algorithms public function __construct($n=8) { $this->n = $n; $this->board = array_fill( 0, $n, array_fill(0, $n, 0) ); }

Slide 147

Slide 147 text

Algorithms $this->board = [ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0] ];

Slide 148

Slide 148 text

Algorithms public function getBoard() : array { return $this->board; }

Slide 149

Slide 149 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 150

Slide 150 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 151

Slide 151 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 152

Slide 152 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 153

Slide 153 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 154

Slide 154 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 155

Slide 155 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 156

Slide 156 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 157

Slide 157 text

Algorithms public function run($col=0) : bool { // return true if we've iterated over the whole board if ($col >= $this->n) { return true; } // iterate over the rows for ($row = 0; $row < $this->n; ++$row) { if (!$this->hasCollision($row, $col)) { // place a queen $this->board[$row][$col] = 1; // check the next column to see if this worked if ($this->run($col+1)) { return true; } // this didn't work so let's remove the queen, backtrack, and try the next row $this->board[$row][$col] = 0; } } return false; }

Slide 158

Slide 158 text

Algorithms public function hasCollision(int $row, int $col) : bool { // check the current row for ($thisCol = 0; $thisCol < $col; ++$thisCol) { if ($this->board[$row][$thisCol]) { return true; } } // check diagonally to the top left // no need to check the top right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisRow >= 0 && $thisCol >= 0; $thisRow--, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } // check diagonally to the bottom left // no need to check the bottom right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisCol >= 0 && $thisRow < $this->n; $thisRow++, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } return false; }

Slide 159

Slide 159 text

Algorithms public function hasCollision(int $row, int $col) : bool { // check the current row for ($thisCol = 0; $thisCol < $col; ++$thisCol) { if ($this->board[$row][$thisCol]) { return true; } } // check diagonally to the top left // no need to check the top right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisRow >= 0 && $thisCol >= 0; $thisRow--, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } // check diagonally to the bottom left // no need to check the bottom right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisCol >= 0 && $thisRow < $this->n; $thisRow++, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } return false; }

Slide 160

Slide 160 text

Algorithms public function hasCollision(int $row, int $col) : bool { // check the current row for ($thisCol = 0; $thisCol < $col; ++$thisCol) { if ($this->board[$row][$thisCol]) { return true; } } // check diagonally to the top left // no need to check the top right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisRow >= 0 && $thisCol >= 0; $thisRow--, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } // check diagonally to the bottom left // no need to check the bottom right since we're processing one column at a time for ($thisRow = $row, $thisCol = $col; $thisCol >= 0 && $thisRow < $this->n; $thisRow++, $thisCol--) { if ($this->board[$thisRow][$thisCol]) { return true; } } return false; }

Slide 161

Slide 161 text

Algorithms time complexity Brute Force = O(nn) Backtracking = O(n!) https://en.wikipedia.org/wiki/Eight_queens_puzzle

Slide 162

Slide 162 text

Data Structures algorithms IRL https://en.wikipedia.org/wiki/Radix_tree

Slide 163

Slide 163 text

No content

Slide 164

Slide 164 text

🛠 WORKSHOP https://bit.ly/passTechInterview ↓ Initial Phone Coding Test

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

1
 Phone 
 Screen 2
 Manager 
 Screen 3
 Coding Test 4 Onsite Evals

Slide 167

Slide 167 text

Stages 4. Onsite Evals • 4-6 hours onsite • Fly in, if not local

Slide 168

Slide 168 text

Stages 4. Onsite Evals • Coding • Behavioral • System Design

Slide 169

Slide 169 text

Stages 4. Onsite Evals • Arrive Thursday night • Interviews start 9am Friday

Slide 170

Slide 170 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:20 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 171

Slide 171 text

No content

Slide 172

Slide 172 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 173

Slide 173 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 174

Slide 174 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 175

Slide 175 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 176

Slide 176 text

Examples “Given an array of the 100 most common child names in 2021, sort them alphabetically” “List the top 10 products sold alphabetically on the sidebar of a site. Given an array of the top 1,000 products where the key is their popularity and the value is the product name. Return an array.” Quicksort

Slide 177

Slide 177 text

Examples “Given an array of the 100 most common child names in 2021, sort them alphabetically” Quicksort

Slide 178

Slide 178 text

Examples “Given an array of the 100 most common child names in 2021, sort them alphabetically” const childNames = […]; return childNames.quicksort(); Quicksort

Slide 179

Slide 179 text

Examples “List the top 10 products sold alphabetically on the sidebar of a site. Given an array of the top 1,000 products where the key is their popularity and the value is the product name. Return an array.” Quicksort

Slide 180

Slide 180 text

Examples const products = […]; return products.quicksort() .slice(0, 10) .quicksort(); “List the top 10 products sold alphabetically on the sidebar of a site. Given an array of the top 1,000 products where the key is their popularity and the value is the product name. Return an array.” Quicksort

Slide 181

Slide 181 text

Examples const products = […]; return products.quicksort() .slice(0, 10) .quicksort(); “List the top 10 products sold alphabetically on the sidebar of a site. Given an array of the top 1,000 products where the key is their popularity and the value is the product name. Return an array.” Quicksort

Slide 182

Slide 182 text

🛠 WORKSHOP https://bit.ly/passTechInterview ↓ On-Site Coding Test

Slide 183

Slide 183 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 2:30-3:20 - debrief w/ recruiter

Slide 184

Slide 184 text

Examples System Design

Slide 185

Slide 185 text

🛠 WORKSHOP https://bit.ly/passTechInterview ↓ On-Site Sys Design

Slide 186

Slide 186 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 3:30-4 - debrief w/ recruiter

Slide 187

Slide 187 text

Stages 4. Onsite Evals • 9-9:30 - arrival / meet recruiter • 9:30-10:20 - meet hiring manager • 10:30-11:20 - coding w/ 2 sr engineers • 11:30-12:30 - sys design w/ sr architect • 12:30-1:30 - lunch w/engineer on team • 1:30-2:20 - coding w/ 1 staff engineer • 3:30-4 - debrief w/ recruiter

Slide 188

Slide 188 text

No content

Slide 189

Slide 189 text

No content

Slide 190

Slide 190 text

Offer

Slide 191

Slide 191 text

Negotiation

Slide 192

Slide 192 text

Examples Career Ladder

Slide 193

Slide 193 text

Total Comp = Salary + Equity + Benefits

Slide 194

Slide 194 text

No content

Slide 195

Slide 195 text

Parting Thoughts

Slide 196

Slide 196 text

Practice

Slide 197

Slide 197 text

Examples

Slide 198

Slide 198 text

No content

Slide 199

Slide 199 text

Resources https://randallkanna.com/get-the-ultimate-list/ https://leetcode.com https://levels.fyi http://www.crackingthecodinginterview.com https://educative.io

Slide 200

Slide 200 text

Let’s Work Together Wayfair Careers Portal https://www.wayfair.com/careers/jobs Email me [email protected]

Slide 201

Slide 201 text

Thank You @benedmunds [email protected]