interview playbook · by input type
Edge-case checklists
Most bugs live at the edges: empty, one element, the very last index.
Find your input type below. Ask about two or three items before coding. Test two or three after.
01
Ask first, test later
You don't need every item every time. Before coding, ask about the ones that change your plan ("can it be empty?"). After coding, test the ones most likely to break your loops. Tick them as you practise, so they become a habit.
02
By input type
Array
String
Linked list
Tree
Graph
Matrix (grid)
Intervals
03
Numbers and overflow (Java)
These are Java rules, straight from the language spec. They catch even strong candidates.
Overflow and sign traps
sources
- Java Language Spec (SE 17) §15.18.2 — integer addition overflow ↗ official
- Java Language Spec (SE 17) §15.17.3 — remainder operator % ↗ official
- Java Language Spec (SE 17) §15.17.2 — division operator / (divide by zero) ↗ official
- Java SE 17 API — Math.abs(int) ↗ official
- Java Language Spec (SE 17) §5.1.7 — boxing conversion ↗ official
- Joshua Bloch, Google Research blog (2006) — Nearly all binary searches and mergesorts are broken ↗ official
04
Train it
Make edges a habit
Every problem in this course lists its edge cases. Before you open them, guess them yourself.
train itall problemsJava I/O & debugginglinked listsintervals