Backend Engineer · interview questions
Backend Engineer interview questions
From the role's core and recommended topics, most asked first. Filter by the kind of answer the question wants.
API Design Core 33
- Most asked What makes an API RESTful, and what are good REST design practices?
- Most asked Which HTTP methods are safe and idempotent, and why does it matter?
- Most asked Which HTTP status codes should an API use, and when?
- Most asked Compare offset pagination and cursor (keyset) pagination.
- Most asked How should you version an API?
- Most asked How do idempotency keys work for POST requests?
- Most asked Write an Express or FastAPI endpoint that creates an order idempotently.
- Most asked Write a SQL query that returns each customer's three most recent orders.
- Most asked When would you choose GraphQL over REST, or gRPC over both?
- An API endpoint that was fast is now taking seconds under load. Walk through your investigation.
- How should APIs format error responses?
- How do you design reliable webhooks?
- How should APIs support filtering, sorting and field selection?
- Why use OpenAPI (and contract-first design)?
- What counts as a breaking change in an API?
- How should an API communicate rate limits to clients?
- How do you design APIs for long-running operations?
- How do APIs prevent lost updates from concurrent edits?
- What is HATEOAS and is it used in practice?
- How do you design bulk or batch endpoints?
- What naming conventions make APIs easier to use?
- What security practices apply to API design?
- What does an API gateway do, and when do you need one?
- How should APIs represent dates, times and money?
- What makes a great developer experience for a public API?
- PUT vs PATCH: how do you implement updates?
- How do you design event-driven APIs (events between services)?
- How should APIs handle large file uploads and downloads?
- What should a health or status endpoint return?
- How can APIs leverage HTTP caching?
- How do you deprecate an API endpoint responsibly?
- What consistency guarantees should an API document?
- How do APIs handle localization?
Authentication Core 34
- Most asked What is the difference between authentication and authorization?
- Most asked Compare session-based authentication with token-based (JWT) authentication.
- Most asked What are the most common JWT security pitfalls?
- Most asked What are OAuth 2.0 and OpenID Connect, and how do they differ?
- Most asked Explain the OAuth 2.0 Authorization Code flow with PKCE.
- Most asked How do refresh tokens work, and how do you secure them?
- Most asked How should passwords be stored?
- Most asked What is multi-factor authentication, and which factors are strongest?
- Most asked How do you secure session cookies?
- Most asked How do you protect login endpoints from brute force and credential stuffing?
- How do services authenticate to each other?
- What are passkeys (WebAuthn) and why are they phishing-resistant?
- What is session fixation and how do you prevent it?
- Why do cookie-based sessions need CSRF protection, and how do you implement it?
- What is user enumeration and how do you avoid it?
- How do you design a secure password reset flow?
- What is Single Sign-On, and how do SAML and OIDC compare?
- What is the Backend-for-Frontend (BFF) pattern for authentication in SPAs?
- When are API keys appropriate, and how do you manage them safely?
- How do you implement logout correctly across sessions and tokens?
- What are OAuth scopes, and are they enough for authorization?
- How should mobile apps handle authentication?
- What signals and controls help detect account takeover?
- How does JWKS-based key rotation work for JWTs?
- What are sender-constrained tokens (DPoP, mTLS-bound tokens)?
- How would you implement admin impersonation safely?
- What are the security considerations of passwordless magic links?
- What does zero trust mean for authentication?
- Should you build authentication yourself or use an identity provider?
- How do you authenticate WebSocket connections?
- How does authentication change in multi-tenant B2B applications?
- Why use constant-time comparison for secrets?
- What is HTTP Basic authentication and when is it acceptable?
- How do you safely link social logins to existing accounts?
Authorization Core 30
- Most asked Compare RBAC, ABAC and ReBAC authorization models.
- Most asked What is IDOR (Insecure Direct Object Reference) and how do you prevent it?
- Most asked What is the principle of least privilege and how do you apply it?
- Most asked Where should authorization checks live in an application?
- Most asked How do you enforce tenant isolation in a multi-tenant SaaS?
- What are policy engines like OPA, Cedar or Casbin, and when would you use one?
- What is Google Zanzibar and how does it inspire systems like OpenFGA and SpiceDB?
- What is role explosion and how do you avoid it?
- Why should code check permissions rather than role names?
- How do you handle authorization in GraphQL APIs?
- What is mass assignment and how is it an authorization problem?
- How do you design privileged admin access safely?
- How do OAuth scopes relate to user permissions in an API?
- Is it enough to enforce authorization at an API gateway?
- How should the frontend handle permissions?
- How do you cache authorization decisions safely?
- How do you audit who has access to what?
- How do you model resource ownership and sharing?
- How does Postgres Row-Level Security work?
- How do you test authorization logic?
- Should an unauthorized request for a resource return 403 or 404?
- How do you implement delegated access (acting on behalf of someone)?
- What's the difference between feature flags and authorization?
- Should you put roles and permissions inside JWTs?
- How do you enforce authorization in background jobs and queues?
- How do you return only the data a user is allowed to see in list endpoints?
- What is the 'new enemy' problem in authorization systems?
- How does cloud IAM (AWS/GCP/Azure) authorization work at a high level?
- How do plan limits (quotas) relate to authorization?
- What is privilege escalation and how do you prevent it?
Caching Core 46
- Most asked Explain the main caching patterns: cache-aside, read-through, write-through and write-behind.
- Most asked Why is cache invalidation hard, and what strategies help?
- Most asked What is a cache stampede (thundering herd) and how do you prevent it?
- Most asked How does HTTP caching work (Cache-Control, ETag, CDNs)?
- Most asked Explain the difference between cache penetration, cache breakdown and cache avalanche.
- Most asked In cache-aside, why can a value be stale even though you delete the key on every write?
- Most asked How can a CDN leak one user's data to another, and how do you prevent it?
- Most asked How do you design good cache keys?
- Most asked What are the risks of caching personalized or authorized data?
- Most asked In a system design interview, how do you decide what and where to cache?
- Most asked Should you invalidate the cache before or after the database commit?
- Most asked How does stale-while-revalidate work, and when is it inappropriate?
- Redis vs Memcached: when would you choose each?
- What are cache eviction policies (LRU, LFU, TTL) and how do you choose?
- What are the different layers where you can cache in a web system?
- When should you use an in-process (local) cache vs a distributed cache?
- How do you handle hot keys in a distributed cache?
- How do you keep cache and database consistent on writes?
- How does Redis scale and stay available?
- When would you use materialized views or denormalization instead of a cache?
- What happens if the cache goes down, and how do you design for it?
- Your Redis cluster has one shard at 100% CPU while others idle. What's likely and how do you fix it?
- How do you keep in-process L1 caches on many pods consistent?
- What are the risks of write-behind caching?
- What must a cache key include for an API response in a multi-tenant app?
- Why can a Redis failover bring back deleted (stale) cache entries?
- How do you invalidate caches when many services and scripts write to the same tables?
- After adding a Redis cache, users sometimes see stale or wrong data. How do you investigate and fix it?
- What is negative caching and why is it useful?
- How do you choose a TTL?
- What is cache warming and when is it needed?
- What should you consider when serializing objects into a cache?
- Which metrics show whether a cache is working well?
- How do you invalidate content on a CDN?
- How would you cache high-frequency counters (views, likes) efficiently?
- Why are database query caches often disabled or removed?
- What's the difference between memoization and caching?
- How do you implement a distributed lock with Redis, and what are the caveats?
- How do you cache GraphQL or highly dynamic API responses?
- How do frontend applications cache server data?
- How does a Bloom filter help in caching systems?
- Is it OK to store sessions in Redis?
- How do you invalidate thousands of related cache keys (e.g. all pages of a category) efficiently?
- Why add jitter to cache TTLs?
- Which Redis maxmemory-policy should a pure cache use, and what if sessions share the instance?
- What metrics tell you a cache is healthy?
Databases & Transactions Core 30
- Most asked What does ACID mean?
- Most asked Explain transaction isolation levels and the anomalies they prevent.
- Most asked How do database indexes work and when do they help or hurt?
- Most asked What is the N+1 query problem and how do you fix it?
- Most asked How do you choose between SQL and NoSQL databases?
- Most asked What is connection pooling and how do you size a pool?
- Most asked How do you run schema migrations without downtime?
- Most asked How do you keep data consistent across services without distributed transactions?
- What is normalization, and when should you denormalize?
- Compare optimistic and pessimistic locking.
- What causes deadlocks and how do you handle them?
- How does database replication work, and what is replication lag?
- What are partitioning and sharding, and what are their trade-offs?
- How do you read a query plan and optimize a slow query?
- What is the transactional outbox pattern?
- What are the pros and cons of using an ORM?
- What are the trade-offs of soft deletes?
- Should primary keys be auto-increment integers or UUIDs?
- Why should data integrity be enforced in the database, not only in application code?
- What is MVCC and how does it affect performance?
- How should you back up and restore databases?
- How do you scale a relational database?
- When do you need a dedicated search engine instead of SQL LIKE queries?
- When is storing JSON in a relational database appropriate?
- Why shouldn't analytics queries run on the production OLTP database?
- What is read-your-writes consistency and how do you provide it?
- How do you perform large data updates or backfills safely?
- How does the CAP theorem apply to databases?
- What are key database security practices?
- How should you test database code?
SQL & Databases Core 42
- Most asked SQL interview: explain INNER JOIN.
- Most asked SQL interview: explain LEFT JOIN.
- Most asked SQL interview: explain GROUP BY.
- Most asked SQL interview: explain HAVING.
- Most asked SQL interview: explain window functions.
- Most asked SQL interview: explain ACID.
- Most asked SQL interview: explain isolation levels.
- Most asked Data modeling: normalization 1NF/2NF/3NF?
- Most asked Indexing/performance: B-tree index?
- Most asked Indexing/performance: EXPLAIN / EXPLAIN ANALYZE?
- SQL interview: explain SELECT filtering.
- SQL interview: explain NULL semantics.
- SQL interview: explain transactions.
- Data modeling: primary key?
- Data modeling: foreign key?
- Data modeling: many-to-many?
- Indexing/performance: composite index?
- Indexing/performance: index write overhead?
- SQL interview: explain RIGHT / FULL JOIN.
- SQL interview: explain ORDER BY / LIMIT.
- SQL interview: explain subqueries.
- SQL interview: explain CTEs (WITH).
- SQL interview: explain UNION vs UNION ALL.
- SQL interview: explain EXISTS vs IN.
- SQL interview: explain CASE expressions.
- SQL interview: explain dirty/nonrepeatable/phantom reads.
- Data modeling: denormalization?
- Data modeling: surrogate vs natural keys?
- Data modeling: OLTP vs OLAP?
- Data modeling: constraints?
- Indexing/performance: covering index?
- Indexing/performance: sequential vs index scan?
- Indexing/performance: cardinality?
- Indexing/performance: vacuum / analyze (Postgres)?
- SQL interview: explain CROSS JOIN.
- SQL interview: explain DISTINCT.
- Data modeling: star schema?
- Data modeling: 1:1 relationships?
- Indexing/performance: hash index?
- Indexing/performance: partial index?
- What are the different types of JOINs in SQL?
- Why are indexes important in a database?
System Design Problems Core 31
- Most asked Design a URL shortener (like bit.ly).
- Most asked Design a distributed rate limiter.
- Most asked Design a chat application (like WhatsApp or Slack).
- Most asked Design a social media news feed (like Twitter/X or Instagram).
- Most asked Design a notification system (email, SMS, push).
- Most asked Design a payment system.
- Most asked Design a ticket booking system (like Ticketmaster).
- Most asked Design a distributed unique ID generator.
- Most asked Design a rate limiter for a public API.
- Most asked Design a webhook delivery system.
- Most asked Design an authentication service with SSO for multiple apps.
- Design a file storage and sharing service (like Dropbox or Google Drive).
- Design search autocomplete (typeahead).
- Design a distributed job scheduler / task queue.
- Design a video streaming platform (like YouTube).
- Design a web crawler.
- Design a real-time leaderboard for a game.
- Design a ride-sharing service (like Uber).
- Design the checkout and inventory system for an e-commerce site.
- Design a distributed cache (like Memcached/Redis Cluster).
- Design a collaborative document editor (like Google Docs).
- Design a metrics monitoring and alerting system (like Prometheus/Datadog).
- Design a centralized logging pipeline.
- Design an API gateway.
- Design a distributed key-value store (like DynamoDB/Cassandra).
- Design Pastebin.
- Design a 'find nearby places' service (like Yelp).
- Design a feature flag service.
- Design a stock exchange order matching engine.
- Design a full-text search service for a product catalog.
- Design a system to count likes/views at large scale.
Testing Core 43
- Most asked What is the test pyramid, and is it still relevant?
- Most asked What makes a good unit test?
- Most asked What's the difference between mocks, stubs, fakes and spies?
- Most asked How do you write reliable integration tests that use a database?
- Most asked What causes flaky tests and how do you fix them?
- Most asked How would you design a test strategy for a new web application?
- Most asked Your end-to-end test suite is flaky and takes an hour. How do you fix it?
- Most asked Write a Playwright test that logs in and checks the dashboard, and explain how you keep it stable.
- Most asked Is 100% code coverage a good goal?
- What should end-to-end tests cover, and how do you keep them stable?
- What is test-driven development (TDD) and when is it useful?
- What is contract testing?
- How do you test code that depends on the current time or randomness?
- How do you test code that calls external HTTP services?
- How should you test frontend components?
- What is contract testing, and when would you use it?
- How do you test an API, and what would you automate?
- What is the test pyramid, and when does it not fit?
- How do you approach performance and load testing?
- A critical bug reached production even though all tests passed. What do you do?
- How do you manage test data for automated tests?
- What should block a release, and how do you report quality to stakeholders?
- What is mutation testing, and what does it tell you that code coverage doesn't?
- How do you test a feature behind a feature flag?
- How do you integrate automated tests into a CI/CD pipeline?
- What is exploratory testing, and how do you do it well?
- Tell me about a time you improved a team's test automation.
- How should you manage test data?
- How do you test asynchronous code?
- What is property-based testing?
- What are snapshot tests, and what are their risks?
- How do you prevent regressions when fixing bugs?
- Where do performance tests fit in a test strategy?
- How do you include security testing in development?
- What are ephemeral (preview) environments and why use them?
- What is chaos engineering?
- How do you keep a large test suite fast?
- How do you add tests to legacy code that wasn't designed for testing?
- What should API tests verify?
- How do you test code behind feature flags?
- What are smoke tests?
- What is mutation testing?
- How do you test accessibility?
Messaging & Queues Core 29
- Most asked Why use message queues, and what problems do they solve?
- Most asked Explain at-most-once, at-least-once and exactly-once delivery.
- Most asked How do you make message consumers idempotent?
- Most asked Compare Kafka and RabbitMQ (and managed queues like SQS).
- Most asked How should retries and dead-letter queues work?
- Most asked What is the dual-write problem and how do you avoid it?
- How do you guarantee message ordering?
- What is backpressure and how do message systems handle it?
- What is the difference between a work queue and publish/subscribe?
- How do you design background job processing for a web application?
- What are event sourcing and CQRS?
- How do you evolve message schemas safely?
- How do Kafka partitions and consumer groups work?
- Choreography vs orchestration for multi-service workflows?
- How do you schedule delayed or future work with queues?
- What should you monitor in a messaging system?
- How would you design a notification system using queues?
- When is Redis (lists or streams) good enough as a queue?
- How does Kafka achieve exactly-once semantics?
- How do you handle large payloads in messages?
- How do you test asynchronous, message-driven code?
- How do you implement priority processing?
- What is change data capture (CDC) and how is it used?
- When would you use a workflow engine like Temporal instead of plain queues?
- How do you increase throughput of message processing?
- When should a request be handled synchronously versus asynchronously?
- How do you secure message brokers?
- What is the inbox pattern?
- What is stream processing and when do you need it?
Database Concurrency & Scaling Recommended 41
- Most asked Two customers buy the last item at the same moment and both orders are confirmed. What happened, and how do you prevent it?
- Most asked After a deploy, logs show hundreds of 'deadlock detected' errors per hour on checkout. Walk through how you'd investigate.
- Most asked Your service throws 'connection pool exhausted' errors but database CPU is only 20%. What's going on?
- Most asked Why shouldn't you call a payment API inside a database transaction?
- Most asked What's the difference between Read Committed and Repeatable Read in practice?
- Most asked Database CPU is at 85%. How do you decide what to optimise before buying a bigger server?
- Most asked A user saves their profile and the next page shows the old data. Reads go to replicas. How do you fix it?
- Most asked How do you choose a shard key for a multi-tenant SaaS?
- Most asked How do you rename a column with zero downtime?
- Most asked An order is saved but the 'OrderPlaced' event sometimes never reaches Kafka. How do you fix it?
- Most asked How do you prevent overselling in a flash sale with 50,000 buyers in the first minute?
- Most asked A Spring @Transactional method threw an exception but the data was still saved. What are the likely causes?
- Scale a read-heavy product catalog 100× — where do you start?
- Explain write skew with a real example and how to prevent it.
- How would you prevent double-booking a meeting room?
- When would you choose optimistic locking over SELECT … FOR UPDATE?
- How do you build a reliable job queue on Postgres?
- A customer has two active subscriptions created 40 ms apart. How do you make that impossible?
- A 20 ms ALTER TABLE caused a multi-minute outage. Explain and prevent it.
- A viral post's like counter makes requests slow. How do you handle hot rows?
- How do you retry a transaction safely after a serialization failure or deadlock?
- How do you choose the column order of a composite index?
- An API's deep pages are slow and a sync job sees duplicate and missing rows. What would you change?
- What risks come with automatic cross-region database failover?
- How would you make webhook processing exactly-once from the database's point of view?
- A scheduled job runs on every app instance and double-bills customers. How do you fix it?
- Why do 'get or create' operations deadlock on MySQL under load?
- You have 14 services autoscaling against one Postgres and hit 'too many clients'. What's the long-term fix?
- A dashboard aggregates years of data on every view. How would you speed it up?
- How do you delete 90 days of old events every night without hurting production?
- Why does changing `id % 8` to `id % 12` make resharding painful, and what's the alternative?
- How do you generate unique IDs across database shards?
- How do you safely backfill 50 million rows?
- How do you design user-facing features on top of eventually consistent data like search indexes?
- What is the difference between partitioning and sharding?
- When should you NOT use SKIP LOCKED?
- Why might you avoid running reports on the primary database?
- What does `idle in transaction` in pg_stat_activity tell you, and why is it dangerous?
- What's the difference between a deadlock and a lock wait timeout?
- How does Postgres SERIALIZABLE differ from MySQL SERIALIZABLE?
- Your read replicas lag 40 seconds during a nightly import. What do you do?
Performance & Scalability Recommended 30
- Most asked What is the difference between vertical and horizontal scaling?
- Most asked What's the difference between latency and throughput?
- Most asked How do you approach a performance problem methodically?
- Most asked How do load balancers work, and what algorithms do they use?
- Most asked Why are timeouts, retries and circuit breakers essential for performance and reliability?
- Most asked What are the most common database-related performance problems?
- Why should application servers be stateless, and where does state go?
- How does autoscaling work and what are its pitfalls?
- What are common concurrency bottlenecks in web applications?
- How does a CDN improve performance?
- When does asynchronous I/O improve performance, and when doesn't it?
- How can garbage collection affect application performance?
- What are Core Web Vitals and how do you improve them?
- How do you load test a system effectively?
- How would you scale a read-heavy system?
- How would you scale a write-heavy system?
- How do you reduce payload sizes in web applications?
- How do you do capacity planning?
- What is the 'chatty API' problem and how do you fix it?
- How can moving work to background jobs improve performance?
- Why does tail latency matter more as systems fan out?
- Why does connection reuse (keep-alive, pooling) matter for performance?
- How can serialization become a bottleneck?
- What is load shedding?
- What is graceful degradation?
- What changes when you scale to multiple regions?
- How can adding caches or indexes hurt performance?
- What are cold starts and how do you reduce them?
- What are common mistakes when benchmarking?
- How do algorithm and data structure choices affect backend performance?
Logging & Observability Recommended 35
- Most asked What are the three pillars of observability, and how do they differ?
- Most asked What is structured logging and why is it preferred over plain text logs?
- Most asked What is a correlation (request) ID and how do you propagate it?
- Most asked What is distributed tracing and how does OpenTelemetry fit in?
- Most asked What are the RED, USE and Four Golden Signals methods?
- Most asked What are SLIs, SLOs and error budgets?
- Most asked What should never be logged, and how do you prevent it?
- Most asked Walk through how you would investigate a sudden latency spike in production.
- How should log levels be used?
- Why should you track latency percentiles instead of averages?
- What are head-based and tail-based sampling in tracing?
- What is metric cardinality and why can it break a monitoring system?
- What makes a good alert?
- How do you design centralized log aggregation?
- How is audit logging different from application logging?
- What does an error-tracking tool (like Sentry) add beyond logs?
- How would you design a service dashboard?
- What is the difference between liveness, readiness and startup checks?
- How do you collect logs and metrics in Kubernetes?
- What makes an error log line useful during an incident?
- What goes into a good blameless postmortem?
- Can logging hurt application performance? How do you mitigate it?
- What are synthetic monitoring and real-user monitoring (RUM)?
- How do you control the cost of logs and telemetry?
- What is continuous profiling and when is it useful?
- How do you add observability to a frontend application?
- How does chaos engineering relate to observability?
- Why should you monitor business metrics, not just technical ones?
- Explain the Prometheus metric types: counter, gauge, histogram, summary.
- How do you find slow database queries in production?
- How do log rotation and retention work for services that write log files?
- How do you observe the impact of a deployment or feature flag?
- What is eBPF and why is it popular for observability?
- How do you keep log context (user, request) in async or multi-threaded code?
- What's the difference between monitoring and observability?
Web Security & WAF Recommended 32
- Most asked What is the OWASP Top 10 and which risks does it currently highlight?
- Most asked What is Cross-Site Scripting (XSS) and how do you prevent it?
- Most asked What is SQL injection and how do you prevent it?
- Most asked What is CSRF and how do you defend against it?
- Most asked What is a Web Application Firewall (WAF), and what can and can't it do?
- Most asked How do rate-limiting algorithms work (fixed window, sliding window, token bucket)?
- Most asked What is SSRF (Server-Side Request Forgery) and how do you prevent it?
- How do you protect a web application from DDoS and abusive traffic?
- What is Content-Security-Policy and how do you roll it out?
- Which HTTP security headers should every web app send?
- What is CORS, and what are common CORS misconfigurations?
- How do you manage vulnerable and outdated dependencies?
- What are common security misconfigurations in web deployments?
- How do you handle file uploads securely?
- How should applications manage secrets?
- What are insecure deserialization vulnerabilities?
- What is clickjacking and how do you prevent it?
- What are best practices for TLS/HTTPS?
- How do you protect sign-up, login and checkout flows from bots?
- What is threat modeling and how do you run one?
- What is an open redirect vulnerability?
- What is command injection and how do you prevent it?
- What is path traversal and how do you prevent it?
- Why are security logging and monitoring failures in the OWASP Top 10?
- What are software and data integrity failures?
- What are common cryptographic failures?
- What new security risks do LLM-powered features introduce?
- What does the OWASP API Security Top 10 add beyond the web Top 10?
- How do cookie prefixes like __Host- and __Secure- improve security?
- How do you build security into the development lifecycle?
- What is XXE (XML External Entity) injection?
- What is subdomain takeover?
Web Framework Internals Recommended 27
- Most asked What is a request lifecycle, and why should a backend engineer know it for their framework?
- Most asked What layers does a request pass through before reaching application code, and how should their timeouts relate?
- Most asked Where should authentication, authorisation, validation and error formatting live in a web framework?
- Most asked Walk through the Laravel request lifecycle and say where you would add code that must run on every request.
- Most asked Walk through the Django request lifecycle.
- Most asked How does Express handle a request, and how are errors routed?
- Most asked What is the NestJS request lifecycle?
- Most asked Describe the Spring MVC request flow and where exceptions are handled.
- Most asked What is the middleware 'onion' model?
- Most asked Describe Symfony's HttpKernel lifecycle and how listener priorities affect it.
- Most asked Describe how FastAPI processes a request and where exceptions are handled.
- Most asked What happens in the browser from navigation to an interactive single-page app?
- Compare the shared-nothing model (PHP-FPM) with long-running application servers.
- How do synchronous workers and event loops differ in serving concurrent requests?
- How do you trace a single request across a load balancer, web server, application and downstream services?
- What state can leak between requests under Laravel Octane, and how do you prevent it?
- What does PHP-FPM's capacity depend on, and why can it fail with low CPU usage?
- Walk through the Flask request lifecycle, including contexts and teardown.
- When do you use a guard, an interceptor, a pipe or an exception filter in NestJS?
- What happens when a request hits a Next.js App Router app?
- Scenario: users get 504 errors but your application logs show those requests succeeding. What is happening?
- Scenario: after moving to an async framework, every endpoint becomes slow whenever one partner API is slow. Why?
- Scenario: an API returns 500 instead of 401 for expired tokens. In which frameworks have you seen this and why?
- Scenario: one new endpoint leaked other customers' data while forty others were fine. How do you prevent this class of bug?
- What runs after the response is sent, and what is it good for?
- Compare request handling in Laravel and Symfony.
- How does the ASP.NET Core request pipeline compare with Express or Laravel middleware?
Design Patterns Recommended 80
- Most asked What is a design pattern, and why are they useful?
- Most asked Explain the SOLID principles.
- Most asked What is the difference between dependency inversion, dependency injection and inversion of control?
- Most asked Why is composition often preferred over inheritance?
- Most asked What is dependency injection, and what forms does it take?
- Most asked Explain the Factory Method pattern and how it differs from a simple factory.
- Most asked What problem does the Builder pattern solve? Show an example.
- Most asked How do you implement a Singleton, and why is it often considered an anti-pattern?
- Most asked What is the Adapter pattern? Give an example.
- Most asked What is the Decorator pattern? How is it different from inheritance?
- Most asked Explain the Observer pattern and give examples from real frameworks.
- Most asked Explain the Strategy pattern with an example.
- Most asked What is the difference between the Strategy and State patterns?
- Most asked Compare Adapter, Decorator, Proxy and Facade.
- Most asked What is the difference between Observer and Pub/Sub?
- Most asked What is the Repository pattern, and when is it worth using?
- Most asked When should you NOT use a design pattern?
- Most asked Scenario: your checkout supports card and PayPal, and the business adds a new payment provider every quarter. How would you design it?
- Most asked What are the three categories of Gang of Four design patterns?
- Most asked Explain the Liskov Substitution Principle with an example.
- Most asked What is the Facade pattern?
- Most asked How would you implement undo/redo with the Command pattern?
- Most asked Compare Factory Method, Abstract Factory and Builder.
- Most asked What is MVC, and which design patterns does it combine?
- Most asked What is an anti-pattern? Name a few common ones.
- Most asked Scenario: when an order is placed, several systems (email, inventory, analytics, loyalty) must react, and more will be added. How do you design it?
- What does the Single Responsibility Principle mean in practice?
- How do you apply the Open/Closed Principle?
- What kinds of Proxy are there, and what does each do?
- What is the State pattern? When would you use it?
- What is the Circuit Breaker pattern?
- How do you safely refactor existing code toward a design pattern?
- What is the Interface Segregation Principle?
- What does "program to an interface, not an implementation" mean?
- What are coupling and cohesion, and how do design patterns affect them?
- When would you use the Abstract Factory pattern?
- What is the Prototype pattern, and what is the main pitfall when implementing it?
- What is the Bridge pattern?
- Explain the Composite pattern with a real-world example.
- Explain Chain of Responsibility and give a web-development example.
- What is the Iterator pattern, and how do modern languages support it?
- What is the Template Method pattern?
- When would you use a Decorator instead of subclassing?
- Template Method or Strategy: how do you choose?
- Is HTTP middleware Chain of Responsibility or Decorator?
- What is the Unit of Work pattern?
- What is CQRS, and how does it relate to the Command pattern?
- Which design patterns do you see in React?
- Which design patterns do Laravel and Spring use internally?
- What is the Middleware (pipeline) pattern used for?
- How would you refactor a god object?
- Why is a service locator considered worse than dependency injection?
- Scenario: you need undo/redo in a drawing or text editor. Which pattern would you use?
- Scenario: a third-party SDK you must use has a completely different interface from the rest of your code. What do you do?
- Scenario: a class has a constructor with ten parameters, many optional. How would you improve it?
- Scenario: you need to add caching and logging to an existing service without modifying it. How?
- Scenario: every method of an `Order` class starts with a switch on `status`. How would you refactor it?
- How would you explain to a junior developer how to choose the right design pattern?
- What is the difference between Active Record and Data Mapper?
- Which design patterns does the Java standard library use?
- Which design patterns do Python features replace or simplify?
- Which design patterns do you use in PHP and Laravel day to day?
- Which design patterns are common in TypeScript and Node.js code?
- How do design patterns relate to testability?
- What is the Flyweight pattern, and when is it worth using?
- What is the Mediator pattern?
- What is the Memento pattern?
- What is the Visitor pattern, and what is its main trade-off?
- What is the Interpreter pattern?
- Command or Memento for undo: which would you use?
- How is Mediator different from Observer?
- What is the difference between Bridge and Adapter?
- How do Composite and Decorator differ, given both use recursive composition?
- When would you use a simple factory, and when a dependency injection container?
- What is the Null Object pattern, and when can it be harmful?
- What is the Specification pattern?
- Scenario: product categories contain products and subcategories to any depth, and you need totals per category. Which pattern fits?
- What is the Object Pool pattern, and where do you meet it?
- What is the Strangler Fig pattern, and how do design patterns help with it?
- Is it a good idea to name classes after patterns, such as `PaymentStrategy` or `UserFactory`?
Docker Recommended 39
- Most asked What is a container, and how does it differ from a virtual machine?
- Most asked What is the difference between an image and a container, and how do image layers work?
- Most asked How does Docker build caching work, and how do you order a Dockerfile to use it well?
- Most asked What are multi-stage builds, and why use them?
- Most asked CMD or ENTRYPOINT: what is the difference, and what are exec and shell forms?
- Most asked What are Dockerfile best practices for production images?
- Most asked ARG or ENV: what is the difference, and how do you pass secrets into a build safely?
- Most asked How do you secure Docker containers and images?
- Most asked Write a production Dockerfile for a Python web app: small, non-root and cache-friendly.
- Most asked Why does PID 1 matter in containers, and what problems can it cause?
- Most asked How do you make Docker images smaller?
- Most asked Volumes, bind mounts and tmpfs: when do you use each?
- Most asked How does Docker networking work? Explain bridge, host and user-defined networks.
- Most asked What is Docker Compose used for, and how do you handle service start-up order?
- Most asked How do you limit a container's CPU and memory, and what happens when it exceeds them?
- Most asked How should you tag Docker images, and why is 'latest' a problem?
- Most asked How do you debug a container that exits immediately or behaves differently in production?
- Most asked How do you run Docker builds in CI pipelines efficiently and safely?
- Most asked What is a software supply chain attack on containers, and how do you defend against it?
- Why is mounting the Docker socket into a container dangerous?
- What is BuildKit, and what does docker buildx add?
- COPY or ADD: what is the difference?
- What does HEALTHCHECK do in a Dockerfile, and do orchestrators use it?
- How do container logs work in Docker, and how do you stop them filling the disk?
- What is the OCI, and how do Docker, containerd, runc and Podman relate?
- What should you consider when choosing a base image?
- How do you handle configuration for containers across environments?
- What is the Docker build context, and why does it matter?
- Why might a container work on your laptop but fail on a server or in CI?
- How do you run a database in Docker for local development, and should you do it in production?
- How do you speed up a slow Docker build?
- Explain what happens when you run docker run nginx.
- What is Docker Swarm, and why do most teams use Kubernetes or managed services instead?
- What are rootless Docker and user namespaces?
- How do you clean up disk space used by Docker?
- How do you run multiple processes in one container, and should you?
- What changed with Docker Desktop licensing, and what are the alternatives?
- How do you handle time zones, locales and certificates in minimal images?
- Docker Compose in production: is it appropriate?
FAANG / Big Tech Recommended 102
- Most asked Design a URL shortener like bit.ly.
- Most asked Design a news feed / timeline.
- Most asked Design a rate limiter.
- Most asked Design a chat/messaging system.
- Most asked Explain CAP theorem and when you choose AP vs CP.
- Most asked Walk through time/space complexity of two-sum approaches.
- Most asked How do you find the longest substring without repeating characters?
- Most asked Explain BFS vs DFS and when to use each.
- Most asked Explain LRU cache design.
- Most asked What is dynamic programming? Give an interview example.
- Most asked Tell me about a time you disagreed with a technical decision.
- Most asked Tell me about a time you took ownership of a production issue.
- Most asked What happens when you type a URL in a browser?
- Most asked Explain SQL vs NoSQL trade-offs.
- Most asked How would you approach a coding interview if stuck for 5 minutes?
- Most asked What is consistent hashing and why use it?
- Most asked Explain ACID vs BASE.
- Most asked What is idempotency in APIs?
- Most asked Explain microservices vs monolith trade-offs.
- Most asked What is a load balancer L4 vs L7?
- Design a distributed cache.
- Describe a time you delivered under ambiguity.
- Give an example of customer obsession (Amazon LP).
- How do indexes work and when do they hurt?
- Design a key-value store.
- Tell me about a time you improved performance.
- Design Apple's Find My network at a high level.
- How would you design iMessage delivery and encryption?
- Design a photo library sync service like iCloud Photos.
- Design a push notification system for mobile apps.
- What is the CAP theorem and how do you apply it in practice?
- Explain consistent hashing and why it matters for caches.
- Design a video streaming CDN architecture.
- Design YouTube / video streaming at a high level.
- Design a ride-sharing matching system.
- How would you design autocomplete / typeahead?
- Design a notification system.
- Explain eventual consistency with an example.
- How do you detect a cycle in a linked list?
- Describe merge intervals.
- How do you serialize/deserialize a binary tree?
- How do you find median from a data stream?
- How do you topologically sort a graph?
- Describe diving deep into a metric that looked wrong.
- Tell me about inventing and simplifying a process.
- How do you earn trust with a cross-functional partner?
- Describe a time you had to say no to a stakeholder.
- Tell me about mentoring someone.
- What is Googleyness to you?
- How do you handle bias for action vs needing more data?
- Explain HTTP vs HTTPS and TLS briefly.
- How do you design for multi-region?
- What is a CDN and when do you need one?
- How do you observe a production service?
- Describe a cross-team project you led.
- How do you prioritize a backlog under pressure?
- How would you A/B test a ranking change?
- Design a search autocomplete backend for Amazon product search.
- What is a good behavioral example for Meta's Move Fast?
- How do you secure secrets in cloud apps?
- How would you estimate storage for a messaging app?
- What metrics define a healthy API?
- Design a distributed job queue.
- What questions would you ask your interviewers at FAANG?
- Explain App Store review and content distribution challenges.
- How do you design on-device ML inference with cloud fallback?
- Compare optimistic vs pessimistic locking in concurrent edits.
- How would you design a feature store for ML models?
- Design a distributed lock service.
- Explain how you would A/B test a ranking change safely.
- Design a searchable encrypted document store for consumer backups.
- How do you debug intermittent production latency spikes?
- Design an API gateway for a large microservices fleet.
- Design a real-time collaborative document editor.
- How would you migrate a monolith to services without downtime?
- Design a content moderation pipeline for user uploads.
- How do you secure secrets in a large engineering org?
- Design a metrics and alerting platform.
- What tradeoffs exist between SQL and NoSQL for a shopping cart?
- How would you interview-design a battery-efficient background sync?
- Design Uber-style surge pricing / marketplace matching at high level.
- How do you detect and resolve split-brain?
- Explain quickselect for kth largest.
- How would you design an API for a parking garage?
- Explain optimistic vs pessimistic locking.
- Explain container orchestration basics (Kubernetes).
- How do you handle hot keys in a cache?
- Explain OAuth2 authorization code flow briefly.
- What privacy considerations matter for mobile apps?
- Explain MapReduce at a high level.
- What is backpressure in streaming systems?
- How does Netflix think about chaos engineering?
- Explain Apple's emphasis on craftsmanship in interviews.
- Compare REST and gRPC for internal services.
- Explain blue/green vs canary deployments.
- Tell me about a time you gave critical feedback.
- How do you prepare for a bar-raiser interview?
- Explain pagination strategies (offset vs cursor).
- What is feature flagging and why use it?
- How do you approach object-oriented design for an elevator system?
- Explain garbage collection at a high level.
- Explain bloom filters and a production use case.
Behavioral & STAR Recommended 41
- Most asked Tell me about a time you worked with a difficult teammate.
- Most asked Describe a disagreement you had with a coworker and how you resolved it.
- Most asked Tell me about a time you disagreed with your manager's decision.
- Most asked Tell me about a time you failed at something important.
- Most asked Describe a mistake that had a significant impact and how you handled it.
- Most asked Tell me about a time you had to work with unclear or changing requirements.
- Most asked Tell me about a time you missed a deadline.
- Most asked Tell me about a time you received critical feedback and how you responded.
- Most asked Describe a project you owned from start to finish.
- Most asked Tell me about a time you had to juggle multiple competing deadlines.
- Tell me about a time you led a project without formal authority.
- Tell me about a time you took responsibility for a team failure.
- Describe a time you had to collaborate with someone whose working style was very different from yours.
- Tell me about a successful project you completed as part of a team.
- Tell me about a time you helped a struggling teammate.
- Describe a time you had to push back on a stakeholder's request.
- Describe a time you had to deliver unwelcome feedback to a peer.
- Describe a time you had to motivate a team through a difficult period.
- Tell me about a decision you made that was unpopular with your team.
- Tell me about a time you had to make a decision with incomplete information as a leader.
- Tell me about a project that didn't go as planned.
- Tell me about a time you went above and beyond your job description.
- Describe a time you identified a problem no one had asked you to solve.
- Describe a situation where you had to make a decision without all the information you wanted.
- Tell me about a time priorities shifted midway through a project.
- Describe how you decide what to work on when everything feels urgent.
- Tell me about a time you helped a colleague grow their skills.
- Tell me about a time you received feedback that was hard to hear.
- Describe a time you had to rely on a team member you didn't fully trust yet.
- Tell me about a conflict between two people on your team and how you handled it.
- Describe a time you delegated an important task.
- Tell me about a time you had to say no to your manager.
- Describe how you handle working on something without a clear owner.
- Tell me about a time you had to say no to a request to protect a deadline.
- Describe a time you had to deprioritize something important.
- Describe your approach to onboarding a new team member.
- Tell me about a time you gave someone feedback that changed their behavior.
- Describe a time you learned something valuable from someone more junior than you.
- Describe how you typically respond to criticism.
- Tell me about a time you gave feedback that was poorly received.
- Describe a time feedback from a peer changed how you approached your work.