Interview questions

Backend Developer Interview Questions & Answers

Fifteen questions a hiring team actually asks a Backend Developer — technical and behavioral — each with why they ask it and a strong, specific sample answer. Plus how to prepare, the red flags that sink candidates, and the questions to ask back.

By Hollis Barnett, Principal Job-Search Strategist · Updated June 27, 2026 · ~12 min read

Short version: A backend developer interview tests four things — fundamentals (APIs, HTTP, databases, data structures), system design (can you build something that scales and survives failure), operational judgment (how you debug, deploy, and handle a 3 a.m. incident), and collaboration (do you communicate trade-offs and review code well). Expect a recruiter screen, a coding round, a system-design round, and a behavioral panel. Below are 15 real questions with sample answers — and if you'd rather have a strategist run mock interviews with you, that's exactly what our Executive interview prep does.

What a backend developer interview tests & how the rounds work

A backend developer interview is not a trivia quiz on syntax — it's a test of whether you can build systems that stay correct and fast when real traffic, concurrency, and failure hit them. Interviewers probe four things, and nearly every question maps to one: fundamentals — APIs, HTTP semantics, databases, and the data structures behind your code; system design, because a backend engineer has to make something scale, stay available, and degrade gracefully under load; operational judgment, since the person who owns a service has to deploy it safely, observe it, and debug it in production at 3 a.m.; and collaboration, because backend work lives at the seams between teams and a sloppy contract or a bad code review costs everyone.

The process usually runs in four or five stages, lighter at startups and longer at larger engineering orgs:

  • Recruiter screen (25–30 min). Background, the languages and datastores you actually use, scope of systems you've owned, and salary expectations — high on fit, light on depth.
  • Technical phone screen / coding round. A live coding problem (often data structures, algorithms, or string/array manipulation), plus questions on time and space complexity. They want to see you reason out loud and handle edge cases, not just reach a green test.
  • System design round. An open-ended "design a URL shortener / rate limiter / notification service" prompt. They watch how you clarify requirements, estimate scale, pick a datastore, and reason about caching, partitioning, and failure — there is no single right answer.
  • Deep technical / domain round. Databases, indexing, concurrency, API design, caching, and queues — often tied to the company's actual stack and the messy realities of running it.
  • Behavioral / hiring-manager panel. STAR questions on debugging a production incident, a hard technical trade-off, a disagreement on a design, and how you handle being on call.

The questions below are grouped the way they're tested: technical and design first, then behavioral. For the behavioral ones, use the STAR method — Situation, Task, Action, Result — so you tell a tight, specific story instead of speaking in generalities.

Technical & role-specific questions

API design

1. How would you design a REST API for a resource, and what makes it well designed?

Why they ask: API design is the daily surface of backend work. They want to see you reason about contracts, HTTP semantics, and evolvability — not just memorize verbs.

"I model the API around resources, not actions — noun-based paths, with HTTP verbs carrying intent: GET to read, POST to create, PUT/PATCH to update, DELETE to remove, and I keep GET safe and idempotent so it never mutates state. I use status codes precisely: 201 with a Location header on create, 400 for malformed input, 401 vs 403 for unauthenticated vs unauthorized, 404 for missing, 409 for a conflict, 422 for validation. Beyond the basics, a well-designed API is versioned from day one, paginates lists with cursors rather than offsets at scale, returns a consistent error envelope, and is idempotent where it matters — a retried POST shouldn't create a duplicate charge. I document it with an OpenAPI spec so the contract is explicit. My test is whether a new client engineer could integrate from the docs alone without asking me what a field means."

Databases

2. When would you choose a relational database over a NoSQL store, and vice versa?

Why they ask: A check that you pick storage from access patterns and consistency needs, not hype. The wrong choice here is expensive and hard to undo.

"I start from the access patterns and the consistency requirements, not a preference. I reach for a relational database like PostgreSQL when the data is highly relational, I need ACID transactions and strong consistency, and the queries are varied — money movement, orders, anything where a half-applied write is unacceptable. I reach for NoSQL when I have a known, narrow access pattern at very high scale, a flexible schema, or a need to scale writes horizontally: a document store for denormalized aggregates, a key-value store for cache and sessions, a wide-column store for massive time-series. The honest answer in most systems is both — a relational system of record for the data that must be correct, and a NoSQL layer for high-volume or cache-like workloads. The failure mode I avoid is picking NoSQL to dodge schema design and then reinventing joins and transactions badly in app code."

Database performance

