4 ms·
A lot of those algorithms were research questions that people spent a large amount of time on. The best way to prepare for these types of interviews is doing to
by jeffreyrogers 8y ago
A lot of those algorithms were research questions that people spent a large amount of time on. The best way to prepare for these types of interviews is doing tons of practice problems until you get the pattern recognition to know what algorithms and data structures apply and fill out the code. Some things like DFS are pretty easy to derive from scratch, but others require more thought and very few people will be able to do it under pressure in an interview.
- ukj 8y agoAre you seriously trying to tell me that you remember the code for quick sort? I know what it does. Mechanically. I can visualize the recursive divide-and-conquer in my head. I can implement it in any language. All you have to understand is WHY the algorithm works.
- jeffreyrogers 8y agoI know how quicksort works well enough to write out some pseudocode quickly. Then once I've got the structure I can implement it. Same with lots of other algorithms, but if I had never heard of quicksort there's no way I would be able to come up with it during an interview.