Sharing of the TikTok OA CodeSignal four-question interview | Successfully passed, helping you pass OA smoothly

27 Views
No Comment

Attended on January 25th TikTok OA, the overall experience is not bad, the questions are CodeSignal’s classic four-question mode. The difficulty level is medium to low, and the question types are relatively conventional. As long as you pass some CodeSignal or common algorithm questions, you won't be too panicked. Now I would like to share the question types and solution ideas of this TikTok OA CodeSignal as a reference for students who are preparing for TikTok OA / ByteDance OA in the future. I hope it will be helpful to everyone in answering questions and preparing for the exam.

TikTok OA Interview Overview

  • Platform:CodeSignal
  • Number of questions: 4 questions
  • Question type: Simulation / Array processing / Grid placement / Graph traversal
  • Overall difficulty:Basic
  • Time pressure: Not too big, the ideas are clear and I can basically finish writing.

TikTok OA real question sharing

Question 1: Score Statistics and Historical High Scores

The question is given an initial score of 1500, and a series of operation records of score changes. It is necessary to calculate the final score while performing these operations in sequence, and at the same time find the highest score that occurred in the entire process.

Problem-solving ideas
This is a typical simulation question. Use a variable to record the current score, initially 1500, and another variable to record the highest score in history. When traversing the operation record, the current score is updated at each step, and then the maximum value is updated with the current score. After the traversal is completed, the final score and the highest score can be returned.

Question 2: Assign numbers to two arrays according to rules

The question gives two initial numbers num0 and num1, which are put into two different arrays respectively. Then new numbers num[i] will be given in turn, which need to be added to one of the arrays according to the rules. The rule is to first compare the number of elements greater than num[i] in the two arrays, and put the number into the array with the smaller number; if the number is the same, put the number into the array with the shorter current length. Finally, the result of concatenating the two arrays is returned.

Problem-solving ideas
Just follow the question rules to simulate. After initializing the two arrays, process the new numbers one by one, count the number of elements in the two arrays that are greater than the current number, and then decide which array to add based on the comparison results. Since the data scale is not large, just traverse the statistics directly, and the logic is clear and error-prone.

Question 3: Place graphics in order in the grid

Given an n×m grid, and five shapes of fixed shapes (A, B, C, D, E). It is required to place these graphics in the grid in order of row priority and column priority, and determine whether all graphics can be placed in the grid without overlap.

Problem-solving ideas
This question is essentially a two-dimensional grid simulation. You can first use a mapping table to save the coordinates occupied by each shape relative to the upper left corner (0,0). Then traverse the grid row-first and column-first, and try to use each position as the upper left corner of the current graphic to check whether it crosses the boundary or conflicts with the placed graphic. If it can be placed, mark the grid and continue to place a graphic; if the entire grid has been tried and the current graphic cannot be placed, a failure will be returned directly.

Question 4: Traversal order of chain structure

Given a chain structure, essentially an undirected graph where each node has at most two neighbors. It is necessary to start from the correct starting point and output the node sequence traversing the complete chain.

Problem-solving ideas
You can first build the graph into an adjacency list and count the degree of each node. Since it is a chain structure, the starting point must be a node with degree 1. Just start traversing from any such node. During the traversal process, the last visited node is recorded, the previous node is skipped among the neighbors of the current node, and the remaining node is the next node to be visited. Keep moving forward until all nodes have been visited.

Some experience sharing about OA preparation

If you don’t feel confident when preparing for TikTok OA / CodeSignal or other major company written exams, it’s actually normal. OA tests more familiarity with common question types and implementation stability, rather than improvising on the spot. Programhelp is available long-term OA ghostwriting , interview assistance, and VO assistance, have helped many students clarify common test routines, improve their passing rate, and successfully enter the next round. If you are also in the preparation stage, please contact us.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0