3. A query is slow in production. How do you diagnose and fix it?

Why they ask: Slow queries are the most common production performance problem. They want a methodical debugger who reads the plan, not someone who blindly adds indexes.

"I don't guess — I run EXPLAIN ANALYZE and read the actual plan. First I look for a sequential scan on a large table where a filter or join should use an index; that usually means a missing or unusable index — a function wrapped around an indexed column, an implicit cast, or a leading-wildcard LIKE that defeats it. I check that the index's leading columns actually match the query's filter and sort. I compare estimated vs actual rows; a big gap means stale statistics, so I run ANALYZE. Beyond indexing I look for N+1 patterns from an ORM, an unbounded result set that should be paginated, and lock contention. The fix is usually a targeted index, a query rewrite, or batching — and I add indexes carefully because every index slows writes. I validate by re-running EXPLAIN and confirming the plan changed and latency dropped, not just that it felt faster once."

Indexing

4. What is a database index, and what's the cost of adding one?

Why they ask: Indexes are the first lever for read performance, and the most misused. They want to know you understand the read/write trade-off, not just "indexes make things fast."

"An index is a separate sorted data structure — usually a B-tree — that lets the database find rows by a key in logarithmic time instead of scanning the whole table. The cost is that every index has to be updated on every insert, update, and delete, so indexes speed reads but slow writes and consume storage. That's why I don't index everything: I index the columns that actually appear in WHERE clauses, joins, and ORDER BYs on hot queries, and I use composite indexes where queries filter on multiple columns — order matters, leftmost columns first. For high-cardinality lookups a B-tree is right; for low-cardinality or full-text needs I'd consider a different index type. I confirm an index is actually used with EXPLAIN, because an unused index is pure write overhead. On a write-heavy table I think hard before adding one."

Concurrency

5. How do you handle a race condition when two requests update the same record at once?

Why they ask: Concurrency bugs are subtle, intermittent, and brutal in production. They want to see you reach for real concurrency control rather than hoping it won't happen.

"A race condition is the lost-update problem — two requests read the same value, both act on the stale read, one silently overwrites the other, like two users buying the last item in stock. I match the control to the contention. Low contention: optimistic locking — a version column, and the update only commits if the version still matches what I read, otherwise I retry or return a conflict. High contention or a critical section: pessimistic locking — SELECT ... FOR UPDATE inside a transaction so the second request waits. For counters I push the work into the database as an atomic UPDATE instead of read-modify-write in app code. The principle is to make the check and the change one atomic operation the database guarantees, not to trust application timing. I keep transactions short so a lock doesn't become a deadlock or a throughput bottleneck."

Reliability

6. What does idempotency mean, and why does it matter for a backend API?

Why they ask: Distributed systems retry. An engineer who doesn't design for idempotency ships double-charges and duplicate orders. It's a core distributed-systems instinct.

"An idempotent operation produces the same result whether it runs once or many times. It matters because networks are unreliable: a client sends a request, the response is lost, the client retries — and if the operation isn't idempotent, the retry double-charges a card or creates a duplicate order. GET, PUT, and DELETE are idempotent by HTTP semantics; POST is not, which is the dangerous one. For a POST that must be retry-safe, I require an idempotency key — a unique token the client generates and sends. The server stores the key with the result of the first success, and if the same key arrives again it returns the stored result instead of doing the work twice. That's exactly how payment APIs make a retried charge safe. Designing for idempotency is what lets clients, gateways, and queue consumers retry freely — which, in a distributed system, they will do whether you planned for it or not."

Caching

7. How and where would you add caching, and what can go wrong?

Why they ask: Caching is the highest-leverage and most footgun-prone performance tool. They want to hear you weigh staleness and invalidation, not just bolt Redis onto everything.

"I add caching only after I know the workload is read-heavy and the data tolerates some staleness, and I cache at the layer that gives the most leverage for the least risk — an in-memory or Redis layer for hot keys, HTTP caching with ETags at the edge for cacheable responses. My default pattern is cache-aside: read from cache, on a miss read the database and populate the cache with a sensible TTL. What goes wrong is mostly invalidation — serving stale data after a write — so I invalidate or update the cache on writes and lean on TTLs as a safety net. I also guard against a cache stampede, where a popular key expires and a flood of requests all hit the database at once, with request coalescing or jittered TTLs. The honest framing in the interview is that caching trades freshness for speed, and the engineering is in managing that trade deliberately."

Messaging

8. When would you use a message queue instead of a synchronous call?

