Home/Blog/Google SDE-2 Interview Questions: 30 Real Questions with Solutions (2026)
GoogleSDE-2interview questions18 min read

Google SDE-2 Interview Questions: 30 Real Questions with Solutions (2026)

Google's SDE-2 (Software Development Engineer II) interview is a rigorous multi-stage process that tests coding, system design, and Googleyness. This guide breaks down every round, 30 real questions with solutions, and a minute-by-minute walkthrough to help you prepare strategically.


The Google SDE-2 Interview Process

A standard Google SDE-2 loop:

  1. Recruiter screen (15–30 min) — Background, role fit, salary expectations
  2. Technical phone screen (45–60 min) — 1–2 coding problems
  3. Virtual on-site — 4–5 rounds:
    • 2 coding rounds (1 problem each, medium-to-hard)
    • 1 system design round (45 min)
    • 1 behavioral/Googleyness round (45 min)
    • 1 optional domain-specific round (depending on team)

Google's coding rounds are different from Meta — they focus on one problem per round with deep follow-ups, rather than two problems per round. Expect to be pushed on edge cases, optimizations, and alternative approaches.

Google SDE-2 Interview Process Flowchart

flowchart TD
    A["Recruiter Screen"] --> B["Phone Screen - 45-60 min"]
    B --> C{"Pass?"}
    C -->|"No"| D["Reapply in 12 months"]
    C -->|"Yes"| E["Virtual On-site Loop"]
    E --> F["Coding Round 1 - 1 problem, 45 min"]
    F --> G["Coding Round 2 - 1 problem, 45 min"]
    G --> H["System Design Round - 45 min"]
    H --> I["Behavioral/Googleyness Round - 45 min"]
    I --> J["Debrief + Hiring Committee"]
    J --> K{"Decision?"}
    K -->|"Strong Hire"| L["Offer"]
    K -->|"Lean Hire"| M["Team Matching"]
    K -->|"No Hire"| D

Screening Round

Format: 1–2 coding problems, 45–60 minutes

Typical Questions:

  1. Merge K Sorted Lists — Use a min-heap to merge k sorted linked lists into one sorted list. Time: O(N log k), Space: O(k).
  2. Valid Parentheses with Star — Extended version of the classic stack problem where * can represent (, ), or empty string.

Difficulty: Medium. Google uses screening to filter out candidates who can't code clean solutions under mild pressure.

Tip: Google interviewers care about correctness first, optimization second. Get a working solution, then optimize.


Coding Rounds

Format: 1 problem per round, 45 minutes each (2 rounds total)

Google's coding rounds are deep, not wide. You'll face one medium-to-hard problem and be expected to:

  • Write a clean, bug-free solution
  • Analyze time and space complexity
  • Handle all edge cases
  • Discuss alternative approaches
  • Optimize when asked

Round 1 — Typical Problem Types

  • Graph algorithms (BFS/DFS, topological sort)
  • Dynamic programming (2D, state machine)
  • Binary search on answer space

Round 2 — Typical Problem Types

  • Tree manipulations (serialization, construction)
  • Sliding window with constraints
  • Trie-based string problems

Tip: Google interviewers will keep asking follow-ups until you reach the optimal solution. Don't panic — this is normal. They want to see how you think under pressure.


System Design Round

Format: 1 system design problem, 45 minutes

Common SDE-2 Questions:

  1. Design Google Maps (navigation, ETA, traffic)
  2. Design YouTube (video upload, streaming, recommendations)
  3. Design Google Search autocomplete
  4. Design a distributed task scheduler
  5. Design Google Drive (file sync, sharing, versioning)

What Google Evaluates at SDE-2:

  • Can you define requirements and constraints?
  • Can you design a high-level architecture?
  • Can you dive deep into specific components?
  • Do you understand trade-offs (consistency vs availability, latency vs throughput)?
  • Can you handle scaling from 1M to 100M users?

Tip: At SDE-2, Google expects you to lead the design discussion. Don't wait for the interviewer to guide you. Present your design, ask for feedback, and iterate.


Behavioral / Googleyness Round

Format: Behavioral interview, 45 minutes

Google's behavioral round is called "Googleyness and Leadership." It evaluates:

  • Googleyness — Do you work well in ambiguity? Are you collaborative? Do you challenge the status quo?
  • Leadership — Have you led projects? Mentored others? Made technical decisions with business impact?

