Backend Developer Scenario Questions (India)
Before walking into a technical or stakeholder discussion for Server Engineering, rehearse clear mental models across PostgreSQL, Express / NestJS, Redis. Active hiring pools show 825+ live openings seeking Node.js / Java / Go, Relational Schema Design, Query Tuning fluency right now.
- How do you prevent N+1 query bottlenecks in ORM or SQL list endpoints? — Replace per-row queries with single batch queries using JOINs, IN clauses, or Postgres LATERAL subqueries scoped with explicit limits.
- Compare pessimistic locking (SELECT FOR UPDATE) vs optimistic concurrency control. — Use SELECT FOR UPDATE when conflicts are frequent and transactions short; use version timestamps for low-contention edits without holding row locks.
- What causes PostgreSQL deadlock errors during concurrent batch inserts? — Concurrent transactions updating the same rows in different sequences deadlock; sort batches deterministically by primary/unique key before writing.
- How do you design graceful shutdowns for zero-downtime deployments? — Stop accepting new connections on SIGTERM, finish active requests, flush queue checkpoints, close DB pools, and exit cleanly.