SDE2 Interview Questions at Amazon
267 real SDE2 interview questions asked at Amazon. Covers Technical, System Design, HR, Scenario, Screening rounds. Sourced from engineers who cleared the loop.
Interview Signals — What Amazon Asks SDE2s
All SDE2 Questions Asked at Amazon
Design a distributed rate limiter that can handle 10M requests per second across multiple data centers. Discuss consistency tradeoffs, the choice between token bucket vs leaky bucket, and how you would handle clock skew across regions.
Explain the CAP theorem with a real database example for each combination. Which pair does a standard RDBMS choose?
Explain how Prometheus and Grafana work together for monitoring. What are the key metrics you'd track for a Node.js API?
How would you implement blue-green deployment with database migrations?
Your PostgreSQL database has a table with 200 million records. A nightly batch job runs UPDATE on 5 million rows. The next morning, queries that were taking 50ms now take 8 seconds. What happened and how do you fix it?
Given an array of intervals, merge all overlapping intervals. Return the minimum number of intervals after merging. Example: [[1,3],[2,6],[8,10],[15,18]] → [[1,6],[8,10],[15,18]]
You have a query that takes 45 seconds on a table with 50 million rows. EXPLAIN shows a full table scan. The WHERE clause filters on user_id and created_at. There's already an index on user_id. What do you do?
Implement an LRU (Least Recently Used) cache with O(1) get and O(1) put. Explain why a naive HashMap alone doesn't solve this.
Write a SQL query to detect customers who haven't made a purchase in the last 30 days but were active in the 30 days before that (churned customers).
Design a distributed session system for a multi-instance Spring Boot application. Users shouldn't lose sessions when server restarts.
Explain how connection draining works in load balancers and why it's important for zero-downtime deployments.
Explain the Node.js event loop phases in order. A setTimeout(fn, 0) and setImmediate(fn) are both queued. Which runs first and why? What if they're inside an I/O callback?
You have a log file where each line has a timestamp and user ID. Find the K users who appear most frequently in the last N minutes. The file is 100GB and is being written to in real-time.
Explain database connection pool sizing. A service has 4 CPU cores and connects to PostgreSQL. What's the optimal pool size?
Your team wants to adopt TypeScript but has a 200K-line JavaScript codebase. What's the migration strategy?
Design a data structure that supports push, pop, and getMin in O(1) time and O(1) space (beyond the stack itself).
Your CI/CD pipeline takes 45 minutes. How do you reduce it to under 10 minutes?
What is tail call optimization and why doesn't JavaScript guarantee it despite ES6 spec?
Given a binary tree, find the longest path between any two nodes (not necessarily through root). You have 30 minutes.
A rate limiting mechanism blocks requests after 100/minute. An attacker sends 99 requests/minute from 1000 different IPs. Your rate limiter doesn't catch this. What type of attack is this and how do you mitigate it?
Explain how you would implement zero-downtime database migrations in a deployment pipeline.
Your React SPA loads slowly on first visit (8 seconds). Bundle size is 5MB. How do you optimize?
How would you implement search-as-you-type autocomplete for 10 million product names with <50ms response time?
A Node.js service crashes every night at 2 AM with 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory'. There's a cron job that runs at 1:55 AM. Explain the likely cause and your fix.
You're implementing a rate limiter using a sliding window algorithm. Given a stream of timestamps (Unix milliseconds), return true if a request is within the limit of 100 requests per minute. The stream can have 1 billion events.
Given a binary tree, check if it's a valid Binary Search Tree. Consider all possible edge cases.
Explain how OAuth 2.0 authorization code flow works. Why is it more secure than the implicit flow?
You have a function that runs in O(n²) time and your interviewer says 'this is too slow for n=10 million.' The function finds all pairs of numbers in an array that sum to a target. Optimize it to O(n).
Implement a min-heap data structure from scratch. Show insert and extractMin operations.
What is Kubernetes horizontal pod autoscaling (HPA) and what metrics can it scale on?
You're designing an API for external developers. What versioning strategy would you use and why?
Your performance review is coming up. You've done excellent technical work but you're 'below expectations' because you don't write status updates and don't speak up in meetings. How do you respond to this feedback?
Design an algorithm to find the shortest path through a maze represented as a 2D grid. 0 = open, 1 = wall. Start at top-left, end at bottom-right.
Your Kubernetes pod keeps crashing with OOMKilled. How do you diagnose and fix it?
What is the difference between a monorepo and polyrepo? What are the real trade-offs?
A senior engineer on your team consistently writes correct but unreadable code and refuses code review feedback. Other team members are increasingly frustrated. You're not their manager. What do you do?
Find the first missing positive integer in an unsorted array. Must be O(n) time and O(1) extra space.
Explain blue-green vs canary deployment. When would you choose each?
Explain how database indexes can SLOW DOWN queries. When would you remove an index?
You deployed a change that caused a production outage lasting 2 hours. How do you handle the immediate aftermath and what do you do in the days after?
Explain graceful shutdown in a Node.js service. What happens to in-flight requests when you kill the process without it?
Implement a stack using only two queues. Then implement a queue using only two stacks.
Given an array of n integers, find all triplets that sum to zero. Remove duplicates from the result.
What is a timing attack and how do you prevent it in a password comparison function?
Your React app has a form with 50 fields. On each keystroke, the entire form re-renders taking 200ms. How do you fix this?
Your Node.js API has memory usage growing from 100MB to 800MB over 24 hours with stable traffic. How do you find the leak?
Your Node.js API handles 500 requests/second in staging. In production at 2000 req/sec, memory climbs to 8GB and the process crashes after 20 minutes. How do you diagnose and fix this?
Explain how garbage collection works in V8 (Node.js/Chrome). What causes GC pauses?
What is the difference between React.memo, useMemo, and useCallback? Give an example where each is the right tool.
Explain the difference between useLayoutEffect and useEffect. Give a real scenario where using useEffect instead of useLayoutEffect causes a visible bug.
Design a Node.js service that must process exactly one event per user per day (deduplication). Events arrive out of order and can have duplicates. You have Redis available.
How does React's reconciliation algorithm (Fiber) decide whether to update or replace a component?
You discover a reflected XSS vulnerability in your React application despite React's automatic escaping. How is this possible in React?
You need zero-downtime database schema changes in production. Your service has 50 instances running. How do you add a NOT NULL column to a high-traffic table?
Your team has low morale after a failed product launch. How do you help the team recover?
Explain rate limiting algorithms: token bucket, leaky bucket, fixed window, sliding window. Which is best for APIs?
Explain the difference between process.nextTick() and Promise.then() in the event loop. Which executes first?
You're asked to estimate a project that's similar to one that took twice as long as estimated last time. How do you estimate this time?
After adding React DevTools Profiler, you see a component called UserAvatar re-rendering 200 times per second even when no user data changes. What are the most likely causes?
How do you handle disagreements with a product manager about feature scope?
Explain what happens when you type 'google.com' in a browser. Cover DNS, TCP, TLS, HTTP in sequence.
Your Node.js service uses Express and you want to implement request tracing across microservices. Each log line should show the same trace ID for the same request, even across async operations.
You've made a mistake that caused a production outage. How do you handle the aftermath?
What is a circuit breaker pattern? How does it prevent cascade failures in microservices?
Explain how Node.js handles CPU-intensive tasks without worker threads. What happens to the event loop and all pending HTTP requests while a heavy computation runs?
Your company wants you to implement a feature you think will harm the user experience. How do you handle it?
What metrics do you track to measure if a new feature is successful? You launched 3 weeks ago.
Explain the difference between liveness probe and readiness probe in Kubernetes. What happens if you configure liveness probe too aggressively?
Explain how GraphQL's execution model works. When does it execute resolvers in parallel vs sequentially?
You notice a senior engineer's code in a PR has a significant flaw that they missed. How do you handle the review?
How do you prioritize a backlog with 200 items and 5 competing stakeholders with different opinions?
Your React form has complex validation: some fields depend on others, some validation is async (API calls). How do you architect this without the form becoming unmanageable?
You've been given a deadline that you know is impossible to meet. Your manager insists it's non-negotiable. What do you do?
Tell me about a time you had to deliver a project under a very tight deadline. What trade-offs did you make and how did you communicate them to stakeholders? Which Amazon Leadership Principle guided your decision?
You have a TypeScript generic function that takes an object and a key. It should return the value at that key in a type-safe way so callers get proper autocomplete. Write the function signature.
Your team is arguing about whether to refactor a critical service or ship a new feature. Both are urgent. How do you decide?
A user reports that typing in a search input feels 'laggy' only when there are many results showing below. Nothing in the input code changed. Explain and fix.
A client says your GraphQL API is 'too slow.' What metrics would you collect to diagnose this? What tools exist in the GraphQL ecosystem?
Your Java microservice has slow startup times (20 seconds) because it initializes many Spring beans. How do you reduce startup time?
Explain the N+1 problem in GraphQL. You have a query that returns 100 posts, each with their author. Without optimization, this makes 101 database queries. Fix this.
Explain the difference between horizontal and vertical scaling. Give examples where vertical scaling is NOT the solution.
Explain Java's WeakReference, SoftReference, and PhantomReference. Give practical use cases.
You notice your React app's memory usage grows from 80MB to 400MB over 30 minutes of normal usage. There are no error logs. How do you identify and fix the memory leak?
Your GraphQL API has a query that allows clients to nest objects 10 levels deep. A malicious client sends a deeply nested query that takes 30 seconds and uses 4GB of memory. How do you prevent this?
Implement binary search on a rotated sorted array (e.g., [4,5,6,7,0,1,2]).
Design Amazon's recommendation engine (customers who bought X also bought Y). Cover: collaborative filtering vs content-based, item-item similarity at scale, real-time vs batch computation, and how you handle the cold-start problem for new products.
Your microservices use synchronous REST calls and you're experiencing cascading failures. You implement circuit breakers, but during the open state, users get blank pages. How do you improve user experience during failures?
Explain the React rendering lifecycle in a functional component with hooks. In what exact order do useState, useEffect, and useLayoutEffect fire during mount and update?
Explain how Java's CompletableFuture works. How do you chain async operations and handle errors?
Given a binary tree, return the level-order traversal as a list of lists.
Explain TypeScript's conditional types. Write one that extracts the return type of a Promise.
What is the Fork/Join framework in Java? How does it differ from ExecutorService for CPU-bound tasks?
Write a function to detect if a linked list has a cycle. Can you do it without extra space?
Describe a time you disagreed with a decision made by your team or manager. How did you raise the concern? What was the outcome? (Amazon LP: Have Backbone; Disagree and Commit)
Your Kafka consumer group has 10 consumers and 10 partitions. One consumer is slower than others and keeps getting rebalances, causing other consumers to pause processing. How do you fix this?
Your Elasticsearch query returns results in 200ms but users see 2 seconds because the frontend waits for all 20 facets to load. How do you optimize this?
Implement a stack that supports push, pop, top, and getMin in O(1) time.
Write a function to compute the power set (all subsets) of a given set.
Given an array of integers and a target sum, return all unique triplets that sum to the target. Discuss time and space complexity. Then extend the problem to k-sum and analyze how recursion depth changes performance for large k.
Your team ships a React app and Lighthouse shows CLS (Cumulative Layout Shift) of 0.45. Users see content jumping on load. No one on the team has touched layout recently. How do you diagnose and fix it?
Your team just launched a feature and a competitor launched an almost identical feature 2 days earlier. A manager blames 'slow engineers.' How do you respond professionally?
Implement a function that finds the longest common subsequence (LCS) of two strings.
Explain how Kubernetes networking works when Pod A calls Pod B by service name. Trace the exact path of the network packet.
Explain Redis pub/sub vs Redis Streams. When would you use each?
Implement LRU Cache with O(1) get and put operations.
Explain MongoDB's write concern and read preference options. What trade-offs do they make?
Given a 2D grid, find the shortest path from start to end avoiding obstacles.
Your React app renders a list of 50,000 rows. Users report severe lag when scrolling. The current implementation maps over the entire array and renders each row as a component. Walk me through exactly how you'd fix this without changing the data source.
Your Kubernetes cluster nodes are at 80% memory utilization. Adding pods fails with 'Insufficient memory'. You have 10 nodes. Some pods have no resource limits set. What's your investigation and remediation plan?
Your query has LEFT JOIN to a large table but most rows in the result have NULL for the joined table columns. EXPLAIN shows full scan of the joined table. How do you optimize?
You're mentoring a junior developer who is technically brilliant but writes code that no one else can understand. How do you improve this?
Write a function to find the longest palindromic substring in a string. What is the optimal approach?
Explain and implement the Dutch National Flag algorithm for sorting an array with only 3 distinct values.
After deploying a new version in Kubernetes, users report intermittent errors. 30% of requests fail, 70% succeed. Rollback is taking 10 minutes and you need a faster solution right now.
You need to move 50 million rows from table A to table B (archive) and delete them from A. How do you do this without locking the production table?
Your code review comment is dismissed repeatedly by a senior engineer who says 'it works, don't overthink it.' The code has a potential race condition you're certain about. What do you do?
What is Redis pipelining and how does it differ from transactions? When should you use each?
Write a function to find all valid parentheses combinations for n pairs.
Redis is using 80% of available memory. Your application isn't caching more data than before. What could cause Redis memory growth?
Design a URL shortener like bit.ly that handles 100K writes and 10M reads per day. The shortened URLs should never expire.
Explain the CAP theorem and how NoSQL databases make trade-offs around it.
Implement topological sort on a directed acyclic graph (DAG). What's the real-world use case?
Your Kubernetes pod keeps crashing with OOMKilled. You set memory limit to 512Mi. The application normally uses 300Mi but spikes to 600Mi on certain requests. How do you fix this without just raising the limit?
Design a connection pool for database connections. What parameters would you expose and what are the failure modes?
Given a string, find the length of the longest substring without repeating characters.
You're using DynamoDB for a social media app. Users can like posts. You need to count total likes per post in real-time. A naive counter update causes hot partition issues at viral posts. How do you solve this?
Your application runs this query every second: SELECT count(*) FROM orders WHERE status='processing'. The count is displayed on a dashboard. The orders table has 100M rows. How do you make this fast?
Implement a distributed lock using Redis. What can go wrong with a naive SETNX approach?
Write a function to check if a binary tree is a valid Binary Search Tree (BST).
Explain Amazon's DynamoDB single-table design pattern. Why do you put multiple entity types in one table? Walk through a real example with access patterns, partition key / sort key design, and GSI usage.
Your API Gateway + Lambda architecture handles 10,000 requests/second normally. During a flash sale, it receives 100,000 requests/second. Lambda concurrency limit is 1000. What happens and how do you handle this?
An engineer proposes adding an in-memory cache to every service to reduce database load. What are the problems with this approach at scale?
Implement a min-heap from scratch. What are the time complexities of insert and extractMin?
You notice your database CPU is fine but disk I/O is at 100%. Queries are fast individually but slow under concurrent load. What's happening?
Explain Redis persistence options: RDB vs AOF. Your service can tolerate losing at most 1 second of data. Which do you configure?
Given an array, find the maximum sum subarray (Kadane's algorithm). Explain the dynamic programming insight.
Your API response time is 200ms. You add Redis caching. Response time drops to 20ms for cache hits but is now 400ms for cache misses (double the original). What happened?
You're using Redis as a session store. A Redis failover takes 30 seconds. During this time, all users are logged out. How do you make sessions resilient to Redis failures?
Write an algorithm to serialize and deserialize a binary tree.
What is the difference between a message broker and an event streaming platform? Kafka vs RabbitMQ?
Given an array, find the maximum sum of a subarray (Kadane's algorithm). Then extend: return the actual subarray indices, not just the sum.
Your Redis cache stores 100,000 keys. At midnight, all keys expire simultaneously (same TTL set when deployed). This causes a thundering herd that crashes your database. How do you prevent this?
Implement a Trie (prefix tree) with insert, search, and startsWith methods.
How do you implement optimistic UI updates in a React app with server synchronization?
Your AWS Lambda function processes S3 events. Under high load, you notice some events are processed twice, causing duplicate records in DynamoDB. Lambda is configured with at-least-once delivery. How do you fix this?
Design a data structure for a phone directory that supports: addNumber, removeNumber, getAny (return any available number). All operations O(1).
Your team uses feature flags but they're managed as hardcoded constants in code. This means a code deploy is needed to toggle a feature. How do you improve this?
Given a matrix of 0s and 1s, find the number of islands (connected components of 1s).
Explain the Twelve-Factor App methodology. Pick 3 factors and explain how violating them causes production problems.
Given a string, find the minimum number of characters to insert to make it a palindrome.
Implement a JavaScript function that throttles another function: no matter how many times it's called, it executes at most once per N milliseconds.
Implement a function to find the kth largest element in an unsorted array. Optimize for O(n) average case.
A developer claims 'our tests are passing so production is fine.' Production has a bug. What testing gaps does this reveal?
Implement a search with Elasticsearch that: filters by category, full-text searches by name, and ranks by relevance + recency.
Explain what a deadlock is and how to prevent one in a multi-threaded Java application.
Explain the differences between Helm 2 and Helm 3 for Kubernetes package management. What was removed and why?
You have N tasks, each with a deadline and profit. You can do at most one task per unit of time. Maximize total profit. (Job Scheduling with deadlines)
Explain Python's garbage collector alongside reference counting. When does reference counting fail?
Your Elasticsearch cluster has 3 nodes. You create an index with 5 primary shards and 1 replica each. How many shards total and how are they distributed?
Your production database has a table missing an index. Adding the index on 1 billion rows. How do you do this safely?
Explain Python's GIL. You have CPU-bound code that you parallelized with threading. It's not faster. Why? How do you actually make it faster?
Implement Dijkstra's algorithm for shortest path. A city has 1000 nodes and 5000 edges. What data structure gives best performance?
Your team merged 3 PRs simultaneously. Production broke. All 3 PRs look fine individually. What's the likely cause and how do you find it?
Explain how Elasticsearch inverted index works. Why is it faster than SQL LIKE queries for full-text search?
Design a leaderboard system for a game with 10 million players updated in real-time.
Given a matrix of 0s and 1s, find the largest rectangle containing only 1s.
Implement a Python decorator that retries a function up to N times with exponential backoff on specific exception types.
Explain the differences between REST, GraphQL, and gRPC. Which would you choose for a mobile app backend?
Design a search engine for a 1 million product catalog with faceted filtering (category, price range, brand) and full-text search.
Your Python FastAPI service handles 1000 requests/second. Adding one blocking I/O call (requests.get()) drops throughput to 50 requests/second. Why and how do you fix it without rewriting the service?
Implement a function that, given an integer n, returns all valid combinations of n pairs of parentheses.
How do you implement database read replicas and what queries should you route where?
In a Java 17 application, you see OutOfMemoryError: Metaspace. The heap is fine. What is Metaspace, what causes it to fill up, and how do you fix it?
Explain Python's descriptor protocol. How does @property use it? Write a descriptor that validates a positive integer.
You have a stream of integers. At any point, you can be asked for the median. Implement a data structure that supports add(num) in O(log n) and getMedian() in O(1).
What is the difference between a process and a thread? How does Node.js achieve concurrency with a single thread?
Find the longest increasing subsequence in an array. Must be O(n log n).
Given a React component that renders 10,000 checkboxes, selecting one checkbox causes all 10,000 to re-render. Fix it without virtualizing.
Explain eventual consistency. Design a system where a user updates their profile picture and it shows consistently everywhere.
Implement a function to serialize and deserialize a binary tree. The serialized format must allow perfect reconstruction.
Write a function to deep clone a JavaScript object without using JSON.parse/JSON.stringify. Handle: Date, RegExp, undefined, circular references.
What is Kafka log compaction and when should you use it?
Your new feature is working in development but failing in production. No exception is thrown. How do you systematically debug it?
What is Java's sealed class hierarchy (Java 17+)? How does it improve pattern matching?
Explain the difference between synchronized, ReentrantLock, ReadWriteLock, and StampedLock. Give a scenario where each is the right choice.
Explain CompletableFuture in Java 8+. How do you run 3 API calls in parallel and combine results when all complete?
Given a list of intervals sorted by start time, insert a new interval and merge if necessary. Return the updated list.
How does Kafka handle message ordering? Can you guarantee order across a topic with multiple partitions?
You need to give a production hotfix in 30 minutes. The bug is causing data corruption. You don't have time for a full review cycle. What's your process?
Explain how Node.js DNS resolution can unexpectedly block your service.
Explain Kafka's message delivery guarantees: at-most-once, at-least-once, exactly-once. How does each affect your consumer design?
What is Project Loom (virtual threads) in Java 21? How does it change the threading model?
Design a thread-safe cache in Java that: evicts the least recently used entry when full, has O(1) get and put, and handles concurrent access without a global lock.
You have a graph of cities with flight prices between them. Find the cheapest flight from source to destination with at most K stops.
What are Worker Threads in Node.js and how do they differ from child_process.fork()?
Your Kafka consumer is processing messages slowly. Messages pile up and consumer lag grows. How do you fix this?
Explain the difference between synchronous and asynchronous communication between microservices. When would each fail you?
Implement a function that returns all permutations of a string. If string has duplicates, return unique permutations only.
Explain Kafka consumer groups and how they enable parallelism. What happens if you have more consumers than partitions?
What is database connection pooling? Why would you NOT want too large a connection pool?
Explain how Java's Garbage Collector works in G1GC mode. Your application has 8GB heap and full GCs every 10 minutes cause 5-second pauses. How do you tune this?
Given an m x n grid of integers, find the path from top-left to bottom-right that maximizes the sum. You can only move right or down.
Explain how a CDN handles cache invalidation. What happens if you update a file and CDN serves the old version?
Your manager gives you a feature that conflicts with another team's ongoing work. Both are due in 2 weeks. You discover this conflict today. What do you do?
What is the Java Memory Model (JMM)? Give a specific example where code behaves correctly in single-threaded but incorrectly in multi-threaded execution without synchronization.
You have an array of stock prices. Find the maximum profit from at most 2 transactions (buy-sell cycles). You must sell before buying again.
Explain the difference between OAuth 2.0 and OpenID Connect (OIDC). Which one should you use for login?
Implement Dijkstra's shortest path algorithm. What graph type is it NOT suitable for?
Given a binary search tree, find the k-th smallest element. Can you do it without building a sorted array?
What is Redis Pub/Sub and how does it differ from using Redis as a message queue with Lists?
Implement a function to detect a cycle in a linked list. What is Floyd's cycle detection algorithm and why is it O(1) space?
How does Redis handle persistence? What are the trade-offs between RDB and AOF?
What is the difference between HashMap and ConcurrentHashMap at the implementation level? When does ConcurrentHashMap still cause problems?
Design a thread-safe singleton in Java. What are the pitfalls of double-checked locking?
Your Redis cluster goes down. How do you design your application so it degrades gracefully?
What is SSRF (Server-Side Request Forgery) and give a real-world example of how it's exploited.
What is Lambda cold start and why does it happen? Name two concrete techniques to reduce its impact on a latency-sensitive API.
What is the difference between volatile and synchronized in Java? When is volatile sufficient?
Explain Redis data structures and give a use case for each: String, Hash, List, Set, Sorted Set.
Explain content security policy (CSP). How does it protect against XSS?
You deploy a new feature on Friday. Monday morning, your boss says 'sales dropped 30% over the weekend.' How do you investigate whether your deployment caused it?
Explain how Python's dictionary achieves average O(1) lookup. What happens internally when two keys hash to the same bucket?
Explain the difference between active-passive and active-active database configurations.
Your React app has a race condition: user types in search, two API calls are made, the slower one returns last and overwrites the correct result. Fix it.
A customer calls support at 2 AM. They say they can see another customer's order history when they click 'My Orders.' You're on call. Walk me through your incident response.
Your Kubernetes cluster has nodes running at 95% CPU. New pods are in Pending state. How do you resolve this?
Your Java service has two threads simultaneously checking product stock (quantity=1). Both see available and create orders, resulting in quantity=-1. Fix this.
How do you optimize a slow COUNT(*) query on a table with 100 million rows?
What is GitOps and how does ArgoCD implement it?
Design a URL shortener like bit.ly. It needs to handle 100 million URLs, 10 billion reads per day, and the short URLs must never collide. Walk through your complete design.
How do you handle database migrations when you have 10 instances of a service running and you need to add a NOT NULL column?
How does HashiCorp Vault work for secret management? How do you integrate it with Kubernetes?
Explain Kubernetes Deployments vs StatefulSets. When would you use a StatefulSet?
You notice a SQL query uses an index, but adding ORDER BY makes it 10x slower. Explain why and how to fix it.
How do you handle global loading states and error handling in a React app with 50+ API calls?
Design the API contract between microservices. When service A calls service B, how do you version the contract so service B can change without breaking service A?
What is the difference between optimistic and pessimistic locking in databases?
What is the purpose of React.Profiler component and how do you use it to find performance bottlenecks?
You're given a task that you believe is technically wrong. The approach will work but will create significant technical debt. Your manager wants it done 'the quick way.' What do you do?
Your 15 microservices all have their own logging format. Log aggregation is unusable because fields differ. How do you standardize this across teams without rewriting all services?
Explain Concurrent React. What problem does it solve and how does startTransition help? Give a real example where it improves UX.
A team member submits a PR with 3000 lines of code changes. How do you approach the code review?
What is the purpose of React.cloneElement vs React.Children.map? When would you use each?
What is a materialized view and when would you use one over a regular view?
Explain the difference between React 17 and React 18 concurrent features. What is startTransition?
Your database read replicas are always 30 seconds behind the primary. During this lag, users see stale data after updating their profile. How do you handle read-after-write consistency without routing all reads to primary?
Your MongoDB replica set has 3 nodes. The primary goes down. How long before writes can resume and what determines this?
A microservice that was handling 500 req/sec now crashes at 100 req/sec after adding a new feature. The feature adds one line: logging the full request body. What's happening?
What is a covering index? Show how adding one column to an index can change a query from a disk read to a memory read.
Your team wants to add caching everywhere to improve performance. What questions would you ask before adding any cache?
Your application uses ElastiCache Redis. During a Redis failover (primary → replica promotion), your app throws connection errors for 30 seconds. How do you reduce this to under 5 seconds?
How does the event loop work in JavaScript? What is the difference between microtasks and macrotasks?
You're asked to reduce your service's AWS costs by 40% without degrading performance. Where do you start?
What are TypeScript conditional types? Write a type that returns the element type of an array, or the type itself if not an array.
What is the difference between authentication with sessions vs JWT? Security trade-offs?
Your API's p99 latency is 3 seconds but p50 is 50ms. Most users have a great experience but 1% see extreme slowness. How do you investigate the outliers?
Explain feature flags and how you use them for A/B testing and safe deployments.
A developer adds a NOT NULL constraint to a column in a production table with 100 million rows. The ALTER TABLE runs for 6 hours and locks the table. How should this have been done?
Explain the difference between SQS, SNS, and EventBridge. A new developer says 'they're all message queues.' Correct this.
Explain how React context causes performance issues and how to solve them without third-party libraries.
What is the N+1 query problem? How do you detect it in production without reading every query?
Your Spring Boot microservice calls another service via Feign client. The downstream service is slow (30 second response). How do you prevent your service from hanging?
What is eventual consistency in distributed systems? How does Amazon S3 handle it?
Find the median of a stream of numbers. Numbers arrive one at a time. After each addition, you must be able to return the current median in O(log n) time.
Your DynamoDB table has a hot partition because 80% of reads go to the same partition key (a popular user). How do you solve this?
You have a table with 500 million rows. A query runs in 0.1s in development (10K rows) but 45 seconds in production. Same index exists on both. Why?
Explain OpenTelemetry. How does it unify traces, metrics, and logs?
Practice these questions with AI feedback
Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.
Build my study plan →