Common Questions:

  1. Tell me about a time you led a project without formal authority
  2. Describe a situation where you had to make a decision with incomplete information
  3. How do you handle disagreements with senior engineers?
  4. Tell me about a time you failed and what you learned
  5. Describe a project where you improved a process or system significantly
  6. How do you prioritize when everything seems urgent?

Tip: Use STAR format (Situation, Task, Action, Result). Quantify impact. Google values "intellectual humility" — acknowledge what you didn't know and how you learned.


30 Real Google SDE-2 Questions

Arrays & Strings

Q1. Two Sum — Given an array of integers and a target, return indices of two numbers that add up to the target.

Solution: Use a hash map to store seen numbers. For each number, check if target - num exists in the map. Time: O(n), Space: O(n).

Q2. Container With Most Water — Find two lines that together with the x-axis form a container holding the most water.

Solution: Two pointers from both ends. Move the pointer pointing to the shorter line inward. Time: O(n).

Q3. Product of Array Except Self — Return an array where each element is the product of all other elements without using division.

Solution: Compute prefix products and suffix products in two passes. Time: O(n), Space: O(1) extra.

Q4. Longest Substring Without Repeating Characters — Find the length of the longest substring without repeating characters.

Solution: Sliding window with a hash set. Expand right, contract left when duplicate found. Time: O(n).

Q5. Minimum Window Substring — Find the minimum window in string s that contains all characters of string t.

Solution: Sliding window with character frequency map. Expand until all characters covered, then contract from left. Time: O(n).

Q6. Group Anagrams — Group strings that are anagrams of each other.

Solution: Use sorted string as key in hash map. Group all strings with the same sorted key. Time: O(n * k log k).

Trees & Graphs

Q7. Validate Binary Search Tree — Check if a binary tree is a valid BST.

Solution: In-order traversal with range checking. Pass min/max bounds down the tree. Time: O(n).

Q8. Lowest Common Ancestor of a Binary Tree — Find the LCA of two nodes in a binary tree.

Solution: Recursive DFS. If current node is null or matches either target, return it. Recurse left and right. If both return non-null, current is LCA. Time: O(n).

Q9. Serialize and Deserialize Binary Tree — Design an algorithm to serialize and deserialize a binary tree.

Solution: Pre-order traversal with null markers. Deserialize by reading values sequentially and rebuilding the tree. Time: O(n).

Q10. Number of Islands — Given a 2D grid, count the number of islands (connected 1s surrounded by 0s).

Solution: BFS/DFS from each unvisited 1, marking all connected 1s as visited. Time: O(m * n).

Q11. Word Ladder — Find the shortest transformation sequence from beginWord to endWord, changing one letter at a time.

Solution: BFS from beginWord. At each level, try all 26 letters for each position. Time: O(n * 26 * L).

Q12. Course Schedule (Topological Sort) — Determine if you can finish all courses given prerequisites.

Solution: Kahn's algorithm (BFS-based topological sort). Track in-degrees, process nodes with 0 in-degree. Time: O(V + E).

Dynamic Programming

Q13. Climbing Stairs — You can climb 1 or 2 steps. How many distinct ways to reach the top?

Solution: Classic Fibonacci. dp[i] = dp[i-1] + dp[i-2]. Time: O(n), Space: O(1).

Q14. Longest Increasing Subsequence — Find the length of the longest strictly increasing subsequence.

Solution: DP with binary search. Maintain a tails array where tails[i] is the smallest tail of all increasing subsequences of length i+1. Time: O(n log n).

Q15. Edit Distance — Find the minimum number of operations to convert word1 to word2 (insert, delete, replace).

Solution: 2D DP table. dp[i][j] = min cost to convert word1[0..i] to word2[0..j]. Time: O(m * n).

Q16. Coin Change — Find the fewest coins needed to make up an amount.

Solution: Bottom-up DP. For each amount from 1 to target, try each coin and take the minimum. Time: O(amount * coins).

Q17. Maximum Subarray — Find the contiguous subarray with the largest sum.

Solution: Kadane's algorithm. Track current sum, reset to 0 when it goes negative. Time: O(n).

Q18. Partition Equal Subset Sum — Determine if you can partition the array into two subsets with equal sum.

Solution: Subset sum DP. Target is sum/2. Use 1D DP array iterating through elements. Time: O(n * sum/2).

System Design Questions

Q19. Design a URL Shortener (like bit.ly) — Handle shortening, redirecting, analytics, and custom aliases.