Why they ask: Async architecture separates a junior who chains synchronous calls from someone who decouples and absorbs load. They want to hear the trade-offs, not buzzwords.

"I use a message queue when the work doesn't need to finish before I respond to the user, when I want to decouple producer and consumer so one can fail or scale independently, or when I need to absorb a load spike by buffering rather than overwhelming a downstream service. Sending a welcome email or generating a thumbnail after signup is a perfect fit — the user shouldn't wait on it. The trade-off is that I give up immediate consistency and take on the complexity of retries, ordering, and at-least-once delivery, which means consumers have to be idempotent because a message can be delivered twice. I plan for failure with a dead-letter queue for poison messages and monitoring on queue depth. If the caller genuinely needs the result before responding — a payment authorization — I keep it synchronous. The decision is about whether the user must wait and whether the systems should be coupled."

System design

9. Design a URL shortener. How would you approach it?

Why they ask: The canonical system-design warm-up. They're testing whether you clarify requirements, estimate scale, and reason about reads vs writes — not whether you memorized an answer.

"First I clarify requirements and scale: how many writes (new short links) and reads (redirects) per second, expected ratio — this is heavily read-dominant — and whether links expire or need analytics. For the core, I generate a short unique key per long URL: either a base-62 encoding of an auto-increment ID or a hash with collision handling. I store the key → long-URL mapping in a datastore keyed by the short code, which is a simple high-volume lookup that fits a key-value store well. Because reads vastly outnumber writes, I put a cache in front of the hot keys and serve the redirect with a 301/302. I scale reads with replicas and the cache, and shard by the short key if write volume demands it. I'd call out the trade-offs: 301 caches in browsers and reduces load but hurts analytics, 302 keeps every redirect visible. The point is to drive the design from the access pattern — tiny writes, massive cached reads."

Security

10. How do you prevent SQL injection and handle authentication securely?

Why they ask: Security is non-negotiable for backend roles. They want reflexive correct habits — a candidate who hand-builds SQL strings or stores plaintext passwords is disqualifying.

"For SQL injection, the answer is reflexive: never concatenate user input into a query. I use parameterized queries / prepared statements so input is always treated as data, never executable SQL, and I validate and constrain input at the boundary as defense in depth. For authentication, I never store plaintext passwords — I hash them with a slow, salted algorithm built for it like bcrypt or Argon2, never a fast hash like MD5 or SHA-256 alone. For sessions I use signed, expiring tokens, scope them with least privilege, and keep secrets out of code and in a secrets manager. I also enforce HTTPS everywhere, rate-limit auth endpoints to blunt brute force, and treat every external input as hostile. The framing I bring is that security is a property of the defaults — if the easy path in the codebase is the safe path, the team stops shipping vulnerabilities by accident."

Behavioral questions (use STAR)

For each of these, structure your story as Situation → Task → Action → Result. Keep the Situation short, spend most of your words on the Action, and always land a concrete, ideally quantified Result. For more depth see our guide to behavioral interview questions.

Behavioral · Debugging

11. Tell me about a time you debugged a difficult production issue.

Why they ask: Production incidents are where backend engineers earn trust. They want someone who works from evidence and telemetry, stays calm, and prevents the recurrence.

S/T: "Our API's p99 latency started climbing and a fraction of requests began timing out, but only under load, and I needed to fix it before it triggered a wider outage. A: Rather than guess, I went to the telemetry — traces showed the time was spent waiting to check out a database connection, not running queries, which pointed at connection-pool exhaustion. I traced it to a code path that opened a transaction and then made a slow external API call while holding the connection, so under load every connection was tied up waiting on a third party. I moved the external call outside the transaction so the connection returned to the pool immediately, added a timeout on that call, and set an alert on pool saturation. R: Latency returned to baseline, the timeouts stopped, and the new alert later caught a similar regression before it ever reached customers."

Behavioral · Trade-offs

12. Describe a hard technical trade-off you had to make.

Why they ask: Senior backend work is trade-offs, not right answers. They want to see you weigh options explicitly and own the decision, including its cost.

S/T: "We needed to ship a reporting feature fast, and the clean solution — a real event pipeline — was weeks of work we didn't have before a committed launch. A: I laid out the options to the team: build the pipeline now, or ship a nightly batch job that aggregated the data on a schedule. I argued for the batch job, because the reports only needed daily freshness and the pipeline's complexity wasn't justified yet. I made the trade-off explicit — we'd accept up-to-24-hour staleness now in exchange for shipping on time — and wrote a short doc so the decision and its known limits were on record, with a clear trigger for when we'd graduate to streaming. R: We launched on schedule, the batch job served fine for months, and when real-time demand finally appeared we replaced it deliberately instead of in a panic — because the limitation was a known, documented choice, not a surprise."

