Interview Lab

Practice real-world technical screens, system design interviews, and behavioral rubrics with zero AI latency.

GitIntermediate

Explain the difference between `git merge` and `git rebase`, and when should you prefer one over the other?

Key Points:
  • `git merge` is non-destructive and records the exact chronological integration point.
  • `git rebase` yields a clean, linear project history, making `git bisect` and code audits straightforward.
  • Prefer merge when integrating completed feature branches into main via Pull Requests.
  • Prefer rebase locally on your private branch to pull in latest main updates before creating a PR.
Common Mistakes:
  • Confusing fast-forward merge with 3-way merge.
  • Believing rebase does not change commit hashes (it generates brand new SHA hashes for all replayed commits).
  • Rebasing public branches that other teammates have already branched off of, causing merge nightmares.
SystemDesignAdvanced

How would you design a distributed rate limiter that handles 100,000 requests per second across multiple data centers?

Key Points:
  • Sliding Window Counter offers the best balance between memory efficiency and burst smoothing.
  • Use Redis in-memory clusters with atomic Lua script execution to prevent race conditions during high concurrency.
  • Local in-memory token buckets (Node/Go memory) for coarse filtering, synced periodically with Redis to reduce network hops.
  • Return HTTP 429 Too Many Requests with `Retry-After` header.
Common Mistakes:
  • Relying on database SQL queries to check rate limit counts.
  • Ignoring clock drift across servers when using timestamp-based sliding logs.
  • Failing to discuss what happens if Redis becomes temporarily unreachable (fail open vs fail closed).
FrontendIntermediate

Explain the JavaScript Event Loop. How do the Call Stack, Macrotask Queue, and Microtask Queue interact?

Key Points:
  • The Call Stack executes synchronous code until empty.
  • Before pulling the next macrotask, the engine drains ALL pending microtasks completely.
  • Microtasks created by other microtasks execute in the same cycle before yielding to the browser render or next macrotask.
  • Browser UI rendering occurs between macrotask cycles if visual changes occurred.
Common Mistakes:
  • Thinking `setTimeout(fn, 0)` executes immediately after current line (it must wait for next macrotask turn).
  • Not knowing that an infinite microtask loop (e.g. recursive Promise.resolve().then) completely starves the browser and freezes the UI.
BackendAdvanced

Explain database transaction isolation levels and the anomalies they prevent (Dirty Read, Non-Repeatable Read, Phantom Read).

Key Points:
  • Read Committed is the default in PostgreSQL and SQL Server; Repeatable Read is default in MySQL InnoDB.
  • MVCC uses row version snapshots to allow readers to not block writers, and writers to not block readers.
  • Serializable guarantees identical outcomes to strictly sequential execution, but incurs highest rollback abort rates.
Common Mistakes:
  • Confusing Non-Repeatable Read (modifying existing rows) with Phantom Read (inserting new matching rows).
  • Assuming higher isolation levels have no performance cost.
SQLIntermediate

What is the difference between `WHERE` and `HAVING` in SQL, and how do database engines execute them?

Key Points:
  • Always filter non-aggregate conditions in WHERE to reduce the row count before grouping, improving performance.
  • HAVING without GROUP BY behaves as an aggregate filter on the entire table.
Common Mistakes:
  • Putting conditions that don't need aggregation inside HAVING (e.g. `HAVING status = 'active'`).
  • Trying to use column aliases created in SELECT inside the WHERE clause.
BehavioralBeginner

Tell me about a time you had a technical disagreement with a team member. How did you resolve it?

Key Points:
  • Frame the disagreement around engineering trade-offs (e.g., development speed vs long-term scalability).
  • Describe how you created a prototype, benchmark, or written RFC to evaluate both approaches objectively.
  • Show maturity by explaining how you reached consensus or embraced the team's direction wholeheartedly.
Common Mistakes:
  • Framing the other person as stubborn or incompetent.
  • Giving a story where you 'won' without acknowledging valid points from the other perspective.
  • Failing to state a clear measurable business or technical result.