Solution: Use base62 encoding of auto-increment IDs. Store mappings in a key-value store (DynamoDB). Use 301 redirects. Add analytics via async event logging.

Q20. Design a Chat System (like WhatsApp) — Support 1:1 and group messaging, delivery status, and offline messages.

Solution: WebSocket connections for real-time. Message queue (Kafka) for reliable delivery. Store-and-forward pattern. Use message IDs for ordering and deduplication.

Q21. Design a Rate Limiter — Implement rate limiting for an API (token bucket or sliding window).

Solution: Token bucket: add tokens at fixed rate, consume on request. Store in Redis with atomic operations. Support multiple rate limits (per user, per endpoint).

Q22. Design a News Feed System — Generate a personalized feed for each user based on followed sources.

Solution: Fan-out on write for celebrities, fan-out on read for regular users. Cache hot feeds in Redis. Rank using a scoring algorithm (time decay + relevance).

Q23. Design Google Docs — Real-time collaborative editing with conflict resolution.

Solution: Operational Transformation (OT) or CRDT for conflict resolution. WebSocket for real-time sync. Version history stored as operation log.

Q24. Design a Notification System — Support push, email, and SMS with preference management.

Solution: Event-driven architecture. Notification service consumes events, applies user preferences, and dispatches to channel-specific services (FCM, SES, SNS). Use templates for content.

Behavioral / Googleyness Questions

Q25. Tell me about a time you disagreed with a technical decision. How did you handle it?

Answer Framework: Situation: Disagreed on using microservices vs monolith. Task: Need to align the team. Action: Prepared a written comparison with trade-offs, presented in a design review. Result: Team chose a hybrid approach. Project shipped on time.

Q26. Describe a project where you had to learn a new technology quickly.

Answer Framework: Situation: Needed to migrate from REST to GraphQL. Task: Learn and implement within 3 weeks. Action: Built a prototype, paired with an experienced engineer, read documentation. Result: Migration completed, API latency reduced by 40%.

Q27. Tell me about a time you improved a process or system that others accepted as "good enough."

Answer Framework: Situation: Deployment took 45 minutes. Task: Reduce it. Action: Identified bottlenecks (unused steps, sequential jobs), parallelized, added caching. Result: Deploy time dropped to 8 minutes.

Q28. Describe a situation where you had to push back on a requirement.

Answer Framework: Situation: Product wanted a feature that would degrade performance for 60% of users. Task: Find a way to meet business goals without hurting UX. Action: Proposed an alternative using background sync. Result: Feature shipped, performance maintained.

Q29. How do you handle ambiguity in project requirements?

Answer Framework: Situation: Vague requirement for "improve search." Task: Clarify scope. Action: Created a discovery document with 5 proposed improvements, got stakeholder alignment, prioritized by impact. Result: Delivered targeted improvements with measurable results.

Q30. Tell me about a time you mentored a junior engineer.

Answer Framework: Situation: New hire struggled with code reviews. Task: Help them improve. Action: Paired on reviews, explained reasoning behind feedback, gave them ownership of a small feature. Result: They became independent within 2 months, later mentored others.


4 Code Examples with Solutions

Example 1: Merge K Sorted Lists

import heapq
from typing import List, Optional

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

def merge_k_lists(lists: List[Optional[ListNode]]) -> Optional[ListNode]:
    heap = []
    for i, node in enumerate(lists):
        if node:
            heapq.heappush(heap, (node.val, i, node))

    dummy = ListNode(0)
    current = dummy

    while heap:
        val, idx, node = heapq.heappop(heap)
        current.next = ListNode(val)
        current = current.next

        if node.next:
            heapq.heappush(heap, (node.next.val, idx, node.next))

    return dummy.next

Time Complexity: O(N log k) where N is total nodes, k is number of lists.
Space Complexity: O(k) for the min-heap.


Example 2: Number of Islands (BFS)

from collections import deque
from typing import List

def num_islands(grid: List[List[str]]) -> int:
    if not grid:
        return 0

    rows, cols = len(grid), len(grid[0])
    count = 0

    def bfs(r, c):
        queue = deque([(r, c)])
        grid[r][c] = "0"
        directions = [(1, 0), (-1, 0), (0, 1), (0, -1)]

        while queue:
            row, col = queue.popleft()
            for dr, dc in directions:
                nr, nc = row + dr, col + dc
                if 0 <= nr < rows and 0 <= nc < cols and grid[nr][nc] == "1":
                    queue.append((nr, nc))
                    grid[nr][nc] = "0"

    for r in range(rows):
        for c in range(cols):
            if grid[r][c] == "1":
                bfs(r, c)
                count += 1

    return count