Behavioral · Collaboration

13. Tell me about a time you disagreed with a teammate on a technical decision.

Why they ask: Backend systems are built by teams. They want to see you push for the right answer with evidence and still keep the relationship and the team intact.

S/T: "A teammate wanted to introduce a new datastore for a feature, and I thought it added operational burden we didn't need. A: Instead of arguing in the abstract, I asked what specific problem the new store solved, and we found it was a query pattern our existing PostgreSQL could handle with a proper index and a small schema change. I prototyped that path and shared the numbers — comparable performance, no new system to operate, monitor, or back up. I made clear I'd back the new datastore if the data showed it was needed, so it was about the evidence, not winning. R: We kept the existing database, avoided adding a system to the on-call surface, and shipped faster — and because I'd engaged with his actual concern rather than dismissing it, the working relationship got stronger, not worse."

Behavioral · Ownership

14. Tell me about a time you broke production — or shipped a bug that reached users.

Why they ask: The accountability question. They want someone who owns the mistake, fixes it cleanly, and turns it into a systemic safeguard — not someone who deflects blame.

S/T: "I deployed a migration that added a NOT NULL column without a default to a large table, and it took a lock that stalled writes — the app started erroring for users. A: I rolled back immediately to stop the bleeding rather than trying to fix forward under pressure, confirmed the service recovered, then communicated clearly to the team what happened. I reworked the change into a safe, backward-compatible migration — add the column nullable, backfill in batches, then add the constraint — and shipped it without downtime. R: The fix went out clean, and I turned the lesson into a guardrail: I wrote up our safe-migration pattern and added a CI check that flags risky schema changes, so the next person couldn't repeat my mistake. Owning it openly mattered more than the bug itself — that's how a team keeps trusting each other to deploy."

Behavioral · Motivation

15. Why backend engineering — and why this role specifically?

Why they ask: Fit and genuine interest. A specific, researched answer beats "I like building things," and signals you understand the role and will stay.

"I'm drawn to backend because I like the part of the system where correctness and scale actually get decided — the data model, the consistency guarantees, the behavior under load. There's real satisfaction in a service that stays fast and correct while traffic grows and dependencies fail. I'm interested in this role specifically because you're handling genuinely high throughput and investing in reliability rather than treating it as overhead, which is exactly the kind of hard backend problem I want to own end to end. I also noticed you run PostgreSQL with an event-driven layer — that's a stack I've worked in and enjoy, and it tells me the team cares about picking the right tool rather than chasing the newest one. That's the environment where I do my best work."

Pattern to notice: every strong answer above does the same thing — it reasons from requirements and trade-offs, reaches for the mechanism the system actually guarantees (an atomic update, an idempotency key, a read of the query plan) instead of hope, and ends in a concrete result or a safeguard against recurrence. Interviewers reward the engineer who designs for failure and retries, not the one who recites the most patterns.

How to prepare for a backend developer interview

Preparation for a backend interview is concrete and rehearsable. Don't just re-read theory — practice reasoning out loud and have your stories and designs ready.

  • Make the fundamentals automatic. Be able to talk through REST and HTTP semantics, idempotency, ACID, indexing and the read/write trade-off, optimistic vs pessimistic locking, and caching with invalidation — without hesitating.
  • Drill data structures and Big-O. The coding round leans on arrays, hash maps, trees, and graphs, plus time and space complexity. Practice talking through your approach and edge cases before you write code, and test on your own.
  • Practice 3–4 system designs out loud. A URL shortener, a rate limiter, a notification service, a news feed. Drive each from clarifying requirements → scale estimate → datastore choice → caching/partitioning → failure modes. The structure matters more than the "answer."
  • Prepare 5–6 STAR stories. Cover a production incident you debugged, a hard trade-off you owned, a technical disagreement, a bug you shipped and fixed, and a project you led. One strong, quantified story can flex across several questions.
  • Know your own résumé cold. Be ready to explain any system you built, any datastore you named, and any number you claimed. "How exactly did you cut p99 latency?" is a question you should welcome — see our matching backend developer resume example for how to write those claims so they invite the question.
  • Study the company's stack. Know their primary language, datastore, and scale challenges from job posts and engineering blogs, and tailor your design answers to their reality. It's a strong signal.
  • Do at least one full mock interview. Reasoning in your head isn't the same as defending a design while someone pokes holes in it. A live run surfaces the gaps — which is exactly what Marqee's Executive strategists do before your real interviews.

