Google SDE VO (8/5): Pure Behavioral + Car Rental Interval Scheduling — Passed
Google SDE VO two-round recap: round one was pure behavioral (biggest weakness, why you're leaving, five-year plan); round two was car rental interval scheduling using a sweep line plus an idle-car pool to find the minimum number of cars and an assignment.
Overview
I did mock interviews beforehand, which gave me a lot more confidence, and passed both rounds.
Round 1: Pure behavioral
- What's your biggest weakness?
- Why are you leaving your current role?
- Where do you see yourself in five years?
Round 2: Car rental assignment (interval scheduling)
The interviewer was relaxed and easy to talk to. After a quick resume walkthrough we moved to the problem.
Problem: given rental orders (pickup time, return time), find the minimum number of cars needed and assign a car to each order.
Approach: turn it into an interval-overlap problem.
- Use a sweep line over the intervals, and process returns before pickups at the same timestamp so a car returned at that moment can be reused right away.
- Keep an idle-car pool: returned cars go back into the pool; pickups take from the pool first and only add a new car when the pool is empty.
- After the sweep, the number of cars ever created is the minimum, and you also have the full assignment.
import heapq
def assign_cars(orders):
"""orders: [(start, end)]; returns (min number of cars, car id assigned to each order)"""
events = []
for i, (s, e) in enumerate(orders):
events.append((s, 1, i)) # 1 = pickup
events.append((e, 0, i)) # 0 = return; processed first at the same timestamp
events.sort()
idle, assigned, total = [], [None] * len(orders), 0
for _, kind, i in events:
if kind == 0:
heapq.heappush(idle, assigned[i])
else:
if idle:
assigned[i] = heapq.heappop(idle)
else:
assigned[i] = total
total += 1
return total, assigned
Time complexity O(n log n).
What the interviewer focused on: edge cases (ordering of pickups and returns at the same time) and coding ability.
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 Summer Intern | SDE Summer Internship | Real Google Interview QuestionsGoogle · 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›