Time Complexity: O(m * n) — each cell visited at most once.
Space Complexity: O(min(m, n)) — queue size bounded by perimeter.


Example 3: Longest Increasing Subsequence (Binary Search)

import bisect
from typing import List

def length_of_lis(nums: List[int]) -> int:
    tails = []

    for num in nums:
        pos = bisect.bisect_left(tails, num)
        if pos == len(tails):
            tails.append(num)
        else:
            tails[pos] = num

    return len(tails)

Time Complexity: O(n log n) — each element requires a binary search.
Space Complexity: O(n) — the tails array.


Example 4: Validate Binary Search Tree

from typing import Optional

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def is_valid_bst(root: Optional[TreeNode]) -> bool:
    def validate(node, low, high):
        if not node:
            return True
        if node.val <= low or node.val >= high:
            return False
        return validate(node.left, low, node.val) and validate(node.right, node.val, high)

    return validate(root, float("-inf"), float("inf"))

Time Complexity: O(n) — visits each node once.
Space Complexity: O(h) — recursion stack where h is tree height.


Scorecard: How Google Evaluates SDE-2 Candidates

Evaluation Area Weight What Google Looks For Strong Hire Signal
Coding 40% Clean code, optimal algorithms, edge case handling Solves hard problem in <30 min with optimal solution
System Design 30% Architecture, trade-offs, scaling, deep dives Leads design, handles follow-ups, considers failure modes
Googleyness 20% Collaboration, ambiguity tolerance, intellectual humility Strong STAR stories, self-awareness, learning mindset
Leadership 10% Initiative, mentoring, technical decision-making Led projects, influenced without authority, quantified impact

Note: Google uses a hiring committee model. Your interviewer(s) submit feedback, but a separate committee makes the final decision. This reduces individual bias but means your written feedback must be compelling.


Minute-by-Minute Walkthrough of a Google Coding Round

A 45-minute Google coding round typically follows this structure:

Time Phase What Happens What You Should Do
0–5 min Problem Introduction Interviewer presents the problem, clarifies constraints Ask clarifying questions. Restate the problem in your own words.
5–10 min Discussion Talk through 2–3 approaches, discuss trade-offs Start with brute force, then optimize. Explain time/space of each.
10–12 min Approach Selection Agree on the optimal approach with interviewer Confirm the approach before coding. Ask if they want any specific method.
12–30 min Coding Write the solution Think out loud. Write clean, modular code. Handle edge cases as you go.
30–35 min Testing Walk through test cases manually Trace through examples. Check edge cases: empty input, single element, large input.
35–40 min Optimization Discuss time/space complexity, possible improvements Analyze your solution. Mention alternative approaches if any.
40–45 min Follow-ups Interviewer may ask follow-up questions Be ready to extend your solution. Handle variations of the original problem.

Key Insight: Google interviewers often start follow-ups at the 30-minute mark. If you finish early, you'll face harder extensions. This is a good sign — it means you're doing well.


Google SDE-1 vs SDE-2 vs SDE-3: Expectation Comparison

Aspect SDE-1 (L3) SDE-2 (L4) SDE-3 (L5)
Experience 0–2 years 3–5 years 6–10+ years
Coding Difficulty Easy-Medium Medium-Hard Hard + Follow-ups
System Design Not required (or basic) Required (1 round) Required (2 rounds)
Expected Depth Solve the problem Solve + optimize + discuss trade-offs Lead design, handle ambiguity, drive technical strategy
Behavioral Focus Learning ability, teamwork Leadership, impact, initiative Organizational impact, mentoring, technical vision
Scope of Impact Individual tasks Team-level projects Multi-team or org-level initiatives
Interview Rounds 3–4 4–5 5–6
Hiring Committee Yes Yes Yes + Senior Review

Key Difference: SDE-2 is where Google starts evaluating your ability to lead projects and make technical decisions, not just execute tasks.


Preparation Strategy

Timeline (8-Week Plan)

Week Focus Area Activities
1–2 Data Structures & Algorithms Solve 5–8 problems/day. Focus on trees, graphs, DP, and binary search.
3–4 System Design Study 2 designs/day. Practice drawing architectures. Read "Designing Data-Intensive Applications."
5 Behavioral Preparation Prepare 7–10 STAR stories. Practice with a friend or AI.
6 Mock Interviews Take 3–4 mocks (coding + system design + behavioral).
7 Weak Areas Target your weakest area. Revisit problems you struggled with.
8 Final Review Light practice. Review notes. Rest before the interview.

