← Google Interview Insights

Google·Software Engineer·Onsite - Coding / Algorithms·Senior

SeniorPrefer not to say
Apr 2026

Summary

Google SWE coding round where they threw a multi-elevator controller problem at me. More of a systems-meets-algorithms hybrid than a pure leetcode grind, which I wasn't fully expecting.

Questions Asked (1)

Q1

Design and implement a multi-elevator controller that receives ride requests (each with a timestamp, pickup floor, and destination floor) and dispatches each request to one of E elevators. Output the assigned elevator ID for each request in input order.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This one took me a minute to even figure out what they wanted.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (e.g., real-time vs. batch, optimization goals, elevator state). Then propose a dispatch algorithm (e.g., greedy with cost function) and outline data structures for elevators and requests. Finally, discuss trade-offs and potential improvements like look-ahead or machine learning.

Pro tip: Emphasize that the algorithm must be efficient for online requests and scalable to many elevators; consider using a priority queue or min-heap for elevator selection. Also, mention that you would test with edge cases like simultaneous requests and full elevators.

1. Clarify Requirements

Ask about input format, elevator capabilities (capacity, speed), optimization criteria (wait time, energy), and whether requests are processed online or in batch.

2. Define Elevator State and Cost Function

Model each elevator's state (current floor, direction, load, destination queue) and define a cost function to estimate the time or distance to serve a request.

3. Design Dispatch Algorithm

Choose an algorithm (e.g., greedy, round-robin, or more sophisticated like LOOK) to assign each request to the elevator with minimal cost, ensuring real-time efficiency.

4. Implement and Optimize

Outline data structures (e.g., priority queues for requests and elevator queues) and discuss time/space complexity, potential optimizations, and handling of dynamic updates.

5. Discuss Trade-offs and Extensions

Compare your approach with alternatives (e.g., centralized vs. decentralized, simple vs. predictive) and mention possible improvements like learning-based dispatch or handling of emergencies.

Key Points to Mention

  • Real-time vs. batch processing and online algorithm design
  • Cost function design considering wait time, travel time, and elevator load
  • Data structures: priority queues, heaps, or balanced trees for efficient selection
  • Handling of multiple requests and elevator capacity constraints
  • Trade-offs between optimality and computational complexity
  • Scalability to many elevators and requests, and potential use of distributed control

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.