Jc-alt logo
jc
Textbook: Cracking the Coding Interview

Textbook: Cracking the Coding Interview

··
5 min read
·interviews

Cracking the Coding Interview

Preparing for technical interviews

1. The Interview Process

1.1 What

Most top tech companies and many other companies who copy them, use algorithm and coding problems to as the largest component of the interview process.

These boil down to problem solving questions where the interviewer is looking to evaluate your ability to solve algorithmic problems you haven't seen before, in order to assess based on the following categories;

  1. Analytical Skills:

    • Optimal solution
    • How much help needed
    • How long it took
    • etc
  2. Coding Skills:

    • Translate algorithm to code
    • Tradeoffs
    • Followup to design/architect a new solution
    • etc
  3. Technical Knowledge / Computer Science Fundamentals:

    • Strong fundamentals
    • etc
  4. Experience:

    • Good technical decisions in past
    • Built interesting
    • Challenging projects
    • etc
  5. Culture fit / Communication skills:

    • Personality and values
    • Fit with the company
    • etc

1.2 Why

Because its better than nothing. Companies need some way to filter the thousands of candidates per position. No point in complaining, just study and prepare for the interviews.

1.3 How Questions are Selected

Some companies have their own internal question banks, some use public question banks, and some use a combination of both.

Prepare for both cases:

  • current up to date company question
  • popular and important leetcode questions

1.4 Its All Relative

For a specific question, an interviewer is simply comparing you to other candidates:

  • 30 mins to solve
  • 50 mins to solve
  • 15 mins to solve but many hints
  • 10 mins with an alternate approach

A hard question thus isn't a bad thing. When its harder for you, its harder for everyone else as well. An interviewer is simply getting a feel for you performance relative to all other candidates they have ever asked this question to.

1.5 Frequently Asked Questions

No answer, rejection? If you haven't heard in 3-5 business days, check in with the recruiter, else move on.

Reapplying? Yes, but typically have to wait 6 months to a year.

2. Behind the Scenes

2.1 A Repeat Curtain

Most companies conduct their interviews in similar wars:

  1. 2x Screening Interviews

    • coding and algorithms questions
    • bar can be just as high as onsite interviews
  2. Onsite 4x-6x Interviews

    • the standard technical interview
  3. Lunch Interview

    • non technical
    • discuss interests
    • opportunity to discuss company culture
  4. After Interview Feedback

    • performance
    • feedback
    • decision

2.2 Per Company Basis

Microsoft

Amazon

Google

Apple

Facebook

Palantir

3. Special Situations

3.1 Experienced Candidates

3.2 Testers and SDETs

3.3 Product (and Program) Managers

3.4 Dev Lead and MAnagers

3.5 Startups

3.6 Acquisitions and Acquihires

3.7 For Interviewers

4. Before the Interview

4.1 Getting The Right Experience

4.2 Writing a Great Resume

4.3 Preparation Map

5. Behavioral Questions

5.1 Interview Preparation Grid

5.2 Know Your Technical Projects

5.3 responding to Behavioral Questions

5.4 So Tell Me About Yourself

6. Big O

6.1 An Analogy

6.2 Time Complexity

6.3 Space Complexity

6.4 Drop the Constants

6.5 Drop the Non Dominant Terms

6.6 Multi Part Algorithms: Add vs Multiply

6.7 Amortized Time

6.8 Log N Runtimes

6.9 Recursive Runtimes

6.10 Examples and Exercises

7. Technical Questions

7.1 How to Prepare

7.2 What You Need To Know

7.3 Walking Through a Problem

7.4 Optimize & Solve Technique 1: Look for BUD

7.5 Optimize & Solve Technique 2: DIY

7.6 Optimize & Solve Technique 3: Simplify and Generalize

7.7 Optimize & Solve Technique 4: Base Case and Build

7.8 Optimize & Solve Technique 5: Data Structure Brainstorm

7.9 Best Conceivable Runtime (BCR)

7.10 Handling Incorrect Answers

7.11 When You've Heard a Question Before

7.12 The Perfect Language for Interviews

7.13 What Good Coding Looks Like

7.14 Don't Give Up!

8. The Offer and Beyond

8.1 Handling Offers and Rejection

8.2 Evaluating the Offer

8.3 Negotiation

8.4 On the Job

9. Interview Questions

9.1 Data Structures

9.2 Concepts and Algorithms

9.3 Knowledge Based

9.4 Additional Review Problems

10. Solutions

10.1 Data Structures

10.2 Concepts and Algorithms

10.3 Knowledge Based

10.4 Additional Review Problems

11. Advanced Topics

11.1 Useful Math

11.2 Topological Sort

11.3 Dijkstras Algorithm

11.4 Hash Table Collision Resolution

11.6 AVL Trees

11.7 Red Black Trees

11.8 MapReduce

11.9 Additional Studying

12. Code Library

12.1 HashMapList(T,E)

12.2 TreeNode (Binary Search Tree)

12.3 LinkedListNode (Linked List)

12.4 Trie & TrieNode

13. Hints

13.1 Hints for Data Structures

13.2 Hints for Concepts and Algorithms

13.3 Hints for Knowledge Based

13.4 Hints for Additional Review Problems

14. About the Author