CS-OA cs-vo Faang

[TikTok] AMS Grad Assessment 2024 Start – 29 Jan to 2 Feb (Generic)

本周的tiktok又开放啦,tiktok的秋招到现在一直保持的高强度的OA 发放。This week's TikTok has opened up again, and TikTok's autumn recruitment has maintained a high intensity of OA distribution.

给不熟悉tiktok OA的朋友们科普一下,tiktok的OA每两周开放一次,当第一次OA未通过时可以再次申请两周后的OA,一般是周一开始做,周五截止。潜规则是周五做OA的人一般不会通过,而越早完成通过率越高。For those who are not familiar with TikTok's OA, it opens every two weeks. When the first OA is not passed, you can reapply for the OA after two weeks, which is generally started on Monday and ends on Friday. The unwritten rule is that people who do the OA on Friday generally do not pass, and the earlier you complete it, the higher the pass rate.

看看本周有什么真题吧,Let’s see what the real questions are this week

Q1. Network Sockets

Consider two pseudo-code snippets illustrating file transfer mechanisms between a client and a server.

Pseudo-code 1: Client:

file = openFile("localFile.txt") chunk = readFileChunk(file) while (chunk is not empty) transmitData(chunk) chunk = readFileChunk(file) endWhile closeFile(file)


file = createFile("receivedFile.txt") while (dataAvailable()) chunk = receiveData() writeFileChunk(file, chunk) endWhile closeFile(file)

Pseudo code 2: Client:

file = openFile("localFile.txt") data = readEntireFile(file) transmitData(data) closeFile(file)


data = receiveDataUntilComplete() file = createFile("receivedFileComplete.txt") writeEntireFile(file, data) closeFile(file)

Which of the following statement(s) are true?

  • Pseudo-code 1 demonstrates a chunked data transfer mechanism, suggesting that the data is transferred in parts, which might be beneficial in case of large files or unstable network connections.
  • Pseudo-code 2 illustrates a file transfer mechanism where the client reads the entire file into memory before transmission, which might be more efficient for smaller files but can be problematic for very large files.
  • Pseudo-code 1 relies on a connectionless data transfer model, given that there's no explicit connection establishment or termination.
  • Pseudo-code 2 suggests that the server has a mechanism to detect when the data transmission is complete, indicating the need for some underlying protocol or metadata to signal the end of transmission.

这是一道很简单的选择题,如果想获取答案,可以联系我们。This is a very simple multiple-choice question. If you want to get the answer, you can contact us.

2. Congestion Control Algorithms

Various control algorithms are used to address network congestion during short peaks of data transmission. Which pair of pseudo-code snippets correctly represent the "Slow Start" and "Additive Increase Multiplicative Decrease (AIMD)" algorithms, respectively?

3. Segment Queries

There are 4 arrays of data. The arrays cat[n] and cnt[n] are each of n integers, and cat[i] relates to cnt[i]. These represent a category and count at each index. There are also two arrays of integers that represent q queries. The arrays l[q] and r[q] contain 1-based indices for the left and right ends of subarrays to consider in cat and cnt.

Process the queries in order. Create an array of q values where answer[i] relates to query i.

For each query i:

  • Within the subarrays in cat and cnt, determine the maximum cnt for each cat.
  • Store the sum of these maxima as the answer to the query.
  • Clear the cnt values in the range.

After all queries are processed, return the answer array.

4. Longest OR

There is an array of n integers, arr, and two integers mn and mx.

For each of arr's subarrays, find the binary value of the bitwise OR of all elements. If the number of 1 bits is between mn and mx, inclusive, it is a good subarray.

Determine the length of the longest good subarray.

Note: A subarray is any segment of adjacent elements in an array. For example, if arr = [1, 2, 3], [1, 2] is a subarray but [1, 3] is not.


It is worth noting that these are some questions, and the question bank for the fifth question is random. If you need a complete question bank or assistance, please contact us.

如果害怕自己解决不了OA,请扫码联系我 or telegram

If you're afraid that you can't solve the OA on your own, please scan the code to contact me or telegram

One thought on “[TikTok] AMS Grad Assessment 2024 Start – 29 Jan to 2 Feb (Generic)

Leave a Reply

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