Roadmaps / Java / Interview topics
Reference
Interview topics
Use these for Java and Spring backend 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 |
|---|---|---|
| Virtual threads against platform threads: when each? | What pins a virtual thread? | The measured limit (the database or pool), not the thread count |
| G1 or ZGC for this service? | How would you decide? | A GC log comparison on real load, and the cost of each in memory and CPU |
| A service's heap grows. How do you find why? | What if you cannot take a dump in prod? | Allocation profiling, JFR and a safe way to capture one |
| Why do microbenchmarks mislead? | How does JMH help? | A benchmark in the shape of real load, with spread reported |
System design prompt (20 minutes): orders-service at 300 requests a second with p99 under 300 ms. Outline: requirements and numbers (3 min), request path (5), threads and pools (5), failure cases (4), measurement (3).
Phase 2
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you publish an event after a database write? | What if the consumer sees it twice? | An outbox and an idempotent consumer, and the cost of each |
| How do you rename a column with no downtime? | What if a rollback is needed mid-way? | Expand and contract, with each step compatible both ways |
| Modular monolith or microservices? | When would you split? | The team and deploy reasons, and a boundary test that makes it cheap |
| How do you size a connection pool? | What happens when it is too big? | Little's law and the database's own limit |
System design prompt (20 minutes): move orders and billing into separate modules with no downtime. Outline: boundaries (4 min), data ownership (5), events (5), migration steps (4), rollback (2).
Phase 3
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you deploy with no dropped requests? | What happens to in-flight requests? | Readiness, a drain budget tied to the longest request and a test |
| How do you define a service level objective? | What does the error budget change? | A burn-rate alert and a rule for freezing risky releases |
| Your p99 doubled after a release. What now? | How do you decide to roll back? | A rollback rule agreed before the release, and a diff of metrics |
| How do you handle overload? | Why not a bigger queue? | Shedding at the edge, with a measured saturation point |
System design prompt (20 minutes): a Java API's p99 doubled after a release. Outline: first questions and rollback (3 min), metrics to compare (5), profiling plan (5), likely causes (4), the fix and the guard (3).
Phase 4
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you move 50 services to a new JDK? | How do you know it is safe? | Automated recipes, a parallel run and a staged rollout with a stop rule |
| A popular dependency has a critical flaw. What now? | How do you know whether you are affected? | An SBOM inventory that answers in minutes, not days |
| How do you keep modules from coupling over time? | Who owns the rule? | Architecture tests in CI and an owner for each exception |
| How do you write a decision others will accept? | What if a team disagrees? | The rejected options with numbers, and a date to revisit |
System design prompt (20 minutes): a paved road for 50 Java services. Outline: what is standard and what is free (4 min), the template and its checks (5), upgrades (4), exceptions (4), measuring adoption and incidents (3).