Big O Notation: Carding algorithm complexity for interviews
Memorizing a time complexity chart isn't enough for coding interviews. Learn how to use flashcards to internalize the logic behind Big O.
Hello there! If you are reading this, you are likely staring at a time complexity chart and wondering how you're supposed to recall forty different algorithm bounds under the pressure of a whiteboard interview.
A little about me first. My name is Daniel. I'm a third year engineering science student at UofT, specializing in machine intelligence. I've spent a lot of time in the trenches of LeetCode and technical prep. I also work on Nebulearn, which is a flashcard app built specifically to handle the kind of technical material that breaks traditional study tools. I have a conflict of interest here, but I will be the first to tell you that if you already have a massive Anki deck for your CS degree, you should probably just keep using it.
The problem with most Big O flashcards is that they treat complexity like a vocabulary word. You see "Merge Sort" on the front and "O(n log n)" on the back. This works for a multiple choice quiz. It fails in an interview because the moment an interviewer asks you to modify the algorithm (e.g., "What if we use a three-way split instead of two?"), your memorized label becomes useless.
To actually internalize Big O, you have to card the logic of the scaling, not just the string of characters.
The difference between labels and logic
Memorizing that a binary search is O(log n) is a shallow win. The real goal is to look at a piece of code and feel the logarithmic scaling because you recognize the pattern of "halving the search space."
When we talk about Big O in flashcards, we are usually trying to solve one of two problems. Either we are trying to remember the "standard" complexity of a common algorithm, or we are trying to build the intuition to calculate it for a brand new function. Most people stop at the first one.
A good complexity card should force you to explain the "why." If you can't explain why a recursive call stack adds O(n) space complexity to a simple depth first search, you haven't actually learned the theory; you've just memorized a trivia fact.
| Goal | Shallow Card (Bad) | Deep Card (Good) |
|---|---|---|
| Time Complexity | Front: QuickSort Average. Back: O(n log n). | Front: Why is QuickSort O(n log n) on average? Back: We divide the array into two parts (log n levels) and do O(n) work at each level. |
| Space Complexity | Front: Recursion space. Back: O(depth). | Front: What determines the space complexity of a recursive function with no extra data structures? Back: The maximum height of the call stack. |
| Scaling | Front: O(log n) meaning. Back: Logarithmic. | Front: If input size doubles and runtime increases by a constant amount, what is the Big O? Back: O(log n). |
Why the "Why" matters for interviews
Interviewers love to poke at the edges of your knowledge. They will ask about worst-case vs average-case scenarios. If you only have a card that says "Hash Map lookup: O(1)," you might freeze when they ask why it could ever be O(n).
If your cards include the mechanism (in this case, hash collisions leading to linked list traversal), you aren't just memorizing; you're rehearsing the explanation you'll give in the interview. You are closing the leetcode syntax vs logic gap by connecting the abstract theory to the actual code behavior.
This is especially true for recursive call stacks. Many students forget that even if they aren't declaring a new List(), the memory used by the system to track recursive calls counts toward space complexity. Carding the "height of the tree" as the unit of space for recursion is a much more durable mental model than just memorizing "O(n)."
How to card logarithmic scaling
Logarithms are the most common point of confusion in interview prep. Most people know that O(log n) is "fast," but they don't have a visceral sense of what it means.
When I make cards for logarithmic behavior, I focus on the "inverse" relationship. If O(2^n) means "one more item doubles the work," then O(log n) means "doubling the items adds only one more unit of work."
That "unit of work" is usually a single step, like a comparison in a binary search or a level in a balanced tree. If you card the relationship between input size and the number of steps, the Big O label becomes an afterthought. You are learning the shape of the growth, which is what the notation is actually for.
Where Anki and Quizlet fit in
If you are a medical student, Anki is the gold standard because of the sheer volume of facts. For computer science, it's a bit more nuanced.
Anki is great if you want to download a pre-made deck of 500 algorithm complexities and grind them for six months. It is free on desktop and Android, though AnkiMobile is about $25 one-time on iPhone. The learning curve is steep, but it handles long-term retention better than almost anything else.
Quizlet is often the first tool people reach for because it's easy to type a list of "Algorithm: Complexity" pairs. However, Quizlet's free "Learn" mode is now session-scoped. It helps you pass a test on Friday, but it doesn't have a true per-card due queue to keep that info in your head for an interview three months from now. They retired their "Long-Term Learning" feature years ago. If you want real spacing there, you have to pay for Plus, and even then, it isn't using a modern algorithm like FSRS.
If you are preparing for a specific interview loop, you need something that bridges the gap between a "quick set" and a "permanent queue."
Integrating code blocks into your cards
One of the biggest bottlenecks in spaced repetition for computer science is that code is hard to format. If you have to spend ten minutes fighting with LaTeX or Markdown just to show a nested loop, you'll stop making cards.
When I'm prepping, I find a snippet on LeetCode or in a textbook that perfectly illustrates a complexity class. For example, a nested loop where the inner loop starts at the index of the outer loop (the classic "handshake" problem). That's O(n^2), but seeing the code helps you remember why it's not just "n times n" but rather "n times n/2."
I work on Nebulearn, and one thing we did specifically for this was making sure code blocks are first-class citizens. You can paste a snippet directly into the card, and it looks like code, not a mess of unindented text. When you are reviewing, you see the loop, you identify the pattern, and you verify the complexity.
Building the intuition for "New" code
The final boss of Big O is the "unseen" function. This is where you are given a weird piece of logic in an interview and asked to analyze it.
To prepare for this, your flashcards should focus on "Complexity Patterns" rather than specific algorithms.
- Pattern: Divide and conquer with a linear merge step. Complexity: O(n log n).
- Pattern: Reducing the problem size by a constant fraction. Complexity: O(log n).
- Pattern: Visiting every node in a tree once. Complexity: O(n).
By carding these patterns, you develop a "Complexity Sense." You stop counting loops and start seeing how the data moves. This is the difference between a junior developer who has memorized a cheat sheet and a senior developer who understands how the system scales.
The failure mode of "Over-Carding"
You can go too far. You don't need a flashcard for every single variation of a bubble sort. If you spend three hours making cards and only twenty minutes reviewing them, you are procrastinating by "organizing."
Focus your cards on the things you actually get wrong in practice. If you consistently forget that Array.sort() in JavaScript has a specific time complexity (usually O(n log n) but implementation-dependent), make a card for it. If you already know that a for-loop over an array is O(n), do not waste a card on it.
The goal is to use the cards to fix the holes in your logic. Use the study apps that save the most time to ensure you are actually studying, not just clicking "create."
How Nebulearn handles the technical bottleneck
I built Nebulearn because I was tired of tools that felt like they were made for vocab words. When you're trying to card a complex recursive relation, you don't want to be limited to a tiny text box.
We use FSRS (Free Spacing Replacement System) by default, which is the most modern math for figuring out exactly when you're about to forget a card. For something like Big O, where the concepts are high-stakes but low-volume, you want that precision. You don't want to see the "Merge Sort" card every day if you already know it; you want to see it right as the "Why" starts to get fuzzy.
Our free tier gives you 1,000 saved questions and 40 weekly AI credits. There are no ads in the study session because nothing kills an interview-prep flow like a banner ad for a car insurance company popping up between your "Worst Case QuickSort" and "Heapsort" cards.
If your bottleneck is trying to move code snippets and logic diagrams from your interview prep notes into a real due queue without the friction of a 2005-era interface, Nebulearn is probably the right tool for the job.