Vinqi. Career Tools

Backend Developer Interview Questions and Answers

9 Backend Developer interview questions with a structure for each answer, a full sample answer, and the pitfall that sinks candidates.

Updated 2026-09-1814 min read2,983 words

How Backend Developer interviews are usually structured

Most Backend Developer loops have four rounds, and they are not testing the same thing. Read the round you are in before you decide what to prepare.

  1. Recruiter screen — motivation, timeline, and whether your experience matches the level of this Backend Developer role.
  2. Hiring-manager interview — your recent Backend Developer work, how you make decisions, and whether you can own the responsibilities in the posting.
  3. Role-specific deep dive — the Backend Developer questions below, with follow-ups that test whether your first answer was real.
  4. Cross-functional or panel round — collaboration, conflict, and written or live problem solving with people outside your Backend Developer function.

The most common reason strong Backend Developer candidates fail this loop is not missing knowledge. It is answering with a description of a team instead of a description of their own decisions.

Backend Developer interview questions and answers

For every Backend Developer question below you get the underlying assessment, an answer structure, a complete sample, and the mistake to avoid. The sample answers are there to show depth, not to be recited.

1. How do you make an API endpoint idempotent?

What they are assessing: Whether you understand duplicate-delivery risk in distributed systems and can design for it.

Structure
  1. Identify which operations must be safe to retry.
  2. Choose a mechanism: idempotency key, natural key or conditional write.
  3. Store the result and the key atomically in one transaction.
  4. Test concurrent retries and mid-transaction failures.
Sample answer

It depends on the operation. Reads are naturally idempotent, and so is a PUT that replaces a resource with an absolute value. The hard cases are POSTs that create something, like a payment. For those I require the client to send an idempotency key with each logical request. The server stores that key alongside the result in the same database transaction, so either both land or neither does. If the same key arrives again, I return the stored response instead of creating a second record. The key needs an expiry window, because the table would otherwise grow forever. I test it by firing the same request concurrently from two threads and asserting that exactly one record and one charge exist, and by killing the process mid-transaction to confirm the retry behaves correctly.

Common pitfall: Relying on a database unique constraint alone without returning the original response, which makes retries fail loudly instead of succeeding quietly.

2. A query that was fast last month is now slow. Walk me through your diagnosis.

What they are assessing: Whether you read execution plans and data instead of adding indexes at random.

Structure
  1. Confirm the symptom and when it started.
  2. Read the execution plan and compare estimated with actual rows.
  3. Check data growth, statistics and index usage.
  4. Fix the cause and verify on production-sized data.
Sample answer

I first confirm the symptom and its start time, because a sudden change usually correlates with a deploy or a data threshold. Then I run EXPLAIN ANALYZE on the real query and compare estimated rows with actual rows; a large gap means stale statistics or a bad join order. I check whether the query still uses its index or has fallen back to a sequential scan because the planner decided the selectivity changed. Common causes are a table that crossed a size threshold, a new OR condition that broke index usage, a missing composite index for a new filter combination, or an ORM that started generating an extra join. I fix the cause, re-run the plan, and verify with production-scale data rather than a small development copy.

Common pitfall: Adding an index to every column in the query, which slows writes and ignores what the execution plan is actually doing.

3. How do you handle a long-running background job that must not run twice?

What they are assessing: Distributed locking, scheduling and failure recovery knowledge for asynchronous work.

Structure
  1. Decide whether duplicate execution is dangerous or merely wasteful.
  2. Use a lease or advisory lock with an expiry.
  3. Make each unit of work idempotent and checkpoint progress.
  4. Alert on stale locks and failed runs.
Sample answer

First I ask what happens if it runs twice. If the job sends an email, a duplicate is annoying; if it moves money, it is a bug. For anything dangerous I take a lock before starting, either a database advisory lock or a lease row with an owner and an expiry, so a crashed worker does not hold the lock forever. Inside the job I make each chunk idempotent and checkpoint its progress, so a restart resumes rather than reprocessing everything. In a multi-worker deployment I make sure the scheduler fires once, usually by having workers compete for the lease instead of relying on wall-clock cron on every instance. Finally I alert on stale locks and on runs that exceed their expected duration, because a silently stuck job is worse than one that fails loudly.

Common pitfall: Assuming a single scheduler instance, which breaks the moment the service scales to more than one worker.

4. How do you decide between a SQL and a NoSQL database for a new service?

What they are assessing: Data modeling judgment grounded in access patterns rather than hype about either category.

Structure
  1. Start from the access patterns and consistency needs.
  2. Check whether relationships and transactions dominate.
  3. Consider scale, schema volatility and operational burden.
  4. State the trade-off you are accepting.
Sample answer

I start from the access patterns, not the technology. If the data is highly relational, if I need multi-row transactions, and if the queries are not fully known up front, a relational database is usually the better default because it lets me change my mind later with SQL. A document store makes sense when each record is read and written as a self-contained aggregate, the schema varies between records, and I need to scale writes horizontally without joins. A key-value store fits a cache or session lookup with a single access path. The trade-off I make explicit is that document stores push join logic into application code and make ad-hoc reporting harder, while relational databases make horizontal write scaling harder. I choose from the workload and name the cost.

