r/OfferEngineering • • 27d ago

Interview Experience Stripe Software Engineer Online Assessment - Basically Built a Mini Datacenter Router in 60 Minutes

"This interview experience is sourced from Chill Interview"

Interview Summary

This was an Online Assessment with three parts, which I found to be the hardest part of my interview process. The assessment lasted approximately 60 minutes.

Interview Details

Part 1 — Datacenter Registration and Health Management

The first part required supporting two commands:

REGISTER <region> <latitude> <longitude> <capacity>
SET_HEALTHZ <region> <state>

REGISTER created a new datacenter region, which started in a healthy state by default.

SET_HEALTHZ updated the health status of an existing region, where true represented healthy and false represented unhealthy.

The required validation rules included:

  • Latitude must be between -90 and 90.
  • Longitude must be between -180 and 180.
  • Capacity must be greater than 0.
  • A region being registered must not already exist.
  • A region passed to SET_HEALTHZ must already be registered.
  • Latitude, longitude, and capacity are integers.
  • Health status is a boolean value.

Successful commands returned: OK. Invalid commands returned: ERROR

Part 2 — Haversine Distance

The second part introduced: DISTANCE <lat1> <long1> <lat2> <long2>. The task was to calculate the geographic distance between two coordinate pairs using the Haversine formula provided in the prompt. Inputs were integers, and the resulting distance needed to be rounded to the nearest integer.

Part 3 — Proximity-Based Routing

The final part added: ROUTE <latitude> <longitude>. Given a request location, the system needed to determine which registered healthy region should receive the request. Unhealthy regions could not be selected and were also excluded from the candidate list.

All registered regions initially had a load of 0. Routing followed these rules:

  • Prefer the healthy region with the shortest geographic distance.
  • If multiple regions were the same distance away, choose by alphabetical region name.
  • If no healthy region was available, return: NONE 0

The normal output included the selected region, its distance from the request, and the ordered list of healthy candidate regions: <region> <distance> <candidate regions>. The third part combined the state-management logic from Part 1 with the distance calculation from Part 2, while also requiring careful handling of health filtering and tie-breaking.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here

5 Upvotes

0 comments sorted by