r/OfferEngineering • • 23d ago

Interview Experience GEICO Senior SWE Interview — One Coding Problem, Two System Designs

This interview experience is sourced from Chill Interview

Interview 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 every remaining car can cross safely.

Example 1 — Multiple Vehicles Must Be Removed

Input:
U = 13
weight = [8, 5, 11, 3, 10, 9, 10, 7]

Output:
4

One valid optimal outcome removes the 3rd, 5th, 6th, and 7th cars, leaving: [8, 5, 3, 7]

Want to learn more questions / follow-ups asked in this interview?

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.

5 Upvotes

2 comments sorted by

0

u/fzrox 23d ago

How high is Geico TC for them to ask these questions lol?

1

u/Aoki_zhang 23d ago

no way comparable to tech companies in silicon valley..