"Count the number of ways" / optimal sub-structure / overlapping subproblems
Dynamic programming
"Minimum / maximum in a greedy local choice"
Greedy (prove exchange argument)
XOR to find unique / count set bits / subset enumeration via bitmask
Bit manipulation
Senior insight
Most interview problems are dressed-up versions of a handful of canonical
shapes. Train yourself on signals — the phrases in the problem —
not on memorizing solutions to specific LeetCode numbers.
3. Edge-case checklist
Run this list against every solution before you say "done".
Empty input
Single element
All identical elements
Already sorted / reverse sorted
Duplicate values
Negative values and zero
Very large input (integer overflow risk in mid = (lo + hi) / 2 — use lo + (hi - lo) / 2)
Cycles (in graphs and linked lists)
Disconnected graph components
Recursion depth on pathological inputs
4. Complexity computation cheat
Recognize the recurrence shape and read off the answer. For most interview
analysis this beats invoking the Master Theorem formally.
Recurrence shape
Result
Canonical example
T(n) = T(n/2) + O(1)
O(log n)
Binary search
T(n) = 2·T(n/2) + O(n)
O(n log n)
Merge sort, quicksort (average)
T(n) = 2·T(n/2) + O(1)
O(n)
Tree traversal of balanced tree
T(n) = T(n - 1) + O(n)
O(n²)
Selection sort, naive insertion sort
T(n) = T(n - 1) + O(1)
O(n)
Linked list traversal
T(n) = 2·T(n - 1) + O(1)
O(2ⁿ)
Naive Fibonacci without memoization
Amortized analysis in one paragraph
Some operations are expensive but happen rarely enough that the
average cost across many operations stays low. A dynamic array
doubles when full, costing O(n), but the cost is spread across the n−1
prior cheap inserts — so append is O(1) amortized, even
though the worst single call is O(n). Say "amortized" explicitly when
the worst case and the long-run average diverge.
5. What to say when stuck
Silence is the enemy. These phrases keep the interviewer in the loop and
often unlock the solution by forcing you to reason out loud.
"Let me re-read the problem and check my assumptions."
"I want to try a smaller example to see the pattern."
"What if I sort first — does that unlock a pattern?"
"Can I trade space for time here?" (e.g., hash map for lookup)
"Is there a way to precompute something so the inner loop is constant time?"
"Let me state the invariant I want to maintain, then design toward it."
6. Behavioral: the STAR template
A disciplined STAR answer is ~90 seconds. Budget your words accordingly —
over-spending on Situation is the most common mistake.
Letter
Part
Budget
Hint
S
Situation
1–2 sentences
Context the interviewer needs — team, stakes, constraints. Not your whole org chart.
T
Task
1 sentence
What you specifically had to do. Use "I", not "we".
A
Action
3–5 sentences
The decisions and trade-offs. This is the heart — spend most of your time here.
R
Result
1–2 sentences
Concrete outcome. Numbers when honest, qualitative when not. End with a lesson if you have one.
7. Questions to ask the interviewer
The questions you ask signal seniority. Skip "what do you like about
working here" — ask things that only this interviewer can answer.
What does a great engineer on your team look like 12 months in?
What is the single biggest technical challenge the team is facing right now?
How are architectural decisions made and documented here?
What is the on-call rotation like, and how do you balance feature work with reliability?
What would success in the first 30 / 60 / 90 days look like for this role?
How to actually use this page
Do not read this as prose. Use it as a recall prompt: cover the
right column of the signal table and test yourself on what pattern each
signal points to. Cover the "Write" column of the 7-step method and see
if you can produce the bullets yourself. Passive reading does not transfer
to the interview room.