Software Engineer Interview Questions & Answers

12 questions with answer strategies$120K median salaryOutlook: Growing

A small-shop Software Engineer interview usually tests whether you can take an ambiguous product need, ship a pragmatic service or feature, and own production consequences with little scaffolding. Large organizations still test coding, but they add calibrated system design, cross-team decision-making, code-review depth, and evidence that you can improve a subsystem without breaking contracts used by dozens of teams. In 2026, expect a recruiter screen, a live or asynchronous coding exercise, technical interviews in your primary language, a system-design round, and behavioral rounds tied to delivery and incidents. The outcome is rarely decided by clever algorithms alone. Strong candidates explain tradeoffs, instrument what they build, cite latency, error-rate, adoption, or cost results, and show how they used Python, TypeScript, Java, SQL, REST APIs, PostgreSQL, Redis, and microservices to move an observable metric.

Behavioral questions

Tell me about a production incident you owned. How did you determine whether your fix actually worked?

Why they ask: The interviewer is testing operational ownership, not whether you have ever been paged. They want to hear a disciplined distinction between mitigating customer impact, identifying root cause, and proving the system remained healthy afterward.

How to answer: Name the service, the failing dependency or code path, and the signals you used: HTTP 5xx rate, p95 latency, queue depth, database saturation, or business failures. A strong answer includes the immediate mitigation, the root-cause evidence, the permanent change, and a before-and-after measurement; a weak answer ends with "we restarted it".

Example answer

I was on call when our Java checkout service's p95 latency rose from 280 ms to 4.8 seconds and payment timeouts hit 3.2%. I used traces to isolate a new PostgreSQL query that was loading an entire order-history collection for a fraud check, then disabled that code path with a feature flag while we preserved the prior rule. I added the missing composite index and changed the repository method to fetch only the latest qualifying order. After deployment, p95 fell to 340 ms and timeouts returned below 0.1% for the next 24 hours. I also added a dashboard alert for query duration and documented the rollback condition in the runbook.

Describe a time you disagreed with a technical direction proposed by another engineer or team.

Why they ask: This probes whether you can challenge architecture with evidence while preserving delivery relationships. Software engineering disagreements often involve API contracts, data ownership, deployment risk, and long-term operability rather than personal preferences.

How to answer: Frame the disagreement around a concrete engineering constraint and quantify the competing options. Show the artifact you used to resolve it, such as a short design document, load test, migration plan, or API prototype; weak answers say the other person was wrong and never explain how the decision was validated.

Example answer

A platform team proposed synchronous REST calls from our catalog API to four downstream services for every product-page request. I argued that it would make our availability dependent on four separate SLOs, so I wrote a one-page design and ran a k6 test against a prototype. At projected traffic, the fan-out version had a 1.9% error rate when one downstream dependency was degraded, while a PostgreSQL-backed read model stayed under 0.2%. We agreed to publish inventory and pricing events and build a denormalized read model, with explicit freshness indicators for the UI. The page's p95 dropped from 620 ms in the prototype to 180 ms in production, and we avoided three on-call escalations during later dependency incidents.

Tell me about a feature you shipped that did not achieve the result you expected.

Why they ask: The interviewer is looking for product-minded engineering: did you define success before coding, observe real usage, and change course when the data contradicted your assumptions? This separates feature delivery from measurable impact.

How to answer: State the intended customer or business metric, the telemetry you added, and what the data revealed. Explain the corrective iteration in implementation terms, such as changing an API workflow, query behavior, cache strategy, or TypeScript UI interaction; do not present a low-adoption launch as a success because it deployed on time.

Example answer

I built a TypeScript bulk-edit workflow for account admins, expecting it to reduce support tickets about permissions. We shipped it behind a flag with funnel events for opening the editor, selecting users, validation failures, and successful saves. Only 11% of eligible admins completed the flow, and session replays showed that our API rejected the whole batch when one user had an invalid role. I changed the REST endpoint to return per-user validation results and updated the UI to let admins fix or skip failed rows. Completion rose to 46% within two weeks, and related support tickets fell 28% over the following month.

Give me an example of improving the engineering quality of a codebase that you did not originally write.

Why they ask: This assesses whether you can create leverage in an existing system instead of demanding a rewrite. Mature teams need engineers who can make tests, observability, performance, and deployment safety measurably better in incremental steps.

How to answer: Describe the baseline evidence: flaky test frequency, deployment lead time, defect rate, build duration, duplicate logic, or a fragile module boundary. Strong answers explain a staged refactor with safeguards such as contract tests, shadow traffic, or a strangler path, then report a measurable quality improvement.

