Stripe OA Interview | International students from normal background can get the written test of a big company.

1,066 Views
No Comment

Two days ago, one of our trainees just completed the Stripe . Stripe's OA has always been known for its "tedious details", and this time is no exception: the questions are of medium difficulty, but there are as many as 17 cases, and many tricky scenarios are hidden. If you just rely on your intuition to brush up the questions, you will easily fall into a hole because of a detail.

Stripe OA

Background of trainees

This participant is studying for a master's degree at a mid-ranked university abroad, specializing in computer science. The school's reputation is not big, so the competition pressure is obviously bigger when looking for internships and full-time opportunities. I've been brushing up on problems in my spare time, but most of them are regular algorithmic problems, so I don't have much chance to practice OA like Stripe, which has business scenarios + a bunch of detailed constraints.

Previously, he had done several OA independently, but always fell into the hidden cases: either the log format was not aligned, or the boundary conditions were omitted. Seeing that some of his classmates got into the interview, he didn't want to miss the chance because of the details, so he approached us at Programhelp, hoping that with the help of OA online + voice assistance, he could pass the interview securely this time.

Stripe OA Question overview

This OA is one big question and will take 60 minutes. The context of the question is set in Stripe's Notebook platform (based on Jupyter), where you have to implement a "load balancer" to route requests to different servers because of the lagging of many users.

The topic is divided into five parts, from the most basic load balancing to the later introduction of disconnect / shutdown / max connections, and finally we need to implement a complete router.

Question 1

The notebook platform at Stripe is based on Jupyter, which does not perform well with a large number of users. To ensure a good experience for our developers To ensure a good experience for our developers , we run multiple Jupyter servers and direct different developers to different servers depending on load.

For this multi-part question, we will be writing a "load balancer" to direct requests based on current load. In particular, the requests are "websocket" requests which create a persistent connection to a Jupyter server, the connection itself. the requests are "websocket" requests which create a persistent connection to a Jupyter server, the connection itself representing a continuous load on the server. In particular, the requests are "websocket" requests which create a persistent connection to a Jupyter server, the connection itself representing a continuous load on the server. We won't actually be routing any requests over the network; instead, we will simply implement a function to handle requests that determines the target server.

Function parameters.

  • int numTargets: the number of Jupyter servers.
  • int maxConnectionsPerTarget: the maximum number of active connections allowed on a target server (used in Part 4).
  • string requests[n]: lines for each incoming request.

Returns.

  • string[n]: a log of each CONNECT request. Each log indicates the target using the schema connectionId,userId,targetIndex. Note that targetIndex is 1-based.

Then gradually increase the complexity:

  • Part 1: Basic load balancing (choose the server with the fewest current connections, and tie-break the one with the smallest index).
  • Part 2: Add DISCONNECT, which needs to be based on the connectionId Find the corresponding server and delete it.
  • Part 3: Add SHUTDOWN to exclude the shutdown server from the allocation.
  • Part 4: Introduction maxConnectionsPerTargetThe server that has reached its limit cannot be reallocated.
  • Part 5: A comprehensive look at ensuring that logs are only output for CONNECT and that other operations only maintain internal state.

My solution to the problem

At first I thought it was quite simple: it's just a minimum load selection problem, just use a few set/maps to maintain it. But later I realized that there are a lot of hidden cases, and I ended up writing more than 100 lines of code.

My whole idea is modularity:

  1. CONNECT
    • Iterate over all servers and find the one with the smallest number of connections.
    • tie-break is in ascending order by server index.
    • Keep a log of successful assignments:connId,userId,targetIndex.
  2. DISCONNECT
    • ground connectionId Find the previously assigned server.
    • Remove the mapping and reduce the load on the server.
  3. SHUTDOWN
    • Marks the server as closed and cannot be reassigned.
    • All connections already on the server should be cleaned up as well.
  4. maxConnectionsPerTarget
    • When selecting a target, determine if the load exceeds the upper limit.
    • If all servers are full, the request is rejected.
  5. log (computing)
    • Only CONNECT needs to output logs, the rest just update the internal state.

Frequently Asked Questions (FAQ)

Q1: Is Stripe OA difficult?
A: The overall difficulty of the algorithm is not high, mainly simulation and state maintenance. However, there are a lot of cases (more than ten + hidden cases), and the details are very strict, so the AC will be incomplete if there is a little negligence.

Q2: Why can't many people finish writing?
A: Mainly time allocation and boundary conditions, Stripe OA likes to come up with a bunch of "miscellaneous" requirements, such as tie-break, chain break logic, clean up connection after shutdown, maxConnections limit, etc. If not modularized and disassembled, it will be easy to mess up later. If not modularized and disassembled, it will be easy to mess up later.

Q3: What is OA No Trace Online?
A: The remote real-time assistance provided by Programhelp leaves no traces of the whole process and helps students to complete the code safely and smoothly in the OA environment, realizing 100% over test.

Q4:What kind of help does Programhelp provide in OA?
A:

  • Trace-free on-line: Ensure that all test cases are AC'd once;
  • Voice Assist: Instant nudging of key ideas when learners get stuck;
  • Logic Sorting: helps you write questions modularly and avoid detail errors.

Q5: Besides Stripe, can other big OA's help?
A: Yes, you can. Whether it's HackerRank, CodeSignal, Codility, or the big players' own platforms (Amazon, Meta, Google, Snowflake, etc.), we have real-world experience and can provide the same no-trace online + voice-assisted support.

Don't be envious of others, the big factory Offer is not as far away as you think.

Many students, like this student, can usually get most of the questions right, but when it comes to the real OA environment, the pressure is high, the time is tight, and there are a lot of detailed requirements, so it's easy to fail to pass all the test cases because of a small bug or a boundary condition that you didn't notice. This is the case with OA in big factories, even if there is only one case missing, it may be stuck directly.

If you're also preparing for a big factory OA and don't want to get stuck on a hidden case because of details.Programhelp provide OA no trace of on-line assistance + real-time voice assistance, can let you steadily through all the test cases, get the follow-up interview opportunities.

author avatar
jor jor
END
 0
Comment(No Comment)