cswork / libraryOpen practice workspace

Interview experiences · Stripe

Stripe Software Engineer Interview Experience — Three-Part OA on Data Center Routing

OAInterviewed 2026-08

Online Assessment Part 1: Data Center Registration and Health State Management Need to implement the following two commands: REGISTER <region> <latitude> <longitude> <capacity>: registers a data center, with a default health state of healthy. SET_HEALTHZ <region> <state>: sets the health state of a given data center (true for healthy, false for unhealthy). Validation rules: Latitude must be in th…

Online Assessment

Part 1: Data Center Registration and Health State Management
Need to implement the following two commands:

  1. REGISTER <region> <latitude> <longitude> <capacity>: registers a data center, with a default health state of healthy.
  2. SET_HEALTHZ <region> <state>: sets the health state of a given data center (true for healthy, false for unhealthy).

Validation rules:

  1. Latitude must be in the range [-90, 90]
  2. Longitude must be in the range [-180, 180]
  3. Capacity must be greater than 0
  4. For REGISTER, the region must not already be registered; for SET_HEALTHZ, the region must already be registered
  5. Latitude, longitude, and capacity are all integers; healthz is a boolean
  6. Return OK on success, ERROR on failure

Part 2: Computing the Haversine Distance
Implement the command: DISTANCE <lat1> <long1> <lat2> <long2>, which computes the distance between two points.
Rules:

  1. Implement it using the Haversine formula given in the problem statement
  2. Inputs are integers, and the output must be rounded to an integer

Part 3: Proximity-Based Routing
Implement the command: ROUTE <latitude> <longitude>, which computes and routes to the nearest healthy region based on the given coordinates.
Rules:

  1. If a region is unhealthy, it cannot be a routing target and cannot be included in the candidate list
  2. All registered regions start with a load of 0
  3. Routing target selection: prefer the nearest healthy region; if distances are tied, pick by alphabetical order
  4. If there is no available healthy region, output NONE 0
  5. Output format: <selected region> <distance to that region> <candidate healthy region list (sorted per the rules, space-separated)>

Comments

Nothing here yet.

Join in on CSWork →