Software Engineer • Senior-Level
Software Engineer • Senior-Level
High QualityInterview Summary
I interviewed with GEICO and encountered one algorithmic coding problem and two system design questions. The coding task involved minimizing vehicle removals under a bridge weight restriction, while the system design topics covered a real-time EV charging reservation platform and a shared experiment assignment API for feature rollouts.
Interview Details
Coding — Minimum Vehicle Removals for a Weight-Limited Bridge
I was asked to solve an optimization problem involving cars crossing a narrow, one-way bridge. The bridge has a maximum weight capacity of U, and N cars are waiting in a fixed order. Each car's weight is represented by weight[i], with the first element corresponding to the first vehicle in line.
The bridge operates under the following conditions:
- No more than two cars can occupy the bridge simultaneously.
- Initially, the first two cars enter. When the first car exits, the third enters; when the second exits, the fourth enters, and so on.
- Vehicles must leave the bridge in the same order they entered.
- The combined weight of vehicles currently on the bridge must never exceed
U.
To prevent overloading, certain drivers may be instructed to leave the queue permanently. When a driver leaves, all vehicles behind that driver move forward, preserving their relative order. My task was to implement solution(int U, int[] weight), returning the minimum number of drivers who must turn back so that
Unlock Full Details
Create a free account to unlock this interview experience report.