About these notes

Typical coding interview corner cases


This is by no means an exhaustive list, and there are much better resources out there. It is just what I used when studying as a quick-ref when solving a problem.


  • Empty sequence
  • Sequence with 1 or 2 elements
  • Sequence with repeated elements


  • Empty string
  • Single character string
  • String with only one distinct character


  • Empty tree
  • One or two nodes
  • Skewed tree (like a linked list)


  • Empty graph
  • Graph with one or two nodes
  • Disjoint graph
  • Graph with cycles


  • Single interval
  • Non-overlapping interval
  • Interval within an interval
  • Duplicate interval

Linked Lists

  • One or two nodes
  • List has a cycle. Clarify with interviewer


  • Empty matrix
  • 1x1 matrix
  • Matrix with only 1 row/column

← back

Links to this note

Framework for coding interviews

Having a framework by which you approach every single technical interview greatly improves your chances of success. It can’t help you have a perfect session, but almost guarantees you will...

Questions to ask before you start coding during a technical interview

Size of the input? Range of values? Recursion stack issues. Is the input valid? How should the algorithm behave for corner cases? Can I mutate the input? Generally a bad...

Tech interview resources

tl;dr; This applies to Big Tech and other companies who are applying similar interviewing strategies. Spend 2 weeks reading “Cracking the Coding Interview” and familiarizing yourself with the process. Sign...