Backend Interview: 15 In-Depth Questions

Every question dissected into three layers: Plain Answer → Interviewer Focus → High-Score Sample.

How AI interview works
15 real questions·3 categories·Interviewer follow-up logic per question

Questions reflect common real-world prompts. The three answer layers are illustrative examples, not real interview transcripts.

15 questionsClick a question to expand the 3 layers

① Common plain answer

"On a composite index (a,b,c), queries must start from `a`. Skipping `a` fails to use the index, which shows in EXPLAIN."

Why this falls short: Recites superficial syntax without explaining how B+ Trees physically order composite keys hierarchically (subsequent columns are sorted only when preceding values match), nor how EXPLAIN key_len reveals effective prefix bytes during column-skipping or range queries.

② Interviewer follow-up logic

Which part of the index is actually utilized in `WHERE a = 1 AND c = 2`? How do you calculate key_len?Why does a range filter on `b` (e.g., `b > 10`) prevent subsequent column `c` from leveraging index lookups?If queries frequently skip column `a` to search on `b` and `c`, what are your architectural tradeoffs beyond just adding indexes?

③ Quantified high-score answer

Mechanistically, composite indexes in B+ Tree storage engines sort keys lexicographically in declaration order: column `b` is ordered strictly within identical values of column `a`, and `c` within `b`. Skipping the leading prefix breaks hierarchical binary search traversal, collapsing efficient index range lookups into expensive full table scans. When diagnosing queries using EXPLAIN, the key_len metric exposes the exact prefix byte length utilized; querying `WHERE a = 1 AND c = 2` on an `(a,b,c)` index matches only column `a` for index navigation, leaving `c` to function merely as an engine filter. In our financial transaction ledger handling 12,000 queries per second, prefix mismatches triggered excessive disk random reads, inflating p99 latency to 380 milliseconds. By restructuring composite column precedence to match query cardinality and deploying Index Condition Pushdown (ICP) to prune rows at the storage layer, we reduced table lookups by 78% and stabilized p99 latency under 24 milliseconds without inflating write amplification.

Finished the breakdown? Try a realistic mock interview

Start a round without signing up. Experience in-depth follow-up questions and surface your real project highlights.

Create free account

No credit card required · Free 600 credits on signup