BetaJobprepping.com is in beta and still under construction. New sign-ups are closed.
Start practising
Software Engineer

Software Engineer Interview Questions and How to Answer

28 software engineer interview questions for backend and full-stack roles, with sample answers, what a strong answer does and the follow-up to expect.

Updated

Software engineer interview questions for backend and full-stack roles fall into six groups: behavioural stories about work you owned, coding problems on realistic data, debugging and production incidents, system design, SQL and backend fundamentals, and collaboration with product. Below are 28 practice questions we wrote, each with a strong-answer outline and the likely follow-up.

For how the full loop is scored and timed, see the software engineer interview guide; the questions below differ from the eight practised there.

How question types map to the software engineer interview loop#

  • Recruiter screen: one or two experience questions to check level and scope.
  • Technical screen: 45 to 60 minutes of live coding. Google has publicly described four hiring attributes: general cognitive ability, role-related knowledge, leadership and "Googleyness". For engineers the early rounds are mostly coding; ask your recruiter at which level system design rounds begin.
  • Onsite or virtual loop: Meta's careers blog post on preparing for software engineering interviews describes coding, design and behavioural interviews, and press reports in 2025, 404 Media among them, said Meta began trialling a coding interview where candidates can use an AI assistant; your recruiter's prep email says whether yours includes it. Amazon scores every round against its 16 Leadership Principles and adds a Bar Raiser, usually from outside the hiring team, according to its hiring pages.
  • Smaller companies often swap puzzles for debugging, a pull request review or a take-home.

Across these loops, the follow-up decides the score.

How software engineer interview questions change by level#

  • Junior (0 to 2 years): mostly coding, one behavioural round, little design. Example: "Tell me about a bug that took you more than a day to find."
  • Mid-level: coding, one design round and a production story. Example: "Walk me through a feature from ticket to production."
  • Senior and above: design depth, cross-team influence and ambiguity. Example: "Another team's API blocks your roadmap and they have other priorities. What did you do?"

Software engineer behavioural interview questions#

1. Walk me through a system you own end to end#

  • Why interviewers ask it: scope and numbers set your level in five minutes.
  • What a strong answer does: traces the request path with numbers and a redesign.
  • Sample answer: "A request hits the load balancer, a Django service validates it, writes to Postgres in one transaction and publishes an event to Kafka. Peak is 300 requests per second. I own the write path, and I would move the publish into an outbox table, because a crash between commit and publish loses events."
  • Weak answer: a list of technologies with no data flow.
  • Likely follow-up: "What breaks first if traffic triples?"

2. Tell me about a production incident you caused#

  • Why interviewers ask it: they check whether you roll back before you diagnose, and whether your fix changed the system or just the code.
  • What a strong answer does: times, first action, root cause, structural fix.
  • Sample answer: "I deployed a new order-history query at 14:05. The 5xx alert fired at 14:09 and I rolled back at 14:12. The query was missing an index and scanned a 40-million-row table. I added the index concurrently, a migration checklist item and a CI step that runs EXPLAIN on new queries against staging-sized data."
  • Weak answer: "a misconfiguration" with no owner.
  • Likely follow-up: "What did the post-incident review change for the team?"

3. Describe a technical disagreement you lost#

  • Why interviewers ask it: it tests disagree and commit, one of Amazon's Leadership Principles, and whether you argue with evidence rather than seniority.
  • What a strong answer does: both positions fairly, your evidence, why you lost, how you helped.
  • Sample answer: "I argued for a read replica for reporting; the tech lead wanted a nightly export to the warehouse. I brought replica-lag numbers from staging, up to 40 seconds under load. The export won because reports tolerated a day of staleness and it added nothing to on-call. I wrote the export job and its alert."
  • Weak answer: a story where you were secretly right.
  • Likely follow-up: "Looking back, who was right?"

4. Tell me about a time you cut scope to hit a date#

  • Why interviewers ask it: they want to know whether you negotiate scope explicitly or silently drop quality.
  • What a strong answer does: what was cut, who agreed, the risk and the follow-through.
  • Sample answer: "I proposed launching without bulk export, agreed it with the product manager in writing, added a support macro for manual exports. We shipped it three weeks later; four customers used the manual route in between."
  • Weak answer: "We worked late and made it."
  • Likely follow-up: "What would you never cut?"