Resources


Why Mock Interviews Matter

Most engineers prepare for Google by solving problems alone. That's like practicing a speech in front of a mirror — you miss the real pressure.

You need to simulate the actual experience:

  • Pressure — Time ticking, someone watching your every move
  • Feedback — Identify blind spots you can't see yourself
  • Communication — Practice explaining your thought process out loud
  • Realism — AI interviewers that push back on your choices, ask follow-ups, and force you to defend your architecture

This is exactly what InterviewSkool provides.

How InterviewSkool Mock Interviews Help

For Coding Rounds:

  • AI interviewer presents real Google-style problems
  • You code in a real editor while the interviewer watches
  • Instant feedback on time/space complexity and code quality

For System Design Rounds:

  • AI interviewer asks follow-ups and challenges your choices
  • Whiteboard for architecture diagrams
  • Detailed feedback on structure, trade-offs, and scaling

For Behavioral Rounds:

  • AI interviewer asks STAR-format questions
  • Feedback on clarity, impact, and leadership signals

After Every Interview:

  • Detailed feedback on strengths and weaknesses
  • Overall score and hiring signal
  • Areas to improve before the real thing

Frequently Asked Questions

How long does the Google SDE-2 interview process take?

The entire process, from recruiter screen to offer, typically takes 6–10 weeks. The phone screen is 1 round, the virtual onsite is 4–5 rounds (2 coding, 1 system design, 1 behavioral, optional domain round).

How many LeetCode problems should I solve for Google SDE-2?

Aim for 300–400 problems, focusing on Google-tagged questions on LeetCode. Prioritize trees, graphs, dynamic programming, and binary search. Quality over quantity — understand patterns deeply.

What's the difference between SDE-1 and SDE-2 at Google?

SDE-1 (L3) is entry-level, focusing on individual tasks. SDE-2 (L4) requires leading projects, making technical decisions, and designing systems. System design rounds are mandatory at SDE-2.

Is system design important for Google SDE-2?

Yes. System design is a critical round at SDE-2. You need to demonstrate ability to design scalable systems, discuss trade-offs, and handle follow-up deep dives.

How should I prepare for Google's Googleyness round?

Use STAR format. Prepare 7–10 stories covering leadership, conflict resolution, technical challenges, learning agility, and process improvements. Focus on quantifying your impact.


Conclusion

Google SDE-2 is challenging but achievable with the right preparation. Focus on deep problem-solving (not just solving, but optimizing and explaining), system design structure, and strong behavioral stories. Mock interviews help you build the confidence and communication skills that separate strong candidates from the rest.

Ready to practice? Start your mock interview at InterviewSkool.

Frequently Asked Questions

What is the Google SDE-2 interview process?

Google SDE-2 interview consists of: recruiter screen (15-30 min), technical phone screen (1-2 problems, 45 min), and virtual on-site (4 rounds: 2 coding, 1 system design, 1 behavioral/Googleyness). The entire process takes 4-6 weeks.

How many LeetCode problems should I solve for Google SDE-2?

Aim for 300-400 problems focusing on Google-tagged questions. Priority patterns: trees/graphs (BFS/DFS), dynamic programming, arrays/strings, and binary search. Quality over quantity. Understand patterns, not just solutions.

What is the difference between Google SDE-1 and SDE-2 interviews?

SDE-1 focuses on coding ability and basic problem solving. SDE-2 requires deeper system design, leadership signals, and the ability to handle ambiguous problems. System design rounds are more complex at SDE-2, and behavioral rounds expect project leadership examples.

How does Google evaluate candidates in the coding round?

Google evaluates across 4 dimensions: coding ability (correctness, efficiency), problem solving (approach design, optimization), communication (explaining thought process), and testing (edge cases, debugging). Each dimension contributes to your overall hiring signal.

What system design questions does Google ask at SDE-2?

Google SDE-2 system design questions include: design Google Search autocomplete, design YouTube, design Google Maps, design Gmail, design a distributed cache, design a rate limiter, and design a URL shortener. Focus on scalability, fault tolerance, and trade-offs.

Put it into practice

Try a mock interview with Alex

30-minute session. Real FAANG problems. Instant hiring signal. Free demo.

Try the Demo Free →