Algorithms, Data Structures, System Design and Interview Questions

A step-by-step process for solving algorithm questions

  1. Draw out a simple visual example.

    1. Do it in something like Balsamiq.

    2. Copy-paste it to visually show what the step-by-step process should look like.

    3. Think about what variables you want at each step to answer the relevant question you have to be able to calculate the desired answer.

  2. Ask yourself: What features of the state of each ‘step’ through the input can you think of to assign names to? Write the code needed to calculate/update these values with each iteration (or just have them as stub functions to be filled in later) and it could give you enough of a step in the right direction for the rest of the solution to make itself clear.

How I study

  1. I have Neetcode questions in Anki.

  2. I track which questions I’ve actually studied by checking them off on the Neetcode website.

  3. I’m aiming to go through all questions of a type before moving onto the next type.

  4. Creating Replit versions:

    1. If I can’t access the question on Leetcode (it’s a premium question) or the Lintcode version (or if the Lintcode version is too different from the Leetcode question), I can create a Replit version in here.

    2. Make the ‘template’ version of the question, then when you actually want to do the question, use that same Replit and you can just use the git feature to discard all of the changes you made to the code when you’re done.

Data structures


  • What is the threshold at which point it's a good idea to create a class for a data structure?

Non-algorithm-specific interview advice

Algorithms-Specific Informational Websites (not programming challenge websites)



Interview Challenge sites

Front-end interview challenge / prep sites

Interview Prep sites

Non-Interview-Prep Challenge sites

  • USACO Training

    • rec'd by Choketsu

    • How to get started training at the USACO Gateway:

    • What is it like to attend the USACO training camp?

      • ... ining-camp

      • It's only a week

      • New people just get 3 hours of lab/lecture in the morning

      • The top guys do a contest every day. Sometimes the contest goes until after lunch, otherwise they just review after lunch. (Seems like 5 hrs/day)

      • Then everyone has fun for the rest of the day

    • If one is stuck on a particular section, is it worthwhile to keep on trying to solve the given problem, or should one move on to other sources in preparation for programming contests?

    • Richard Peng, one of the most successful Canadian IOI competitors of all time, on the USACO training pages:

      • "USACO training was put together before the major IOI escalation (Finland/Korea/Wisconsin). A lot of the techniques described on it are no longer useful on *OI and a lot of the 'hot' topics over the past few years are not covered. Also, a lot of the bottle necks on training are quite meaningless, and they typically cause a lot of frustration and time waste on the scale of months."


Linked Lists


Dynamic Programming (DP)




Binary Trees

The interview process


  • The stages of understanding: (think about it as high-level vs. low-level understanding, or broad vs. deep understanding)

    1. Broad / High-level: Recognition of terms / basic understanding of definitions

    2. High / Mid-level Knowing when to use a particular tool

    3. Mid/Low-level: Knowing how to do something

    4. Deep / Low-level: Knowing about tricky things / edge cases / less-common problems

  • Algorithms

    • Testing recognition / basic understanding

      • What does "BFS" stand for?

        • Acronym used in IK

    • Give an example of an O(X) algorithm.  ← See 'The Pragmatic Programmer' for examples.

      • Give an example of an O(1) algorithm.

      • Give an example of an O(lg(n)) algorithm.

        • "Binary search of a sorted list, traversing a binary tree, and finding the first set bit in a machine word(?)."

      • Give an example of an O(n) algorithm.

        • Exhaustive searches, finding the maximum value in an array, and generating checksums.

      • Give an example of an O(m * n) algorithm.

        • "This commonly occurs in simple sorting algorithms, such as bubble sort, where the outer loop scans each element in the array in turn, and the inner loop works out where to place that element in the sorted result."

      • Give an example of an O(n*lg(n)) algorithm.

        • Quicksort

      • Give an example of an O(n^2) algorithm.

      • Give an example of an O(n^3) algorithm.

      • Give an example of an O(2^n) algorithm.

      • Give an example of an O(n!) algorithm.

        • "Whenever algorithms start looking at the permutations of things, their running times may get out of hand. (...) Examples include algorithms for many of the acknowledged 'hard' problems–the traveling salesman problem, optimally packing things into a container, partitioning a set of numbers so that each set has the same total, and so on. Often, heuristics are used to reduce the running times of these types of algorithms in particular problem domains."

  • Arrays and other Ad-hoc problems

  • Concurrency

  • Dynamic Programming

  • Graphs and other Data Structures

  • Group coding mocks

  • Group mocks on Concurrency

  • Group mocks on Object Modeling

  • Group mocks on Scalable Systems

  • Linked Lists, Stacks, and Queues

  • Object Modeling

  • Orientation + Behavioral

  • Recursion

  • Scalable Systems

  • Sorting

  • Strings

  • Trees

    • Done - K-ary tree

      • Used in IK

    • BST

      • Used in IK

System Design

Learning resources

Articles / Forum posts