5. What is the most useful code review comment you have received?#

  • Why interviewers ask it: it shows which design principles you have absorbed rather than read about.
  • What a strong answer does: the comment, the principle, where you now apply it.
  • Sample answer: "A reviewer wrote, 'This order can be both cancelled and shipped. Can the type stop that?' I replaced two booleans with a status enum and a transition function that rejects illegal moves, and now check every model for contradictory flags."
  • Weak answer: a comment about formatting.
  • Likely follow-up: "What do you look for first in someone else's pull request?"

6. How do you use AI coding assistants, and where do you not trust them?#

  • Why interviewers ask it: the Stack Overflow Developer Survey 2025 found 84% of developers use or plan to use AI tools and 46% distrust their accuracy. Interviewers check whether you can name failure modes of generated code.
  • What a strong answer does: separates speed-ups (boilerplate, tests, unfamiliar SDKs) from code verified line by line (concurrency, money, security).
  • Sample answer: "Last month it suggested a retry wrapper that retried POST requests with no idempotency key, which would have double-charged on a timeout. For payments and locking code I now write the implementation myself and ask it for tests."
  • Weak answer: "I review everything it writes" with no example.
  • Likely follow-up: "Tell me about a time it was confidently wrong."

Software engineer coding interview questions#

7. Return the top k most frequent endpoints in a stream of log lines#

  • Why interviewers ask it: a hash map plus heap problem dressed as real work.
  • What a strong answer does: asks whether k is small, whether memory is bounded and how ties break, then selects in O(n log k):
from collections import Counter
import heapq

def top_k(lines, k):
    # count by endpoint, the 7th field in a combined-format access log
    counts = Counter(line.split()[6] for line in lines if line.strip())
    # highest count first, ties broken alphabetically
    return heapq.nsmallest(k, counts.items(), key=lambda kv: (-kv[1], kv[0]))
  • Weak answer: sorting the whole map without stating the cost, or counting split()[0], usually an IP address.
  • Likely follow-up: "The stream will not fit in memory." Count-Min Sketch, or shard by key and merge.

8. Group transactions into sessions where gaps are under 30 minutes#

  • Why interviewers ask it: sorting, boundaries and time zones are where off-by-one bugs hide.
  • What a strong answer does: sorts by user then time, asks whether exactly 30 minutes is a gap, compares timezone-aware UTC values, and tests a daylight saving change with freezegun.
  • Weak answer: comparing ISO strings that carry different offsets.
  • Likely follow-up: "Events arrive up to five minutes late." Hold sessions open for a grace window before emitting.

9. Implement an LRU cache with O(1) get and put#

  • Why interviewers ask it: it shows whether you can combine two structures to meet a complexity bound, and whether you know your language ships one (OrderedDict, LinkedHashMap).
  • What a strong answer does: explains hash map plus doubly linked list, then asks whether OrderedDict.move_to_end is acceptable.
  • Weak answer: a list with remove(), which is O(n).
  • Likely follow-up: "Make it thread-safe." A single lock around get and put is the honest first answer; mention lock striping or a concurrent library cache such as Caffeine for heavy contention.

10. Write a function that retries a flaky HTTP call#

  • Why interviewers ask it: clients retrying in lockstep prolong outages, and retrying a non-idempotent call double-writes.
  • What a strong answer does: retries only retryable errors, honours Retry-After, caps attempts and uses full jitter, as described in the AWS Architecture Blog post on backoff and jitter:
import random, time

RETRYABLE = {429, 502, 503, 504}

def call_with_retry(send, max_attempts=5, base=0.2, cap=10.0):
    for attempt in range(max_attempts):
        try:
            resp = send()
            if resp.status_code not in RETRYABLE:
                return resp
            ra = resp.headers.get("Retry-After", "")
            wait = float(ra) if ra.isdigit() else None  # HTTP-date form falls back to jitter
        except TimeoutError:
            wait = None
        if attempt == max_attempts - 1:
            raise RuntimeError("retries exhausted")
        time.sleep(wait or random.uniform(0, min(cap, base * 2 ** attempt)))
  • Weak answer: while True with a fixed sleep, or retrying a 400.
  • Likely follow-up: "Is this safe for a POST?" Only with an idempotency key the server deduplicates on.

