AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
There is a car with a given capacity of empty seats available. The car only drives east. You are given the integer `capacity` and an array `trips` where `trips[i] = [numPassengersᵢ, fromᵢ, toᵢ]` indicates that the `i`-th trip has `numPassengersᵢ` passengers and the locations to pick them up and drop them off. The locations are given as the number of kilometers due east from the car's initial location. Return `true` if and only if it is possible to pick up and drop off all passengers for all the given trips.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.