Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 2.3 KB

Whiteboarding.md

File metadata and controls

46 lines (37 loc) · 2.3 KB

#Whiteboarding Whiteboarding is a big part of technical interviews. Here are some resources for you to practice shared with us via our Whiteboarding mentor, Phil Corliss.

Array Intersection

In ruby there's an array intersection operator. Try implementing it yourself using a brute force method with a time complexity of O(n^2), a method that uses hashes in unexpected ways with complexity of O(n) and a sorting solution with complexity of O(nlogn).

2.1.1 :009 > a = [ 1, 3, -4, 5, 6]; b = [2, 3, 4, 6, 77] => [2, 3, 4, 6, 77] 2.1.1 :010 > a & b => [3, 6]

Check out this site if you get stuck.

group_by in Ruby Enumerable

In ruby there's a group_by method on Enumerable. Try implementing it yourself. Take some time to think on how to implement it. Don't worry if you can't recall the syntax for accepting blocks.

(1..6).group_by { |i| i%3 } => {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}

Scaling Interview Questions

Scalability Fundamentals

Great resources on Big-O Notation and interviewing

Katas that you'll likely run into in an interview

Great Series of lectures from Berkely on Data Structures

An example of adding binary numbers via a wooden mechanical machine