Common pitfall: Choosing a technology because it is popular, without connecting the choice to access patterns or consistency requirements.

5. Tell me about a production incident you owned. What did you change afterward?

What they are assessing: Accountability, incident discipline and whether you turn a failure into a durable guardrail.

Structure
  1. Own the action plainly without hedging.
  2. Explain the mechanism so the cause is clear.
  3. Describe the immediate mitigation and recovery.
  4. Name the guardrail and the process change.
Sample answer

I once deployed a change that added a NOT NULL column with a default to a large table, and the migration held a write lock for about ninety seconds during peak traffic. I raised it in the incident channel immediately, we rolled the migration back, and traffic recovered. The mechanism was that I had tested on a copy at a fraction of production size, so the lock looked negligible. I added a pre-migration check that requires a row-count estimate and a lock-duration test on production-scale data, and the team adopted the expand/contract pattern for schema changes. The lasting change for me was refusing to treat works-on-staging as evidence for anything that touches table locks.

Common pitfall: Telling the story so that no decision was really yours, which reads as avoidance in a question about accountability.

6. How do you protect an endpoint from abuse without breaking legitimate clients?

What they are assessing: Practical security and rate-limiting design that balances safety with normal usage.

Structure
  1. Authenticate and authorize before any expensive work.
  2. Rate limit per identity and per route, not only per IP.
  3. Return clear headers and status codes so good clients can back off.
  4. Monitor and tune thresholds from real traffic.
Sample answer

I start by making sure authentication and authorization happen before any expensive work, because an unauthenticated endpoint that hits the database is the cheapest denial-of-service target. For rate limiting I key on the authenticated identity where possible, plus the route, because IP-based limits punish users behind a shared corporate network. I use a token bucket so normal bursts are allowed while sustained abuse is capped. I return 429 with a Retry-After header and rate-limit headers, so a well-behaved client backs off instead of retrying immediately. Expensive endpoints like password reset or data export get stricter limits and sometimes a challenge. Then I monitor 429 rates and adjust, because a limit that fires on normal traffic is a bug, not a success.

Common pitfall: Setting a single global IP limit and calling it done, which blocks shared networks while a distributed attacker passes through.

7. How do you approach a schema migration on a table with hundreds of millions of rows?

What they are assessing: Operational care with schema changes and awareness of locking and rollback risk.

Structure
  1. Estimate lock duration and backfill cost before writing code.
  2. Use expand/contract so old and new code coexist.
  3. Backfill in batches with throttling and checkpoints.
  4. Rehearse rollback and verify with production-scale tests.
Sample answer

First I estimate the blast radius: row count, whether the change rewrites the table, and how long a lock would last on production hardware. I use the expand/contract pattern rather than a single big migration. Expand means adding the new nullable column or table and deploying code that writes to both; then a background job backfills in small batches with a throttle so replication lag stays acceptable; then I switch reads; then contract removes the old structure in a later release. Each step is independently deployable and reversible. I rehearse the whole sequence on a production-sized copy and watch lock wait times and replica lag. For very large tables I check whether the database supports online DDL or whether a shadow-table migration is safer.

Common pitfall: Running one big migration inside a maintenance window, which risks a long outage and leaves no clean path back.

8. How do you design pagination for a large, frequently changing collection?

What they are assessing: API design awareness of the consistency problems offset pagination creates at scale.

Structure
  1. Identify whether the client needs a stable snapshot.
  2. Prefer cursor or keyset pagination on an indexed sort key.
  3. Handle ties, deletions and insertions explicitly.
  4. Document limits and empty-result behavior.
Sample answer

Offset pagination is easy but it degrades and drifts: by page ten the database scans and discards thousands of rows, and if items are inserted while a user is paging they see duplicates or miss records. For large or fast-changing collections I use keyset pagination, where the cursor encodes the last sort key and the query filters with a greater-than condition on that indexed column. That keeps each page cheap regardless of depth. I make the sort deterministic by adding a tiebreaker like the primary key, because two rows with the same timestamp otherwise produce unstable ordering. I return an opaque cursor so the encoding can change later, and I document whether the client gets a stable snapshot or a live view. Deletions during paging are handled by tolerating a stale cursor and asking the client to refetch.

Common pitfall: Using offset pagination on a huge table because it is simpler, then discovering the deep-page cost and drift problems in production.

9. How do you decide what to cache and how to invalidate it?

What they are assessing: Understanding of cache correctness and consistency trade-offs, not merely adding Redis to the stack.

Structure
  1. Cache only data that is read far more than written.
  2. Choose the key and TTL from the access pattern.
  3. Decide the invalidation strategy and accept its staleness window.
  4. Measure hit rate and guard against stampedes.
Sample answer

