Google Summer Intern | SDE Summer Internship | Real Google Interview Questions
Real questions from Google's SDE summer internship VO: longest substring without repeating characters (sliding window + hash map, with a follow-up returning the substring itself) and binary tree right side view (BFS / DFS, with a follow-up on each level's outermost nodes), plus the process and Python reference code.
Process
Most people applying for Google internships this year went through a long wait, but once your resume gets picked up, things move fast: many candidates finished the OA, scheduling and both VO rounds within a week. Cold applications and referrals didn't differ much; referrals were slightly better.
Format
- Two technical interviews, usually on the same day, 45 minutes each with a short break.
- The first 5 minutes are small talk and introductions, then coding.
- Google's editor is a plain text box that can't run code, so you need to dry run your code yourself, explain how it executes, and analyze time and space complexity.
- If there's time left, the interviewer asks a follow-up or two, usually about extensibility and optimization.
Here's a real set of questions.
Q1: Length of the longest substring without repeating characters
Problem
Given a string, find the length of the longest substring without repeating characters. For example "abcabcbb" returns 3, for the substring "abc".
Approach
- Brute force: try every starting point, extend right and check for repeats with a set — O(n²).
- Sliding window + hash map: two pointers
leftandrightmark the window, and a hash map records each character's most recent position. Whenrighthits a repeat, moveleftjust past that character's previous position so the window has no duplicates. UpdatemaxLen = max(maxLen, right - left + 1)at each step. Time O(n).
Follow-up: return the longest substring itself, not just its length. Just record the window's start whenever you update the maximum.
def longest_unique_substring(s):
"""Returns the longest substring without repeating characters; its length is len(result)"""
last = {} # char -> most recent index
left = best_start = best_len = 0
for right, ch in enumerate(s):
if ch in last and last[ch] >= left:
left = last[ch] + 1 # jump past the previous occurrence
last[ch] = right
if right - left + 1 > best_len:
best_start, best_len = left, right - left + 1
return s[best_start:best_start + best_len]
Note the
last[ch] >= leftcheck: if the character's previous position is already outside the window, the left pointer must not move backwards.
Q2: Binary tree right side view
Problem
Return the nodes visible when looking at a binary tree from the right side. For example:
1
/ \
2 3
\ \
5 4
returns [1, 3, 4].
Approach
- BFS level order: scan level by level with a queue and record the last node of each level.
- DFS: recurse right subtree first; the first time you reach a new depth, add that node — which is naturally the rightmost one.
Both are O(n) time; space depends on the tree's height (for BFS, the width of the widest level).
from collections import deque
def right_view_bfs(root):
res, q = [], deque([root] if root else [])
while q:
for i in range(len(q)):
node = q.popleft()
if i == 0:
res.append(node.val) # right child is queued first, so the first node is the rightmost
for child in (node.right, node.left):
if child:
q.append(child)
return res
def right_view_dfs(root):
res = []
def dfs(node, depth):
if not node:
return
if depth == len(res): # first time we reach this level
res.append(node.val)
dfs(node.right, depth + 1)
dfs(node.left, depth + 1)
dfs(root, 0)
return res
Follow-up: print each level's outermost nodes. Interpreting this as "the leftmost and rightmost node of each level", record the first and last node of each level during the level-order traversal:
def level_extremes(root):
"""[leftmost, rightmost] per level; a level with a single node returns [that node]"""
res, q = [], deque([root] if root else [])
while q:
level = [n.val for n in q]
res.append([level[0], level[-1]] if len(level) > 1 else level)
for _ in range(len(q)):
node = q.popleft()
for child in (node.left, node.right):
if child:
q.append(child)
return res
The last five minutes were Q&A.
Summary
Google's intern interviews are pure algorithms — no resume deep dive and no behavioral — focusing on:
- Clear logic
- Rigorous edge cases
- Complexity optimization
Interviewers rarely use an exact known problem; they often add a twist and care more about whether you can generalize and explain your reasoning clearly. With no way to run code, build the habit of dry-running by hand while you practice.
Found this helpful? Let's talk.
Happy to swap interview notes, do mock interviews, or share referral info.

Scan to add me on WeChat
More Google notes
View all ›- Google 2027 SWE Intern VO, Fresh Recap: HashMap + Sliding Window and Graph BFSGoogle · 2026-10-04›
- Google 2027 SDE Intern (Passed): Undirected Unweighted Graph — Fewest Edges for Alice and Bob to Reach the DestinationGoogle · 2026-10-02›
- Google SDE 2027 Intern: Subarray Sum Modulo Equals k + Three Follow-upsGoogle · 2026-10-02›
- Google 2027 Summer Intern VO, Two Pure Coding Rounds: Islands in a Tree + Subarray Sum ModuloGoogle · 2026-10-02›