Preparing for Technical Interviews

Welcome to my collection of programming interview preparation notes! This post gathers the notes I have made while preparing for my technical internship interviews. I thought that it could be benefical for others to show what I have done, and to give some tips.

1. Topics

These notes are a work in progress. Some topics are more complete than others as I focused on areas I needed to strengthen most. Currently, I have notes (and my favorites ⭐) on:

Bonus: Here is my cheatsheet for final reviews.

2. Tips

Python as preferred language.

I chose Python as my interview language for several reasons:

  • Python’s concise syntax is extremely handy during interview questions.
    • String operations and data-structures are almost trivial to use compared to Java or C++.
    • Sets, dictionaries, and list comprehensions allow very concise code.
    • These just work:
        # You can do multiple assignments in the same line
        a, b = 1, 2
        # Further, you can swap without worrying about order and temporary state
        a, b = b, a
        # Variables updated after evaluating all of RHS
        x, y = 1, 2
        x, y, z = y, x, x-y # z is 1-2 = -1, no worries about when x and y switches
        # You can chain inequalities
        0 <= i < len(grid) '⇒' 0 <= i and i < len(grid)
        # Meaning very concise code (also see ternary conditional assignment)
        dp[i][j] = dp[i-1][j-1] if 0<=i<len(grid) and 0<=j<len(grid[0]) else 0 
      
  • Python standard library is AWESOME:
    • After Python 3.7, dictionaries in python are ordered with respect to insertion order - making some questions such as LRU cache almost trivial (ordereddict still has few uses).
    • After Python 3.11, CPython’s list.sort() uses Powersort, which provides O(nlogn) worst case time, sorts in-place, and is stable. Overall just amazing.
    • defaultdict() gives you an dictionary with default values for uninitialized keys. You can just increment without considering special cases for when to initialize it.
        from collections import defaultdict
      
        # Count frequency of each letter in a sentence
        def count_letters(sentence):
            letter_count = defaultdict(int)  # Default value of 0 for any new key
            for char in sentence.lower():
                if char.isalpha():  # Only count alphabetic characters
                    letter_count[char] += 1
            return letter_count
                       
        frequencies = count_letters("Hello, World!")
        print(frequencies) # {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}
      

Question Selection: Neetcode 150

Rather than trying to solve random problems, I used Neetcode as my primary site which has a question set called “Neet 150” which an extended version of the famous “Blind 75.” Neetcode comes with some advantages over LeetCode:

  • Problems grouped by pattern/technique
  • Increasing difficulty levels within each category
  • Video explanations for each problem. Single source for solutions means consistent and opinionated.

Learning Resources

I used two main resources for learning the fundamentals:

  1. The Competitive Programmer’s Handbook - A comprehensive, high-quality resource that provided in-depth understanding of algorithms and data structures with clear explanations and examples. It is intended for competitive programming and uses C++, but this should not be a problem when learning about the topic.

  2. HelloInterview.com - This site was invaluable for providing reusable templates for common problem patterns. Instead of reinventing solutions each time, I learned standardized approaches that could be adapted to various problems. Also, for algorithms that you are learning for the first time, they provide nice animations which really speed up gaining some intuition.

My Study Workflow

With these resources, I had made myself the most basic workflow by roughly following these steps:

  1. Study/Revisit the fundamentals of the topic from the Competitive Programmer’s Handbook
  2. Learn and take notes on the template patterns from HelloInterview for that topic
  3. Solve some problems from that category on Neetcode, have ~20 minutes/problem while explaining as if in an interview
  4. After solving/failing, go over the solution and see what could be improved or was missed.

One important detail is that these questions need repetition. It is very important to (1) start as early as possible, (2) keep notes/track solved questions to revisit later, and (3) go over your notes and try again on some questions you have already solved.

Other tips

These are funnily the most important ones in my opinion.

  1. Apply early.
    • If you are applying for big tech internships, being among the first applicant exponentially increases your chances of getting an interview (in my opinion). Having a good resume and being early together is almost %80 of the way there.
    • It is important to catch the wave: Summer Big Tech internships in the EU usually start opening from September of the previous year. Learn the dates for companies you care about and track them during those months.
  2. Understand the Process
    • If you are targeting a specific company, it is a very good idea to understand their hiring process. You can search for sources on their hiring process, interview format, question difficulties etc.
    • If you had to read only one source to understand how big tech interview are graded, this provides a good picture to paint in your mind.
  3. Do Mock Interviews
    • Finally, preparing and taking an interview are different experiences. You have no idea if you would communicate effectively, be able to come up with correct solutions or manage your stress well until you actually attend an interview. The best way to gain experience is to take lots of interviews. The second best way is to do mock interviews.
    • Pramp is one such site, where you take turns as the interviewer and the interviewee. In the end, you see both through the perspective of an interviewer and you receive feedback from someone else about your performance and blind-spots. I highly recommend doing at least one if you have never interviewed before.

I wish you the best of luck!