1p3a Question · Sep 2025

Stripe 2025-2026 University Recruiting HackerRank Internship Online Test

SWE OA Intern Easy
2 upvotes 4 replies

Question Details

This OA (Online Assessment) question is a multi-stage load balancing simulation question. You need to implement a function route_requests to handle a series of requests and determine the route based

Full Details

This OA (Online Assessment) question is a multi-stage load balancing simulation question. You need to implement a function route_requests to handle a series of requests and determine the route based on rules. (Camera is required.) The following content requires a score higher than 120. You can already view it. public static List<String> route_request( int numTargets, // Number of target Jupyter servers int maxConnectionsPerTarget, // Maximum number of connections allowed per server List<String> requests // A series of requestsPart 1: Basic Load Balancing (test cases 1–4)` Assign each CONNECT request to the server with the lowest load; if there are ties, select the server with the smaller index.

Output the corresponding (connectionId, userId, targetIndex). Part 2: Handling Disconnections (test cases 5–8)Add a DISCONNECT request. When a connection is disconnected, the active connection count of that server needs to be updated. ``` DISCONNECT produces no output, only maintains internal state. Part 3: Routing by objectId (test cases 9–11) If requests contain the same objectId, they must be forced to be routed to the same server (sticky routing), even if the load is unbalanced. If the last connection for that objectId drops, that objectId is released and can be reassigned later. Part 4: Maximum Connection Limit (test cases 12–...) The number of connections per server cannot exceed maxConnectionsPerTarget. If the server selected for load balancing is full, it needs to continue searching for other available servers. Part 5: I'm too inexperienced to get here. It's the last part... Please give me some points, thank you!!!

About This Question

This is a reported interview question from a stripe interview for a swe role (intern level) during the oa round reported in 2025.

It covers the following topics: Strings .

Difficulty rating: Easy

Topics