Example answer

I inherited a Python notification service with a 25-minute CI pipeline and frequent production regressions in template rendering. I first separated rendering from delivery behind an interface and added contract tests for the REST provider adapters before changing behavior. Then I parallelized the test suite, replaced live provider calls with deterministic fakes, and added structured logs containing template version and provider response codes. CI time dropped to 8 minutes, and the team went from six template-related incidents in the prior quarter to one in the next quarter. I deliberately did not rewrite the service because the measured bottleneck was test isolation, not Python itself.

Technical & role-specific questions

Design a REST API for creating orders when clients may retry requests because of network timeouts. How would you guarantee the right behavior?

Why they ask: The interviewer is testing practical API design, idempotency, persistence semantics, and failure handling. They want more than endpoint naming; they want to know what happens when the client never receives a response but the server may already have charged or created an order.

How to answer: Define the request contract, idempotency key scope, PostgreSQL uniqueness constraint, response behavior for repeated keys, and transaction boundaries. Explain how you would measure duplicate attempts and conflicts, and explicitly address downstream side effects using an outbox or equivalent; weak answers rely on an in-memory map or say retries are the client's problem.

Example answer

I would expose POST /orders with a client-generated Idempotency-Key header and persist that key with the account ID under a unique PostgreSQL constraint. In the same transaction, I would create the order and an outbox event, storing the original response payload so a retry gets the same status and body rather than a second order. A worker would publish the outbox event to the payment workflow, which would use its own idempotency key with the payment provider. I would track idempotency-key replay rate, unique-constraint conflicts, and payment-event lag. If a request crashes after commit but before the HTTP response, the retry safely returns the stored order.

A PostgreSQL query that used to run in 40 ms now takes 3 seconds after the table grew tenfold. Walk me through how you would diagnose and fix it.

Why they ask: This probes SQL fluency grounded in production behavior. Interviewers want to see whether you use execution plans and data distribution to find the cause rather than reflexively adding indexes.

How to answer: Start with the exact query and EXPLAIN ANALYZE, then inspect row estimates, join strategy, filters, sort operations, index usage, lock waits, and connection pressure. Propose a fix tied to the plan, validate it with representative data, and name the p95 query-time or database-load target you would monitor after release.

Example answer

I would capture the normalized query and run EXPLAIN ANALYZE against production-like data, looking first for a sequential scan, bad row estimates, or a sort spilling to disk. In a previous case, a tenant-scoped events query filtered on tenant_id and created_at but sorted by created_at, while we only had separate single-column indexes. I added a concurrent composite index on tenant_id, created_at DESC and changed the endpoint from OFFSET pagination to keyset pagination. The plan moved from scanning 18 million rows to an index scan returning 51 rows. Query p95 dropped from 2.7 seconds to 74 ms, and I monitored index build impact plus database CPU for the next release window.

Where would you use Redis in a microservices system, and where would you refuse to use it?

Why they ask: This evaluates whether you understand Redis as a performance and coordination tool with consistency and eviction tradeoffs, not as a magical database. The interviewer is looking for cache design, invalidation strategy, failure behavior, and measurable value.

How to answer: Choose a concrete use case such as rate limiting, ephemeral session state, cache-aside reads, distributed work coordination, or deduplication. Specify keys, TTLs, invalidation or versioning, fallback behavior, memory limits, and hit-rate or latency metrics; a weak answer says "cache everything" without identifying a source of truth.

Example answer

I would use Redis for a cache-aside product-summary read path where PostgreSQL remains the source of truth. The key would include product ID and a versioned representation, with a five-minute TTL and explicit invalidation from the product update consumer; on a Redis miss or outage, the service would read PostgreSQL and degrade within our latency budget. I would not store the authoritative order state there because eviction or replication lag could create incorrect fulfillment decisions. In my last service, Redis raised cache hit rate to 92%, reduced PostgreSQL read QPS by 68%, and cut endpoint p95 from 410 ms to 95 ms. We also alerted on evictions, memory fragmentation, and hit rate below 80%.

How would you evolve a TypeScript service contract when an existing client needs a breaking change but other clients cannot upgrade immediately?

Why they ask: This tests API evolution, backward compatibility, TypeScript discipline, and deployment coordination. Real service work involves preserving consumers while changing schemas, validation, and behavior over time.

How to answer: Explain whether additive change, versioning, compatibility adapters, or a new endpoint is appropriate, and distinguish compile-time TypeScript types from runtime validation. Include contract tests, consumer discovery, deprecation telemetry, and a concrete removal threshold; weak answers assume shared types alone protect independently deployed services.

Example answer

For a billing API that needed to replace a single address field with structured address data, I would first add the structured field while continuing to accept and return the legacy field. The TypeScript service would validate both shapes at runtime with a schema library, convert legacy input at the boundary, and publish an OpenAPI update plus consumer contract tests. I would instrument which clients still send or read the old field by client ID and set a deprecation date only after usage fell below an agreed threshold. In a similar migration, 14 clients moved over six weeks without a rollback, and we removed the compatibility path after 30 days of zero legacy traffic. This is safer than changing a shared interface and hoping every deployed client updates simultaneously.

Situational & judgment questions

You are asked to ship a revenue-critical feature by Friday, but the proposed design introduces a new synchronous dependency on an unreliable service. What do you do?

Why they ask: The interviewer is testing whether you can balance delivery pressure with availability risk. They want an engineer who makes risk explicit and offers a shippable alternative rather than either blindly complying or blocking without a path forward.

How to answer: Quantify the dependency's reliability and the blast radius, then present options with time and risk: a fallback, asynchronous workflow, feature flag, cached response, or a deliberately reduced first release. State the launch guardrails and the metric that determines whether the feature stays enabled.

Example answer

I would check the dependency's recent error rate, latency, and ownership before accepting it on the request path. If its 99.5% availability could turn into failed checkout requests, I would propose shipping the Friday version with an asynchronous enrichment step and a visible pending state rather than blocking the transaction. I would put the integration behind a feature flag, define a 0.5% checkout-error rollback threshold, and add tracing across the handoff. I used this approach for tax-estimate enrichment when the vendor was intermittently slow. We launched on schedule, kept checkout p95 under 500 ms, and enabled synchronous estimates only after the vendor met the agreed SLO for two weeks.

A teammate wants to merge a change that passes unit tests but you believe it can corrupt data during a concurrent update. The release train closes in an hour. How do you handle it?

Why they ask: This assesses code-review judgment under time pressure. Data integrity is a core engineering responsibility, and the interviewer wants to hear a technically grounded escalation path rather than vague caution or public confrontation.

How to answer: Identify the specific race, reproduce it with a targeted concurrent test or transaction timeline, and propose the smallest safe fix: optimistic locking, a row lock, a unique constraint, or an atomic update. Explain whether you would block the merge and what evidence would change your decision; weak answers either rubber-stamp the code or demand a broad redesign.

Example answer

I would leave a blocking review comment with the exact interleaving: two workers read the same inventory count, both validate availability, and both decrement it. I would quickly add an integration test using concurrent transactions and recommend an atomic PostgreSQL update with a condition, returning zero rows when stock is unavailable. That is a small change with a clear correctness guarantee, so I would block the risky version even if the train closes. In a prior release, this caught an oversell path before launch; the conditional update handled 1,200 concurrent purchase attempts in load testing with no negative inventory. We shipped the safe patch in the next train and documented why unit tests had missed it.

Your service's error rate is within its SLO, but customers report intermittent failures that are hard to reproduce. How would you decide what to investigate first?

Why they ask: This tests observability and prioritization when aggregate metrics hide harmful edge cases. Good engineers can turn vague reports into segmented evidence instead of dismissing users because the dashboard is green.

How to answer: Correlate reports with request IDs, tenant, region, client version, endpoint, deployment version, and dependency traces. Use a hypothesis-driven investigation and quantify the affected cohort; strong answers improve instrumentation when the evidence is missing, while weak answers merely watch overall 5xx charts.

Example answer

I would ask support for timestamps, account IDs, request IDs, and client versions, then segment logs and traces rather than starting with aggregate errors. In one case, overall errors were 0.08%, but requests from an older mobile client in one region were failing during a Unicode normalization edge case. I added a temporary metric for validation failures by client version and a safe hashed sample of the rejected field pattern, which showed 87% of failures were from that cohort. We patched the Java validation layer, added regression cases, and released a compatible response for the old client. The affected user's failure rate fell from 6.4% to 0.2%, even though the service-level SLO had never been breached.

You inherit a microservice with no clear owner, sparse tests, and rising cloud cost. What would you do in your first 30 days?

Why they ask: The interviewer is assessing whether you can establish control over an ambiguous production system without making reckless changes. They expect an ordered plan that joins ownership, reliability, technical discovery, and cost measurement.

How to answer: Start by mapping traffic, dependencies, deployment history, SLOs, top endpoints, data stores, and monthly cost drivers. Prioritize reversible improvements with a baseline and owner agreement, such as right-sizing, query fixes, rate limits, test coverage around critical flows, or retirement of unused paths; do not promise a rewrite before you understand usage.