Common mistakes & red flags

Jumping into a system design without clarifying. Coding a solution before asking about scale, read/write ratio, and constraints signals you'll build the wrong thing in the real job. Always clarify and estimate first.
Adding an index (or Redis) to everything. Treating every performance question as "add an index" or "add a cache" without naming the write cost or the invalidation problem shows you don't understand the trade-off you're making.
Ignoring concurrency and failure. Designing only for the happy path — no retries, no idempotency, no race conditions — is the fastest way to look junior. Distributed systems fail and retry; say so.
No numbers in your stories. "I improved performance" is forgettable. "I cut p99 from 1.2s to 180ms by fixing connection-pool exhaustion" is hireable. Quantify the result.
Hand-building SQL strings or storing plaintext passwords. Any hint of string-concatenated queries or fast/unsalted password hashing is a hard fail on the security check. The safe pattern should be reflexive.
Silence while you think. In a live round, going quiet reads as being stuck. Narrate your reasoning, state your assumptions, and talk through the trade-offs — interviewers grade the thinking, not just the final answer.

Smart questions to ask the interviewer

Asking nothing is a red flag; asking sharp, role-specific questions signals seniority and helps you screen the team. Pick a few that fit the round, and lean on our full guide to questions to ask the interviewer.

  • What does the production stack look like — primary language, databases, message queue, and where the scaling pain is right now?
  • How does on-call work, what's the incident and postmortem culture, and how often does the team actually get paged?
  • What does the path from commit to production look like — CI/CD, test coverage, code review, and how long a deploy takes?
  • How much of the work is new feature building versus reliability, scaling, and paying down technical debt?
  • How are technical decisions made — design docs, RFCs, who owns architecture, and how disagreements get resolved?
  • What would I likely own end to end in the first six months, and how is success measured for this role?

Don't walk in cold — have a strategist run mock interviews with you.

Reading sample answers is a start. Our Executive-tier strategists run full mock interviews tailored to your target backend roles, pressure-test your system-design and incident answers, and prep you for your real ones — so you show up rehearsed, not rattled.

See Executive interview prep →How Marqee works

Frequently asked questions

A mix: a coding round on data structures, algorithms, and complexity; technical questions on REST API design, SQL versus NoSQL, indexing, concurrency and race conditions, caching, idempotency, and message queues; an open-ended system-design round (a URL shortener, rate limiter, or notification service); and behavioral STAR questions about debugging a production incident, a hard trade-off, a technical disagreement, and a bug you shipped and owned.

Command of HTTP and REST semantics, database fundamentals (ACID, indexing, the read/write trade-off, optimistic vs pessimistic locking), concurrency, caching with invalidation, idempotency, and asynchronous design with message queues — plus data structures, Big-O, and at least one language you can code fluently. System-design rounds test how you clarify requirements, estimate scale, choose a datastore, and reason about caching, partitioning, and failure.

Use STAR — Situation, Task, Action, Result. Keep the situation brief, spend most words on your specific actions, and always land a concrete, ideally quantified result. Prepare stories that show debugging from evidence (a production incident), owning a trade-off, navigating a technical disagreement, and taking accountability for a bug you shipped and turning it into a safeguard.

Yes. Interview prep is part of our Executive-tier Career Concierge: a strategist runs full mock interviews tailored to your target backend roles, pressure-tests your system-design, concurrency, and incident answers, and preps you for the specific companies you're facing. These free Q&A guides are the self-serve start; the done-for-you version is a real person rehearsing with you. See interview prep or our general interview questions guide.

Have a strategist prep you for the real thing

Sample answers get you thinking. They don't rehearse you, push back when you hand-wave a system design, or tailor your prep to the exact company and panel you're facing — and they don't get you the interview in the first place. That's where Marqee comes in. We're a Career Concierge: a real person runs your search, tailors your résumé to each backend posting, reaches the hiring manager directly, and finds a referral inside the company so you skip the pile. And at the Executive tier, your strategist runs full mock interviews and preps you for your real ones, so you walk in rehearsed.

Free guides first — then put a human in your corner.

Use these Q&A guides to prep yourself, or let an Executive strategist run mock interviews and manage your whole search end to end.

Get Executive interview prep →See how Marqee works

Keep exploring