最近和朋友聊天,我们比较了我们的问题,发现 Stripe 的 oa 中只有 2 个可能的问题。这是一篇帮助澄清问题并提供帮助的帖子。
如果您想进入电面,您必须通过所有测试用例,load balancing问题有 17 个,transaction 问题有 12 个。问题难度不是太糟糕,但要注意时间(60 分钟对于这个问题来说太短了)。问题类似于模拟问题。他们给了你命令和规则的列表,你必须解析它们,然后使用他们给出的说明计算分数。描述非常清楚,如果你按照步骤操作,你会得到一个可行的解决方案。困难的部分可能是如何解析,所以你需要考虑一下。我使用列表来存储我读入的数据,但我的朋友使用类,他的解决方案看起来更干净,解决方案取决于你)。还要确保根据描述中的限制对输入进行错误检查,因为我缺少一些测试用例,经过头脑风暴后,我注意到我的代码中唯一缺少的东西就是检查输入。 (这是我得到的问题,但我的朋友得到了不同的问题。我听说他们有两个问题可供选择,所以你可能会得到不同的东西,但我相信在方法上会是相似的)
Load balance Problem-
You are implementing a load balancer for a notebook platform that runs multiple Jupyter servers. The goal is to decide which server (target) should handle each incoming websocket connection request, balancing load and applying various constraints. The function to implement is route_requests(numTargets, maxConnectiler index, object pinning still applies, and capacity limits are respected. During rerouting, the shutdown target is not considered. After rerouting, the target is immediately available again. For example, shutting down target 1 causes its connections to be rerouted to target 2, then new requests can again be assigned to target 1. This problem tests your ability to handle load balancing, disconnection, object pinning, server capacity, and rerouting after shutdowns in one system.
如果可以的话,请捐赠一些米!写这些帖子,我请了很多朋友的帮助。 我下个星期将发布关于电面。
|