HackTheRounds Interview Experiences
TikTok New Grad OA Interview Experience (2024) - Two Coding Problems, Rejected
TikTok new grad OA with two timed coding problems covering arrays and dynamic programming. Walked through strategy, mistakes, and why the OA outcome was rejecti
By Anonymous ยท 2024-07-15
Background
I applied to TikTok as a new grad SWE in the summer of 2024. I had just wrapped a backend internship at a mid-sized fintech and TikTok was one of the companies still actively hiring new grads after the bulk of the cycle had closed, so I pushed my resume through a referral from a friend in the Seattle office. The OA invite landed in my inbox three days later with a one-week window to complete it. I sat down on a Sunday afternoon thinking I was prepared. I was not. This is the honest write-up of the OA that ended my TikTok process before it really started.
Timeline
- Late June 2024: Referral submitted through a former coworker
- Early July 2024: OA invitation arrives with 7-day window
- July 14, 2024: Took the OA
- July 22, 2024: Rejection email, no feedback
Total: about 4 weeks from application to rejection.
Online Assessment (90 min)
TikTok sends a standard OA with two coding problems and a 90-minute clock. No proctor questions, no webcam drama, just a browser editor and a countdown. The two problems I got leaned on array reasoning and a DP-flavored tree problem. Both were solvable in isolation. Neither was solvable by me on that day in the time I had left after my first attempt blew up.
Problem 1: Almost Sorted Array
Problem: Given an integer array, decide whether it can be made non-decreasing by modifying at most one element. Return true if it is already sorted or if a single change to any element makes it sorted, false otherwise.
The intended approach is a single pass. Scan left to right and find the first index i where nums[i] < nums[i-1] . That is the only violation you are allowed. From there you have to decide whether you can fix it by bumping nums[i-1] down or by bumping nums[i] up, and then confirm the rest of the array stays sorted after that surgical edit. There is a small case split: if i sits at the last position, you can always fix it. Otherwise you compare nums[i+1] against nums[i-1] to decide which side to adjust.
I got the first violation right but botched the case split. I kept treating it like a two-pointer problem and added a second loop to sweep back from i-2, which looked right on paper but failed on arrays like [3, 4, 2, 3] where a single modification is not enough. I burned about 35 minutes getting a version that passed 6 of the 10 test cases before I realized the approach itself was the issue. By then I was flustered and moved on without cleaning it up.
Time complexity should have been O(n), space O(1). Mine was technically O(n) but with a correctness gap I never closed.
was the closest thing I had drilled beforehand and I should have done more in this array-with-constraints family.
Problem 2: Closest Node in a Tree
Problem: Given a tree, find the node with the smallest average distance to all other nodes, where each edge has weight 1. Required time complexity O(n).
This is a classic rerooting DP problem. The clean approach is two DFS passes: one to compute, for each node, the subtree sum of distances to all descendants plus the subtree size, and a second pass that rewrites the answer for each node using its parent's answer in O(1). The total is O(n). I knew the shape of this problem but had never actually implemented rerooting cold, only seen it in video explanations.
I tried to brute force it. For each node I ran a BFS to sum distances to every other node, giving an O(n^2) solution that I knew would TLE on the larger test cases. I figured partial credit was better than nothing with 25 minutes left. It passed the small cases and timed out on the rest, which is exactly what I deserved. The fix I should have written is a post-order DFS to accumulate subtree distances and a pre-order DFS to reroot, but I could not get the rerooting transition right under pressure.
and are the kinds of primitives I had spent most of my prep time on. Tree DP and rerooting were in my plan for "next week" and the OA arrived a week earlier than I expected.
Result
Rejection email arrived about a week after the OA with the standard "we have decided to move forward with other candidates" phrasing. No score breakdown, no interviewer notes. That is TikTok's normal flow for the OA stage. I knew the result the moment I hit submit because I had watched the test case counter refuse to tick past six on problem one and zero on the hard cases of problem two.
A friend on the TikTok ads infra team confirmed later that the bar for the new grad OA is roughly "fully pass both problems" for a clean move to VO, and partial credit rarely gets you past. That matches what I have heard from other people who have gone through the loop.
Tips
- Treat the array-modification family as its own pattern. "Almost sorted," "one-edit distance," "can you fix this with one operation" are all the same beast and they all reward careful case analysis, not clever two-pointer tricks. Write out the cases on paper before touching the keyboard.
- Rerooting DP is a must-know for TikTok. Tree problems with an O(n) required complexity almost always mean rerooting or tree DP. If you cannot derive the transition cold, do not go into the OA without practicing at least three of them from scratch.
- Budget the 90 minutes before you start. I walked in with no plan and spent 35 minutes on a doomed approach. The right move is 35-40 minutes per problem, a hard reset if the test counter stalls, and accepting that a clean 1-of-2 beats a messy both.
- Do not rely on partial credit. TikTok's OA stage weights full passes heavily. If you are at 60 percent on both problems, that is usually a rejection. Aim for 100 on one before touching the other if you have to choose.
- The 7-day window is a trap. Take the OA early in the window so you can reschedule or at least not sit down tired on the last day. I took mine on a Sunday after a long week and my head was not in it.
- Prep rerooting, prefix sums, monotonic stacks, and interval DP. These four show up in TikTok OAs over and over. Everything else is secondary.
If you are prepping for TikTok right now, the bar is real but the patterns are knowable. Pick your weak families, drill them cold, and give yourself the time. Good luck.