Roadmaps / JavaScript / Interview topics
Reference
Interview topics
Use these for JavaScript, Node.js and full-stack roles. Each follow-up is the question a good interviewer asks next. The Staff line is what lifts the answer.
Phase 1
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| Walk through the Node event loop and where microtasks run | What starves it? | How you would detect starvation in production and where the alert sits |
What does this refer to in each of these calls? | What changes with an arrow function? | A code rule that keeps this out of most of the codebase |
Promise.all, allSettled, any and race: when each? | What happens to the promises that lose? | Cancellation is not automatic: pass a signal and set a partial-failure policy |
| How do you limit concurrency? | How do you keep one slow key from blocking others? | Sizing with Little's law, and shedding load instead of queueing without bound |
| What is a closure, and how can one leak memory? | How would you find it? | A snapshot comparison with a retainer path, not a guess |
System design prompt (20 minutes): a link preview service at 200 requests a second. Outline: requirements and numbers (3 min), request path and cache (5), concurrency and timeouts (5), failure and abuse cases (4), observability (3).
Phase 2
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| ES modules against CommonJS: what are the differences? | How do you publish a package for both? | The dual package hazard and a test matrix as the proof |
| What is backpressure? | What does pipeline do on an error? | Where the cap is enforced so a hostile body cannot fill memory |
| Worker threads, cluster or separate processes? | What does structured clone cost? | A measured break-even and the operational cost of each |
| How do you handle money and dates? | What breaks across time zones and daylight saving? | Integer units, Temporal types and a test over the awkward dates |
What does SharedArrayBuffer give you, and what does it risk? | How do you avoid data races? | Why you usually prefer message passing, and the isolation it needs in browsers |
System design prompt (20 minutes): import a 2 GB CSV file through a Node service. Outline: limits and validation (4 min), streaming and backpressure (5), CPU work and threads (5), failure and restart (4), progress and observability (2).
Phase 3
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| A page feels slow to respond to taps. What do you do? | What does INP measure? | Field data against lab data, and what each can miss |
| What are hidden classes? | How can you spot a deoptimisation? | When this matters (hot paths) and when it is a distraction |
| A Node service's memory grows. How do you find why? | What if you cannot take a snapshot in production? | Sampling and allocation profiles, and a safe way to capture one |
| Why do microbenchmarks mislead? | How would you benchmark honestly? | Warm-up, spread and a benchmark in the shape of real load |
| How does garbage collection affect tail latency? | What can you change? | Allocation rate first, then settings, with the measurement that shows it |
System design prompt (20 minutes): a Node API's p99 doubled after a release. Outline: first questions and a rollback decision (3 min), metrics to compare (5), profiling plan (5), likely causes (4), the fix and the guard against a repeat (3).
Phase 4
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you stop SSRF when users supply URLs? | What about redirects and DNS rebinding? | Address pinning, an allowlist where possible, and a network-level backstop |
| How do you prevent XSS? | What does Content Security Policy add? | Output encoding as the rule, CSP as a second layer, and a rollout plan |
| A popular dependency is compromised. What now? | How do you know whether you are affected? | A lockfile and an inventory that answer it in minutes, not days |
| What is prototype pollution? | How would you find it in a codebase? | A lint and a test pattern teams can reuse |
| How do you deploy a Node service with no dropped requests? | What happens to in-flight work? | A drain budget tied to the longest request, tested with SIGTERM |
System design prompt (20 minutes): a safe-fetch layer for user-supplied URLs shared by 50 services. Outline: threat model (4 min), library and policy split (5), network controls (4), rollout and exceptions (4), measuring adoption and incidents (3).