Interview Day and Prior

Attention

Remember

  1. Acting smart is VERY risky. Especially when you know how to solve the first version of the problem.

  2. You DON’T need to remember how you solved it earlier. You CAN FIGURE IT OUT NOW.

  3. NOT GIVING UP is what would help. Just follow the PROCESS.

  4. If you mention alternate approaches, talk about the time/space complexity TRADE-OFF.

  5. EVERY question you’re asked is valid. It’s also okay to NOT know something.

  6. It’s OKAY to screw up. Just follow the PROCESS.

The Process

  1. Start with examples

  • Start with one small example. Specify input and output.

  • Confirm if the understanding of the problem is correct.

  • Confirm about the input range.

  • Identify corner cases.

  • Usually 3 examples are good - one for algorithm understanding, and 2 for corner cases.

  1. Start noting down obversations and approach in comments

  • Lay out the algorithm in words.

  • Mention time complexity in the notes.

  1. Code

  • Keep comments. Add code after it.

  1. Test

  • Dry run on examples and debug.

  1. Be prepared for follow ups.

Checklist

  1. Evaluate trade-offs.

  2. Ask clarifying questions before coding - range, sorted, streaming.

  3. Write the core logic.

  4. Check boundary conditions.

  5. Create test cases before dry running.

  6. Ensure a smooth implementation.

  7. Solve 3-4 follow-ups.

  8. Optimize time and space complexity.

  9. Use clear variable names and correct syntax.

  10. Wrap up efficiently.

During the interview: Remember

  1. Take your time - longer than you think you should.

Spend more time collaborating with the interviewer - planning, writing comments, discussing approach, brainstorming

  1. Collect observations about the problem.

Helps in understanding the nature of the problem. Identify base cases, edge cases.

  1. Sample inputs and outputs

Should be small enough - it should be possible to manually convert the input to output.

  1. Write pseudocode

  1. Think out loud in comments and in pseudocode.

  2. During actual coding, swap comments with actual code.

  3. If the approach itself is not clear, it’s okay to say: I am not sure about this. Need a min to think about it.

  1. Approaching a solution

  1. Get a brute force to work - verifies that we’re solving the right problem.

If an optimization on this isn’t immediately clear, ask if it’s okay to code this approach.

  1. Think and talk about runtime and memory constantly

Interviewer needs to know that you’re thinking about efficiency. Might give points.

  1. Whenever stuck, think about this:

  1. Can we map it to something that we know how to solve?

  2. What exactly is required?

  3. What’s the easiest way to get us there?

  4. What’s the bottleneck? What do we need to keep track of?

  5. What other ways we can get there?

  1. Getting to an optimal solution

  1. One way to think about this - analyze current runtime. Check for data structures/approaches which are next better. Can any of them work?

  2. Think if stuck because the input isn’t structured well for the task at hand.

  1. Can I preprocess the input so that the task gets done faster?

  2. We can either modify the algorithm to fit the data structure or modify the data structure to fit the algorithm. Latter is better.

  1. Writing code

  1. Fill out the outline first - fill in details later

  2. Follow single responsibility principles (SRP)

  3. Keep in mind of variable naming and readability.

Prior to the interview: Remember

  1. Take care of yourself

  1. Maintain motivation, confidence and mental health.

  2. Remember that you have other things going in life - getting this job would be good but not the end-goal of your life.

  1. Leading up to the interview day?

  1. 7-10 days leading up to the interview

  1. Revisit all basic data structures and algorithms. Follow the process as you do.

  2. Try to form a picture in your head of how the approach works. This is what you’ll remember.

  3. Pracice them 2-3 times if possible. Follow the process during this as well.

  1. 4-6 days leading up to the interview

  1. Work on problem solving approach for problems that you’ve already done.

  2. If feeling confident, try problems from the company tag. Else leave it.

  1. 2-3 days leading up to the interview

  1. Don’t try to solve any new ridiculuously hard problem. Don’t want to walk into the interview on a losing streak.

  2. Understand what makes you confident. Big picture, grasp on the bag of tricks, having the process reharsed and clear inside your head.

  3. It’s okay if you cannot recall something. Read/watch the exact approach from book/video and understand space & time complexity.

  1. 24 hours leading up to the interview

  1. Clear up your mind from everything. Hit the gym. Listen to music and watch something.

  2. Talk to people. Practice listening instead of being inside your head.

  3. Fast revisit of done problems (no code).