I cache data that is read far more often than it changes, and I choose the key from the access pattern, usually the identifier the client already uses. Then I make the staleness trade-off explicit: a short TTL is simple but occasionally serves old data, while explicit invalidation on write is fresher but adds coupling and a chance to forget a key. For most services I use a short TTL plus invalidate-on-write for records that must be correct immediately, such as a user's own profile. I also guard against a cache stampede when a hot key expires by using a lock or refreshing early in the background. Finally I watch the hit rate and the database load, because a cache with a low hit rate adds failure modes without buying much.

Common pitfall: Adding a cache before measuring the read pattern, which introduces a consistency problem and a new outage surface for little gain.

How to prepare for a Backend Developer interview in one week

  1. Day 1 — Write a one-page inventory of your own Backend Developer work: what you owned, the scale, the figure, and the decision you made. This becomes the raw material for every answer.
  2. Day 2 — Work through the must-have keywords from the <a href="/en/ats-keywords/backend-developer">Backend Developer ATS keyword list</a> — starting with REST API design, relational data modeling, SQL query optimization — and mark which ones you can defend with a story.
  3. Day 3 — Answer the Backend Developer questions above out loud and timed. Recording yourself once will surface more problems than another hour of reading.
  4. Day 4 — Prepare two questions per interviewer about how a Backend Developer is measured here, and one about the first ninety days.
  5. Day 5 — Rehearse the Backend Developer salary conversation, including your researched range and your walk-away floor.
  6. Day 6 — Do one mock Backend Developer interview with a person, and ask them to interrupt you mid-answer, because real interviewers do.
  7. Day 7 — Rest and review the one-page inventory once. Do not cram new Backend Developer material the night before.

Mistakes that sink Backend Developer interviews

The same handful of errors end Backend Developer interviews early. Each one below is paired with what to do instead.

Hiding failures and listing only green launches.

Fix

Include one incident where you owned the mitigation and the guardrail you added; backend interviewers trust candidates who can describe a real outage clearly.

Describing a database only as a technology name.

Fix

State the schema decision, the index or the migration pattern, because data modeling is the area senior backend interviews dig into most.

Writing bullets that are all feature delivery and no reliability.

Fix

Balance shipping with on-call, SLOs, runbooks and MTTR, since most backend teams screen for operational ownership before they screen for frameworks.

Questions to ask your Backend Developer interviewer

  • What does success look like for this Backend Developer role in the first ninety days?
  • Which Backend Developer responsibility in the posting is hardest to get right today, and why?
  • How is performance measured for this role, and who reviews it?
  • What has changed about this Backend Developer role in the last year?
  • What would make you say, six months from now, that hiring this Backend Developer was the right call?

Ask these in the order that matches your interviewer's role. Recruiters can answer process questions; the hiring manager can answer the ones about Backend Developer priorities and how the work is measured.

Handling salary questions in a Backend Developer interview

Backend pay varies by market, industry and level, and specialized depth in distributed systems, data stores or security often matters more than the title itself. High-traffic platforms tend to place the same title in a different band than smaller product teams, so a single figure is rarely meaningful. Research the specific market and level, ask for the band attached to the role, and compare total compensation including bonus, equity and on-call pay.

Frequently asked questions

Should I list every programming language I have used?

List only the languages you would accept an interview in, grouped by depth if you like, and keep the rest out. A long language list reads as padding and creates interview risk, because an interviewer may pick the one you used for a semester. Three to five languages with clear context and a named system is far stronger than twelve with no evidence behind them.

How much system design do I need for a backend interview?

Enough to reason out loud about a real system. Expect to be asked to design something like a rate limiter, a news feed or a booking flow, and to justify your data model, API shape and scaling path. You do not need to memorize architectures; you need a repeatable structure: clarify requirements, estimate scale, sketch the components, then discuss trade-offs and failure modes. Practice by drawing systems you have actually worked on.

What backend projects are worth building for a portfolio?

Build something with a hard constraint rather than another CRUD API. A small service that handles concurrent writes, retries, a rate limit or a background queue gives you real material to discuss. Include a README covering the data model, one failure you hit and how you handled it, and a load test or a metric. One such project is worth more than several tutorial clones with no operational story.

How should I prepare for a Backend Developer interview?

Build a one-page inventory of your own work first, then map it onto the must-have keywords for the role: REST API design, relational data modeling, SQL query optimization, database indexing and transactions, authentication and authorization (OAuth, JWT). Most Backend Developer interview answers are drawn from that inventory. Rehearse out loud and timed, because the gap between knowing an answer and delivering it under pressure is where candidates lose offers.

How many Backend Developer interview questions should I practice?

Depth beats volume. Prepare eight to ten stories properly rather than fifty superficial answers, because most Backend Developer loops ask variations of the same handful of themes and good interviewers follow up on whatever you actually say. Each story should cover the situation, your specific decision, the outcome and what you would change.

What should I do if I do not know the answer to a Backend Developer interview question?

Say what you do know, state your assumption, and walk through how you would find the Backend Developer answer. Interviewers are testing reasoning more than recall. What fails is bluffing, because the follow-up question exposes it. If you have genuinely never met the situation, say so and describe the closest Backend Developer work you have done.

Check your resume against this role for free

Paste your resume and the job description. You will get an ATS keyword coverage score and the gaps that matter most — no signup required.

Run the free ATS check