Skip to content
Tech Interview Prep

Software Engineer Interview Prep

Overview

Designs, 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

The 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

RoundUsual lengthWhat it scores
Recruiter screen30 minScope, level, logistics
Coding screen45-60 minCorrect solution, complexity stated, edge cases named
Onsite coding (1-2 rounds)45-60 min eachInvariants held under follow-ups, clean code
System design45-60 minRequirements, component boundaries, data model, trade-offs at stated scale
Debugging or practical45-60 minRoot cause from logs or code, fix, validation, rollout
Behavioral45 minOwnership 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: hours(v)=∑i⌈pi/v⌉hours(v)=\sum_{i}\lceil p_i / v \rceil searched over speeds 1 to max(p). The predicate hours(v) <= h is monotonic: it never becomes false as v grows.
  • Prefix sums: sum(i..j)=P[j+1]−P[i]sum(i..j)=P[j+1]-P[i], 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

Client API service Cache Primary DB Queue Worker

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

PromptStrong answer sounds likeWeak answer sounds like
Hash lookupAverage 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-sumOne 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 listThree pointers, one pass, O(1) space. Recursion would use n=10^6 stack frames and overflow.Recursion is cleaner.
Passing testsThe 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 bugReproduce 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

  1. State the complexity and its assumption before you write code.
  2. Name the invariant your loop maintains, then check it by hand on the smallest input.
  3. When a follow-up changes a constraint (mutation, stream, larger n), say which bound moves and why.
  4. Trace your code aloud on a small input, including the empty and single-element cases.
  5. 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.