Notes
Whiteboarding Tips and Tricks
- Companies whiteboard because steps for solving wb problems are almost nearly identical to solving real-world practical situations.
- They are looking to test a few things:
- Can you think algorithmically? Think efficiently?
- Are you a good communicator?
- Can you code neatly and correctly?
Correct Steps
- Repeat and clarify the problem.
- Identify Edge Cases & I/O.
- Pseudocode IF NECESSARY.
- Implement Code.
- Walk through an example input.
- Det. Time and Space (Theta).
- Time is expensive, space is cheap.
- Ask interviewer is optimization is even necessary.
Strategies
- Hash Maps.
- Divide and Conquer DP Programming.
- Using Math Properties.
Amortized Analysis
: Method for analyzing a given algorithm’s complexity, or how much a resource, especially time or or memory, it takes to execute.
- Keeping a Stack or Queue on the side to track values.
- Keep two pointers for the same iteration.
- Perform an operation twice.
- Sort the input.
- Approach the problem from the other end.
- Use binary numbers instead of decimal numbers.
- Use binary search instead of incrementation.
If you have seen the problem before, just tell them you have.