Uber SDE2 Technical Screening Seat Allocation Problem
Question Details
Question There is an Uber Shuttle with n seats arranged in a single row, labeled from 0 to n - 1. When a rider hops onto the shuttle, they instinctively look for the comfiest spot—the seat that puts t
Full Details
Question There is an Uber Shuttle with n seats arranged in a single row, labeled from 0 to n - 1. When a rider hops onto the shuttle, they instinctively look for the comfiest spot—the seat that puts them as far away as possible from the nearest fellow rider. If more than one seat offers the same level of personal space, W the rider politely chooses the seat with the lowest number. If the shuttle is completely empty, the first rider claims seat 0 (front row energy). * Design a class that simulates how riders choose and leave seats on the Uber Shuttle. * Implement the UberShuttle class: * UberShuttle(int n) - Initializes the shuttle with n seats. * int board() -
Returns the seat number where the next rider decides to sit. * void dropOFf(int p) - The rider sitting at seat p is dropping off from the shuttle It was a 1 hour round, where the interviewer was trying to understand my approach and how am I thinking about the problem.
About This Question
This is a reported interview question from a uber interview for a swe role reported in 2026.
It covers the following topics: System Design .