11. Refactor this 200-line function you have never seen#

  • Why interviewers ask it: it shows whether you protect behaviour before improving structure.
  • What a strong answer does: pins behaviour with a characterisation test, then extracts one pure function at a time, as in Michael Feathers' "Working Effectively with Legacy Code".
  • Weak answer: a rewrite from scratch.
  • Likely follow-up: "You find a bug mid-refactor. Same change?" Usually no, so each can be reverted alone.

12. Explain a deadlock you have seen and how you would detect it#

  • Why interviewers ask it: concurrency bugs pass unit tests and fail under load.
  • What a strong answer does: describes a real shape: two transactions update the same two account rows in opposite order, each waiting for the other's lock. Postgres detects it after deadlock_timeout (one second by default), aborts one transaction and logs both queries. The fix is a consistent lock order (lower account ID first) plus a retry.
  • Weak answer: reciting the four Coffman conditions with no example.
  • Likely follow-up: "How is a deadlock different from contention that is just slow?"

Debugging and production incident interview questions#

13. Users report intermittent 502 errors, and your dashboards look normal#

  • Why interviewers ask it: averages hide partial failures.
  • What a strong answer does: reads load balancer logs (502 is a bad upstream response), groups by host, and suspects one bad instance, a keep-alive timeout mismatch or deploy restarts.
  • Weak answer: restarting everything.
  • Likely follow-up: "It only happens during deploys." Add connection draining and a readiness check.

14. A Postgres query that took 20 ms now takes 4 seconds#

  • Why interviewers ask it: guessing an index without reading the plan is the most common mistake.
  • What a strong answer does: runs EXPLAIN (ANALYZE, BUFFERS), compares estimated and actual rows, and checks stale statistics, a dropped index or a plan flip.
  • Weak answer: "Add an index."
  • Likely follow-up: "It chooses a sequential scan despite an index. Why?" It expects to read much of the table, or the statistics are wrong.

15. Memory on one service grows until it is killed every six hours#

  • Why interviewers ask it: slow failures test method rather than intuition.
  • What a strong answer does: diffs two heap snapshots (tracemalloc in Python) and looks for unbounded caches, accumulating listeners or globals.
  • Weak answer: raising the memory limit.
  • Likely follow-up: "You cannot reproduce it locally. What is safe in production?"

16. Your Kafka consumer is processing some messages twice#

  • Why interviewers ask it: duplicates are normal with at-least-once delivery, Kafka's common default.
  • What a strong answer does: a crash between processing and committing the offset causes redelivery, so the handler is idempotent via a unique key written in the side effect's transaction.
  • Weak answer: "Turn on exactly-once" with no detail.
  • Likely follow-up: "The side effect is an email." Record the send keyed by message ID first.

17. An on-call page fires at 3am for a service you did not write#

  • Why interviewers ask it: they score an ordered first five minutes.
  • What a strong answer does: checks the deploy log, error rate by endpoint, then the four golden signals from Google's "Site Reliability Engineering" book (latency, traffic, errors, saturation); mitigates first and escalates early.
  • Sample opening: "First, deploy history. A release went out at 02:40 and /checkout errors started at 02:43, so I roll back and watch the error rate before reading any code."
  • Weak answer: reading the codebase from the top.
  • Likely follow-up: "When do you wake someone else up?"

System design interview questions for software engineers#

  • Why interviewers ask it: it is small enough to finish, so the score rests on estimates and trade-offs.
  • What a strong answer does: says estimates aloud: about 40 writes per second; at 100 reads per write, about 4,000 reads per second, so a cache matters. Seven base62 characters give over 3.5 trillion codes. Then hashing versus counter IDs, expiry and abuse.
  • Weak answer: twenty boxes before any number.
  • Likely follow-up: "How do you stop someone enumerating every link?"

