SDE2 Interview Questions
713 verified SDE2 interview questions from Amazon, Google, Microsoft, Flipkart, Infosys and more. Covers all experience levels.
Interview Signals for SDE2 Roles
Top Questions by Upvotes
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.
Design Uber's driver-rider matching system. How do you match the nearest available driver to a rider within 200ms at global scale? Cover: geospatial indexing (H3/S2), the dispatch algorithm, how you handle supply-demand imbalances, and what happens when a matched driver rejects the trip.
What is the difference between String, StringBuilder, and StringBuffer in Java? When would you use each? Explain immutability, thread safety, performance implications, and give an example where using String in a loop causes excessive object creation.
Given a binary tree, return the boundary of the tree in anti-clockwise direction starting from the root. The boundary consists of the left boundary, leaves, and the right boundary in reverse.
Design Netflix's video recommendation system. Netflix serves 250 million subscribers. How do you generate personalised top-10 rows for each user in real time? Cover: collaborative filtering, content-based signals, contextual signals (time of day, device), and how you handle the cold-start problem for new users.
What are the SOLID principles? Explain each with a real-world Java example. Then describe a scenario where rigidly following SOLID leads to over-engineering, and how you balance pragmatism with good design.
Design Microsoft Teams' presence system. How do you propagate "online / away / busy" status to millions of users with sub-second latency without overwhelming the backend?
Explain the Java Memory Model. What are heap and stack? How does garbage collection work? Describe generational GC (Young, Old, Metaspace), GC roots, mark-and-sweep, and how to diagnose memory leaks with tools like VisualVM or jmap.
Design PhonePe's UPI transaction system to handle 1 billion transactions per day. Cover: request routing to the correct bank, NPCI integration, handling duplicate transactions, consistency vs availability trade-offs, and how you build a reliable audit trail for regulatory compliance.
Explain Oracle's MVCC (Multi-Version Concurrency Control) and how it enables consistent reads without blocking writers. How does it differ from SQL Server's locking approach? What are the downsides of MVCC (undo log growth, long-running transactions)?
Explain the CAP theorem with a real database example for each combination. Which pair does a standard RDBMS choose?
A developer puts async code inside useEffect by returning an async arrow function: useEffect(() => async () => {...}). Why is this wrong?
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 →