Here is the link of video starting from 50:00
Here is the page of Cracking coding skills.
Go over an example of anagrams -
Algorithm problem
Anagram - what is anagram -
You need to print or return
I told you that all algorithms work
Dictionary
Why to put them on server?
Likely optimal approach is changed since server is talked about
Cache - precompute
Anagram server - what's the clue?
Ex: rates -> aster, stare, taser, tears
Clue: why is it on a server?
Interviewer is on your side
step 2: Draw an example
big enough + general purpose
Avoid special case - People get nervous - miss some detail
Draw an example, think about when you do this
Make good use of example
Most people draw example
Ex: intersection of two sorted arrays
example - better, big, no special cases
Brain - need more reading
Same size, one common element, ...
Ex: counting the intersection
No comments:
Post a Comment