19. Design a job scheduler that runs millions of delayed tasks#

  • Why interviewers ask it: it combines queues, time and partial failure.
  • What a strong answer does: stores due time and status, claims jobs with SELECT ... FOR UPDATE SKIP LOCKED, uses a lease timeout so crashed workers' jobs retry, and requires idempotent handlers.
  • Weak answer: a cron entry per job.
  • Likely follow-up: "A job is due at 09:00 user time." Store local time plus the IANA zone name and compute the UTC instant when scheduling.

20. Design the backend for a real-time location tracker#

  • Why interviewers ask it: write-heavy systems expose candidates who only practised read-heavy ones.
  • What a strong answer does: estimates volume (50,000 devices every 30 seconds is about 1,700 writes per second), keeps the latest position in Redis, appends history to cheaper storage, and pushes updates over WebSockets or server-sent events.
  • Weak answer: every ping as a row in the main transactional table, polled.
  • Likely follow-up: "A device reconnects and sends 120 pings at once."

21. Design a payments ledger that never loses or doubles money#

  • Why interviewers ask it: correctness under retries is the core of backend work.
  • What a strong answer does: append-only double-entry records, idempotency keys with a unique constraint (as in Stripe's API documentation), integer minor units and provider reconciliation.
  • Weak answer: a balance column updated in place with floats.
  • Likely follow-up: "The provider times out. Did the charge happen?"

22. Design the REST API for creating and paying an invoice#

  • Why interviewers ask it: API contracts outlive implementations, and full-stack loops lean on this.
  • What a strong answer does: POST /invoices returns 201 Created; GET /invoices?status=open&limit=50&cursor=... uses cursor pagination so new rows do not shift pages; POST /invoices/{id}/payments takes an Idempotency-Key header. Paying a void invoice returns 409 Conflict; gRPC suits typed internal calls.
  • Weak answer: POST /payInvoice returning 200 with an error string.
  • Likely follow-up: "How do you add a field without breaking older clients?"

SQL and backend fundamentals interview questions#

23. Review this endpoint that loads orders and their line items#

  • Why interviewers ask it: review rounds look for bugs that pass tests.
  • What a strong answer does: fixes the N+1 query with a join or Django's prefetch_related, then checks pagination and authorisation.
  • Weak answer: only style comments.
  • Likely follow-up: "How would you catch N+1 before review?" A query-count assertion such as Django's assertNumQueries.

24. What isolation level does Postgres use by default, and when is it not enough?#

  • Why interviewers ask it: lost updates under Read Committed are the most common money and stock bug in CRUD backends, and most candidates assume a transaction prevents them.
  • What a strong answer does: Read Committed is the default, so two transactions can both read a stock count of 1 and both sell it. Fixes are SELECT ... FOR UPDATE, an atomic UPDATE ... WHERE stock > 0, or Serializable with retries. "Designing Data-Intensive Applications" by Martin Kleppmann (second edition with Chris Riccomini) covers these anomalies in its chapter on transactions.
  • Weak answer: "Transactions prevent that."
  • Likely follow-up: "What happens when a serializable transaction fails?"

25. Write the SQL for each customer's most recent order#

  • Why interviewers ask it: "latest row per group" is the SQL pattern candidates most often get subtly wrong.
  • What a strong answer does: ranks rows per customer and adds order_id so ties resolve the same way every run:
SELECT customer_id, order_id, created_at
FROM (
  SELECT customer_id, order_id, created_at,
         ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY created_at DESC, order_id DESC) AS rn
  FROM orders
) ranked
WHERE rn = 1;

It also names Postgres's DISTINCT ON and the index (customer_id, created_at DESC).

  • Weak answer: GROUP BY with MAX(created_at) and a non-aggregated order_id.
  • Likely follow-up: "Two orders share a timestamp. Which wins?"

