1. What you need to know
MUST-HAVE KNOWLEDGE
data structures:
linked lists
tree, tries&graphs
stacks&queues
heaps
arraylists
hash tables
algorithms:
breadth-first search
depth-first search
binary search
merge sort
quick sort
concepts:
bit manipulation
memory(stack vs heap)
recursion
dynamic programming
Big O Time & Space
2. Walking through a problem
1.Listen (pay very close attention to any information in the problem description)
2.Example (special case)
3.Brute force (a naïve algorithm and its runtime), then optimize(do not code)
4.Optimize (use BUD optimization-bottlenecks/unnecessary work/duplicated work)
- Look for any unused info
- Solve it manually
- Solve it and then think about why the algorithm fails
- Make a time & space tradeoff
5.Walk through your approach in detail
6.Implement (write beautiful code)
7.Test, test in this order: (find bugs and fix them)
- Conceptual test
- Unusual & non-standard code
- Hot spots, like arithmetic and null nodes
- Small test cases
- Special cases and edge cases