Meta OA – Meta Coding Assessment – 70mins codesignal OA – OA 代写 – 面试代面

Meta的OA由codesignal平台上进行,这个平台的题库是随机选择的,所以每个人的题目都不一样,需要70分钟内完成4道原创的中等难度算法题。

Meta Coding Assessment

Terms & Pledges

  1. I grant permission to share my results and all associated data with Meta.
  2. I will not copy, reproduce, distribute, or publicly display any of the information I come across during my session, including but not limited to the question descriptions copyrighted by CodeSignal.
  3. I will not consult or copy code from any external source, such as a website, book, or other person. This includes using generative AI tools.
  4. I will not write or execute code in an external editor or IDE.
  5. I will not write or execute code in the browser's developer console.

我们一起来看看其中2题吧:

Codewriting

You are monitoring the building density in a district of houses. The district is represented as a number line, where each house is located at some integer along the line. Imagine that some of the houses are gradually being destroyed over time.

You are given houses, an array of integers representing the initial locations of all houses in the district. You are also given queries, an array of integers representing the locations of the houses which will be destroyed, sorted by the order in which they are destroyed. After each house is destroyed, your task is to find the number of house segments remaining within the district. House segments are defined as one or more adjacent houses which do not have neighbors on either side.

Return an array of integers representing the number of house segments after each house from queries is destroyed.

NOTE: It's guaranteed that all houses are in distinct locations. The locations of all houses in queries are present in houses, and also distinct.

Example:

For houses = [1, 2, 3, 6, 7, 9] and queries = [6, 3, 7, 2, 9, 1],
the output should be solution(houses, queries) = [3, 3, 2, 2, 1, 0].

Codewriting

Imagine that you are implementing a simplified load balancer to route user requests to multiple servers. You are given an array of integers serversPowers, where serversPowers[i] (assume 0-based indexing) is an integer between 1 to 5 representing the capacity of the ith server—the maximum number of user requests that the server can handle during each cycle. You are also given an array of strings events, where events[i] can be one of the following:

  • "REQUEST" - user request
  • "FAIL <i>" - shut down the ith server, so it can no longer serve any requests

The load balancer handles user requests by routing them to the servers in cyclic order—each server should serve as many requests as it can based on its total capacity defined by serversPowers[i] before requests are routed to the next server (i.e., the i+1th server). After each cycle (i.e., when requests must be routed to serversPowers[0] again), the capacity of all non-failed servers is reset, but failed servers should remain shut down/inactive.

Notes:

  • The load balancer should bypass any servers which are failed/shut down when routing requests.
  • It is guaranteed that there is at least one functioning server at all times.

Meta使用codesignal平台使得极难逃课,但是找我们可以确保AC且安全。

我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *