Software engineering interviews mix coding, system design, engineering judgment and teamwork. The best preparation is not memorizing a perfect answer: it is explaining constraints, trade-offs and what you actually built or would test.
How to use this free guide: Choose five questions that match the job description. Say your answer aloud, explain a trade-off, and check that each claim comes from your actual experience. The examples here teach an approach; they are not achievements to copy.
14 software engineer interview questions and answers
Use the answer approaches below as prompts. Replace illustrative scenarios with true examples from your own projects and responsibilities.
01
How would you design a rate-limited API?
Answer approach: Start with the constraint: protect an endpoint from bursts without penalizing legitimate users. Choose a limit by user, API key, or tenant; explain whether you need a token-bucket or sliding-window policy. For multiple app instances, coordinate counters atomically in a shared store.
What to mention: Mention HTTP 429 and Retry-After, monitoring for unfair throttling, and a test for concurrent requests.
02
What would you do when an API suddenly becomes slow?
Answer approach: Use p50/p95/p99 latency, error rates, traces, and recent deploys to isolate the affected route. Compare dependency latency with server processing, reproduce with representative load, then test one hypothesis at a time.
What to mention: Explain how you would decide between rolling back, adding capacity, changing a query, or deploying a targeted fix.
03
How do you troubleshoot a slow database query?
Answer approach: Capture the actual query plan and production-like data volumes. Look for full scans, N+1 requests, poor join selectivity, missing indexes, and lock contention. Compare execution plans before and after the change.
What to mention: A new index can speed up reads but raise write/storage costs; measure both sides.
04
How do you prevent a race condition?
Answer approach: Describe an invariant that must remain true when two requests arrive together. Compare optimistic version checks, unique constraints, transactions, and locks. Select the narrowest mechanism that preserves the invariant.
What to mention: Give a reproducible concurrency test, such as two workers trying to reserve the last item.
05
Explain caching and invalidation trade-offs.
Answer approach: Describe what is cached, freshness requirements, and whether a cache miss can be tolerated. Discuss cache-aside, time-to-live, write invalidation, and avoiding a cache stampede.
What to mention: Measure hit rate, stale-read risk, and tail latency; do not claim caching fixes an underlying inefficient query.
06
How would you build an event-driven notification service?
Answer approach: Clarify scale, delivery channels, failure handling, and acceptable delay. A common design accepts a request, persists an event, places work on a queue, and uses idempotent consumers with retries and a dead-letter route.
What to mention: Differentiate at-least-once delivery from exactly-once business effects and explain how failures are observed.
07
Why does idempotency matter for webhooks?
Answer approach: A sender may retry if a response is lost. Verify the request, record a unique event or operation key, apply the state transition once, and safely acknowledge duplicates.
What to mention: Mention transactional persistence and caution against using a non-atomic read-then-write check.
08
How would you choose between a monolith and microservices?
Answer approach: Compare team ownership, deployment needs, operational overhead, transaction boundaries, and observability. A well-modularized monolith is often simpler early; service separation can help when independent scaling or ownership justifies it.
What to mention: Discuss migration costs, data consistency, tracing, and failure modes rather than saying microservices are always better.
09
Explain time and space complexity in a coding interview.
Answer approach: State the input size, describe the baseline approach, then calculate runtime and memory using concrete operations. For example, a hash set can give expected O(n) duplicate detection with O(n) extra memory; sorting can use O(n log n) time with different memory trade-offs.
What to mention: Call out assumptions such as hash behavior, mutation of input, and worst-case versus average-case claims.
10
What is your testing strategy under a deadline?
Answer approach: Prioritize business-critical paths and regression risks. Combine fast unit tests, a small number of integration or contract tests, and focused end-to-end checks for high-impact flows.
What to mention: Explain why coverage percentage alone is not a quality metric; include review, monitoring, and rollback.
11
How do you release a risky change safely?
Answer approach: Use a feature flag or limited rollout when practical. Monitor error rate, latency, and business checks against a baseline. Define a rollback trigger before release.
What to mention: Distinguish backward-compatible database changes from changes that require coordinated deployment.
12
Tell me about a production incident you handled.
Answer approach: Use a truthful STAR structure: what failed, the impact, your responsibility, the first diagnostic signal, mitigation, communication, and a specific lesson. Separate what you personally did from the team's work.
What to mention: If you lack direct production ownership, use a real staging failure or incident exercise and state the context plainly.
13
How do you handle a disagreement in code review?
Answer approach: Clarify the shared goal, identify maintainability or correctness concerns, and compare alternatives with tests, a small benchmark, or project conventions. Seek agreement, then document the decision.
What to mention: Avoid portraying collaborators negatively; focus on evidence and outcome.
14
How do you explain a project to a non-technical interviewer?
Answer approach: Lead with the user problem, business effect, and your contribution, then add technical decisions only when asked. Give one honest before-and-after measure if your team actually tracked it.
What to mention: Be ready to explain what you would improve next and what limitations remained.
Example: explain an incident using STAR
A practical answer framework
Situation: Describe a real deployment or outage and its user impact without exaggeration.
Task: State what you personally owned, such as diagnosis, communication or rollback.
Action: Explain the evidence you checked, options you ruled out and the mitigation you applied.
Result: Use a measurement only if you have one; otherwise explain what you verified and what changed in the follow-up.
This is a structure, not a script claiming that you experienced a particular incident.
Your interview preparation checklist
Before your interview
- Revisit one coding problem and explain complexity aloud.
- Sketch a service architecture and one failure scenario.
- Prepare a real incident or difficult technical decision using STAR.
- Practise a concise explanation of one database, API or reliability trade-off.
- Ask the employer about code ownership, deploy frequency and observability.
Practise with QSourceAI
Use the free preparation hub to organize your experience and take a readiness assessment. Then rehearse job-specific questions using the AI mock interview guide.
QSourceAI is a Windows desktop interview co-pilot with CV-aware practice and, on eligible plans, spoken-question assistance. Review features and interview rules before using outside assistance.
Free preparation tools ↗
Frequently asked questions
Do software engineer interviews always include coding?
No. Some emphasize take-home work, pair programming, architecture or previous projects. Ask the recruiter which format and tools to expect.
How long should a system design answer take?
Clarify the time available. Spend the opening minutes on constraints and scale assumptions before drawing a design; leave room for trade-offs and questions.
Should I memorize interview answers?
Memorize your project facts and decision logic, not a rigid speech. Adapt the depth to the interviewer and correct mistakes openly.