26. How would you roll out a database migration on a busy table?#

  • Why interviewers ask it: a column rename or blocking index build is a classic cause of self-inflicted downtime, and expand and contract shows you have shipped migrations.
  • What a strong answer does: adds a nullable column, writes both, backfills in batches, switches reads, then drops the old column a release later, using CREATE INDEX CONCURRENTLY for new indexes.
  • Weak answer: renaming a column during a deploy.
  • Likely follow-up: "The backfill takes six hours." Small batches, pauses, and a watch on replication lag.

Collaboration questions software engineers get asked#

27. A product manager wants a feature by Friday that you think needs three weeks#

  • Why interviewers ask it: they want a deadline argument turned into options with costs.
  • What a strong answer does: estimates the pieces and offers a flagged Friday version.
  • Sample answer: "The read-only view is two days; edits need the permission model, two weeks; audit history is three days. I can ship the read-only view by Friday behind a flag for the pilot accounts. If edits are the point, the date should move."
  • Weak answer: yes or no with nothing in between.
  • Likely follow-up: "They insist on everything by Friday."

28. How do you know a feature you shipped worked?#

  • Why interviewers ask it: they want a metric agreed before launch, not one found afterwards.
  • What a strong answer does: the metric, what was watched first and what changed.
  • Sample answer: "We agreed checkout conversion on the new address form should not drop. I watched form-submit errors for the first hour after the flag reached 10%, saw a 3% validation error rate on UK postcodes, rolled the flag back, fixed the regex and ramped again the next day."
  • Weak answer: "QA signed it off."
  • Likely follow-up: "Usage is flat after a month. What do you do?"

How to practise these questions#

Pick six questions, one from each group, and answer them aloud with a timer: about two minutes for behavioural answers, five minutes of spoken reasoning before any design diagram. For coding, state the complexity first and hand-run an empty input and a tie.

For a schedule, the two-week software engineer prep plan lays out each day, and the software engineer things-to-know checklist covers what to check before you apply. When you want follow-ups you have not rehearsed, practise a timed 30, 45 or 60 minute Software Engineer mock interview with live coding and a scored debrief.

Frequently asked questions#

What questions should I ask the interviewer at the end of a software engineer interview?#

Ask how the team actually works: how often it deploys, what weekly on-call load looks like, how incidents are reviewed and whether reviews are blameless, and what a successful first 90 days looks like.

How should I answer behavioural software engineer questions?#

Use STAR but spend most of the time on your own actions: what you decided, what you measured, what you changed afterwards. Keep each answer near two minutes, use real numbers such as latency, error rates or times, and say "I" when it was you. Prepare five or six adaptable stories.

How do I answer a system design question I have never seen?#

Follow the same order every time: clarify requirements, estimate load aloud, sketch the data model, define the API, then draw components and discuss failure modes. Say your numbers and trade-offs aloud, because interviewers score reasoning, not whether you have seen the problem.

What system design questions do backend engineers get?#

Common ones are a URL shortener, a rate limiter, a job scheduler, a notification service, a ledger or payments flow, a chat or location-tracking system, and API design for a core resource such as invoices. Interviewers score requirements, estimates, data model, failure handling and stated trade-offs more than the system itself.

Do software engineer interviews include SQL questions?#

Many backend loops do, as a dedicated question or inside a design or code review round. Expect joins, aggregation, window functions such as ROW_NUMBER, indexing choices and transaction isolation. Explaining a slow query from its EXPLAIN ANALYZE plan is often worth more than clever SQL.

Read next

GuideSoftware Engineer

Software Engineer Interview Guide with Questions and Prep

How the software engineer interview works in 2026, the skills it scores, 8 practice questions with strong-answer notes, the coding round and a one-week plan.

Prep planSoftware Engineer

How to Prepare for a Software Engineer Interview in 2 Weeks

How to prepare for a software engineer interview in 14 days, with daily coding and design drills, a story-bank template, timed mocks and a 3-day crash plan.

ChecklistSoftware Engineer

What to Know Before Applying for a Software Engineer Job

What to know before applying for a software engineer job - daily work, skills employers screen for, BLS pay data, red flags in ads and how loops test you.

Practice

Say it out loud.

Reading about an interview isn't the same as doing one. Take a 30, 45 or 60-minute Software Engineer interview with an AI interviewer and get scored against a real rubric.

Choose an interview