Example answer

In the first week, I would identify the service's consumers, on-call route, dashboards, deployment pipeline, and the top five cost and latency contributors. I would establish a baseline for request volume, p95 latency, error rate, Redis usage, PostgreSQL load, and compute spend before touching architecture. In a similar inherited Python service, logs showed 70% of requests came from a deprecated export endpoint that performed repeated database reads. I added request coalescing, moved the export to an asynchronous job, and set a 14-day deprecation report for the remaining callers. By day 30, compute cost was down 34%, p95 was down 41%, and the team had a named owner plus contract tests for the two highest-risk endpoints.

How to prepare for a Software Engineer interview

  • Build a metric-backed story bank of six projects: one incident, one failed feature, one API or schema migration, one SQL performance fix, one disagreement, and one codebase improvement. For each, write the baseline, your exact contribution, tools used, and the post-change number; if you cannot name a number, identify the dashboard or query you would have used.
  • Practice one coding problem each in Python, TypeScript, or Java using your interview language's real conventions: tests, edge cases, complexity explanation, and readable names. Spend part of each session narrating how you would test malformed input, empty collections, duplicate values, integer bounds, and concurrent access where relevant.
  • Rehearse two system designs on a whiteboard or shared document: an idempotent order API and a read-heavy service using PostgreSQL, Redis, asynchronous events, and REST clients. For each, state SLOs, expected QPS, data model, failure modes, observability, and the metric that justifies every cache or queue.
  • Take three production-flavored SQL queries and run EXPLAIN ANALYZE against a local PostgreSQL dataset large enough to produce meaningful plans. Practice explaining why a composite index, keyset pagination, query rewrite, or transaction isolation choice changes rows scanned, p95 latency, and write cost.
  • Review a small GitHub service or an old project as if you were on a pull-request panel. Identify one API contract risk, one concurrency or data-integrity risk, one observability gap, and one test gap, then propose the smallest production-safe patch instead of a rewrite.

Interviewers will also have your resume in front of them — make sure it holds up. See our software engineer resume example with salary data and proven bullet points.

Common questions about Software Engineer interviews

How hard are Software Engineer coding interviews in 2026 if I mostly build APIs at work?

Expect coding rounds to test data structures and algorithms, but the strongest performance also looks like production engineering: clarify constraints, choose an appropriate complexity, and test edge cases aloud. Do not over-index on obscure puzzles if the role is backend or full-stack; SQL, API design, debugging, and system design often decide ties. Use Python, TypeScript, or Java fluently enough that language mechanics do not consume your thinking time.

What should I say when asked about a technology I have not used, such as Redis or Java?

Do not claim hands-on depth you do not have. State the closest system you used, explain the transferable concept, and describe how you would validate your first production implementation. For example, if you have not used Redis, discuss cache-aside behavior, TTLs, invalidation, eviction, and fallbacks from first principles rather than pretending you tuned a cluster.

How should I answer the salary question when Software Engineer pay ranges from $75,000 to $185,000?

Anchor your answer to level, location, scope, and total compensation rather than reciting the entire market range. A direct version is: "For a role with this backend and ownership scope, I am targeting $135,000 to $155,000 in base salary, depending on the total package and level." If the role is clearly junior, regional, or remote in a lower-cost market, use a range that fits that scope; if it includes system ownership or senior expectations, do not anchor yourself at $75,000.

What questions at the end of an interview signal Software Engineer seniority?

Ask questions that expose system constraints and decision quality: "What are this service's p95 latency, error-rate, and availability targets, and where does it miss them today?" Ask how API contracts are versioned, who owns production incidents across service boundaries, and what technical decision a new engineer would need to make in the first 90 days. Avoid spending your entire question period on generic culture language when you could learn how the engineering system actually operates.

How do I prepare for a system-design interview when the job description lists microservices, PostgreSQL, REST APIs, and Redis?

Practice designs that make those tools earn their place instead of inserting them by default. Be ready to model PostgreSQL tables and indexes, define REST contracts and idempotency, decide where Redis can safely cache, and describe asynchronous handling for unreliable downstream work. Every design should include traffic assumptions, a failure mode, an observability plan, and a measurable target such as p95 latency, cache hit rate, or duplicate-event rate.

Get questions for a specific job posting

Paste a real job description and our free AI generator predicts the 5 questions you're most likely to face — tailored to that exact posting.

Try the free generator

Practice these questions out loud

Answer in a live voice conversation with an AI interviewer that listens, follows up, and gives instant feedback. Free to start.

Start practicing