Software Engineer Interview Prep
OverviewDesigns, builds, and operates reliable software systems, turning ambiguous product requirements into maintainable production code that survives load, incidents, and change.
Curated: · Written: · Reviewed:
- Interview Q&A
- 106
- Practice MCQs
- 101
Top 100 Software Engineer Interview Questions and Answers
The questions most likely to actually be asked, ranked by likelihood, with pro-level model answers.106 Q&ATop 100 Software Engineer Practice MCQs
Quick multiple-choice self-checks covering the same high-value ground, with an explanation for every answer.101 MCQsThe role in one line
Owns a production service end to end: turns a vague requirement into code that is correct under load, observable during incidents, and safe to change.
The interview loop
| Round | Usual length | What it scores |
|---|---|---|
| Recruiter screen | 30 min | Scope, level, logistics |
| Coding screen | 45-60 min | Correct solution, complexity stated, edge cases named |
| Onsite coding (1-2 rounds) | 45-60 min each | Invariants held under follow-ups, clean code |
| System design | 45-60 min | Requirements, component boundaries, data model, trade-offs at stated scale |
| Debugging or practical | 45-60 min | Root cause from logs or code, fix, validation, rollout |
| Behavioral | 45 min | Ownership and decisions, told in STAR |
Round lengths and counts vary by company.
Five must-know areas
- Arrays and hashing: where O(1) lookup fails and which bound you quote.
- Two pointers and sliding window: which pointer moves and why the loop stays O(n).
- Trees, graphs and heaps: which traversal answers which question, and when Dijkstra is the wrong tool.
- Caching, queues and database scaling: what a stale read or a redelivered message does to the store.
- Transactions and indexing: which anomaly each isolation level prevents, and what an index changes in the plan.
Numbers and formulas to have ready
- Hash lookup: expected O(1), worst O(n) under collisions. Java HashMap treeifies long buckets since Java 8, so worst case is O(log n) for Comparable keys. Python dict: average O(1).
- Binary search over N sorted items: about log2(N) comparisons, roughly 20 for N=10^6.
- Top-k with a size-k heap over n items: O(n log k). For n=10^7 and k=50, that is about 5.6 comparisons per element.
- Koko eating bananas: searched over speeds 1 to max(p). The predicate hours(v) <= h is monotonic: it never becomes false as v grows.
- Prefix sums: , with P built in O(n). A single mutation invalidates P. A Fenwick tree gives O(log n) for both update and query.
- Naive Fibonacci recursion at n=40: about 3×10^8 calls. Memoised or iterative: 40 steps.
- Trie autocomplete: O(L) per query, L the prefix length, independent of how many of the 2×10^5 names exist.
Reference architecture
The API serves reads from the cache and writes to the primary. Side effects go through the queue, so the worker must be idempotent. Say what the cache TTL does to staleness. Name the consistency guarantee the client gets.
Strong vs weak answers
| Prompt | Strong answer sounds like | Weak answer sounds like |
|---|---|---|
| Hash lookup | Average O(1) with a good hash. Worst case O(n) on collisions, so I quote average and state the assumption. | It's O(1). |
| Two-sum | One pass with a value-to-index map, O(n) time and space. I check the map before inserting so an element can't pair with itself. | Use two loops. |
| Reverse a list | Three pointers, one pass, O(1) space. Recursion would use n=10^6 stack frames and overflow. | Recursion is cleaner. |
| Passing tests | The tests cover these cases. They don't cover concurrent writes, so I'd add a race test before calling it done. | The tests pass, so it's done. |
| Production bug | Reproduce it, read the failing log line, confirm the root cause with a failing test, then ship behind a flag to 1% of traffic. | I'd restart the service. |
Interview tips
- State the complexity and its assumption before you write code.
- Name the invariant your loop maintains, then check it by hand on the smallest input.
- When a follow-up changes a constraint (mutation, stream, larger n), say which bound moves and why.
- Trace your code aloud on a small input, including the empty and single-element cases.
- Tie each design choice to a number from the prompt, such as QPS, data size or latency budget.
Last-week checklist
- Re-derive BFS, Dijkstra and Kahn's algorithm on paper.
- Work five Top 100 questions aloud in requirement, design, code, validation order.
- Write the Koko and prefix-sum formulas from memory.
- Prepare one incident in STAR with the root cause and the rollout.
- Confirm the language and version you will code in.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.