Just finished TikTok SDE OA, the overall experience can be summarized in one sentence: friendly difficulty + extremely fast pace. Although this is a new question, the overall examination still focuses on basic algorithms and code implementation, and there are no particularly biased thinking questions. As long as you answer enough questions and feel online, you can basically write the questions after reading them.
It took me about 18 minutes from opening the question to ACing all four questions. I received a VO invitation shortly after submitting, and the process progressed very quickly. A reference for students who are preparing for TT or waiting for OA.
TikTok SDE OA-question1
T1 idea: We only need to scan from front to back, normalize each character to lowercase (or uppercase), and then compare whether the two adjacent normalized values are equal. If not equal, add 1. The complexity is O(n), which meets the requirements of the question.
TikTok SDE OA-question2
T2 idea: We convert all times (departure time and current time) into minutes starting from 00:00, and then binary search for the last position that is less than the current time (because of order). Because the array is already sorted, we directly use the dichotomy method to find the first subscript that is greater than or equal to the current time. The one in front of it is the last departure. If this subscript is 0, it means that all departure times are ≥ the current time, and -1 is returned. Otherwise, subtract that departure minute from the current minute and that's the answer. Complexity O(log n) or O(n) linear scan is also possible, and the question gives very loose restrictions.
TikTok SDE OA-question3
T3 idea: Just follow the command to simulate, pay attention to a few points: the row and column indexes are taken directly from the input, without processing boundaries. Rotate 90 degrees: new matrix [i][j] = original matrix [n-1-j][i]. It is troublesome to rotate in place. Just open a new matrix and assign values. Reverse row/column: double pointer swap. Complexity O(number of commands × matrix size) is sufficient.
TikTok SDE OA-question4
T4 idea: Maintain the color array and the current number of identical adjacent pairs. Each time the coordinate i is painted: if the new color = the old color, remain unchanged, otherwise: first subtract the old same contribution of i and i-1, i and i+1, add the new same contribution, update the color, and record the current logarithm. Complexity O (number of queries)
Want to pass OA and VO more reliably?
We have long-term supply to major North American manufacturers Interview assistance With practical support, it has helped a large number of students successfully pass the OA and technical aspects of TikTok, Amazon, Meta, Google and other companies. Preparation in advance is often more important than remediation afterwards. Opportunities are never reserved for those who are best at answering questions, but for those who are most prepared.