HackTheRounds Interview Experiences

TikTok New Grad SDE Interview Experience (2024) - 3-Round VO, Tree Centroid, Nested Iterator, Partition DP, Rejected

TikTok SDE NG three round loop: two coding rounds on single modification sort, tree centroid rerooting, nested iterator, counting array anagram groups, plus HM

By Anonymous ยท 2026-04-09

Background

Writeup from a TikTok new grad SWE loop I went through in July 2024. I did not get the offer. Writing it because the pattern has held steady into 2026 based on friends still interviewing, and because I wish someone had warned me that TikTok SDE NG is less about the coding rounds and more about the hiring manager round at the end. Background: final-year CS masters at a North American school, one big-tech internship on my resume.

Timeline

Round 1: Coding (60 min, 2 problems)

The interviewer was an IC. Two minutes of niceties, then straight into problems. Each round allots two problems in 60 minutes, which is a tight 25 minutes per problem plus a few minutes of buffer, and the round is graded on both correctness and communication.

Coding 1: One-Modification Sort Check

Problem: Given an integer array, return true if the array can be made non-decreasing by modifying at most one element.

Single-pass with two subtle cases at the first out-of-order index. Walk the array, find the first i with nums[i] < nums[i-1] , and consider two fixes: lower nums[i-1] to nums[i] if nums[i] = nums[i-2] , else raise nums[i] to nums[i-1] . Either fix must keep the rest of the array valid.

I implemented the single-pass version in about 12 minutes. The interviewer asked why I was tracking the two cases separately rather than recursing. My answer was that constant-extra-state stays O(n) and O(1) .

Practice it: This question is coming soon to HackTheRounds. Coding 2: Tree Node with Smallest Average Distance

Pr

This question is coming soon to HackTheRounds. oblem: Given an undirected tree with n nodes where each edge has unit distance, find the node that minimizes the average distance to all other nodes. Expected runtime O(n) .

This is the canonical tree centroid via rerooting DP. First DFS computes, for every node, the sum of distances inside its subtree and the subtree size. Second DFS re-roots, propagating the distance sum across each edge using the identity that the sum changes by (total nodes - 2 child subtree size) when you shift the root.

I had seen this pattern before but not recently. I got the first DFS quickly, then burned eight minutes rederiving the rerooting formula on the whiteboard. I finished with maybe four minutes to spare and uglier code than I wanted.

Practice it: This question is coming soon to HackTheRounds. Round 2: Coding (60 min, 2 problems)

The interviewer was a S

This question is coming soon to HackTheRounds. eattle-based engineer who opened with two minutes of "tell me how you optimized a slow database query recently" and then went straight into problems. The pace was faster than Round 1.

Coding 1: Nested List Iterator

Problem: Given a nested list of integers where each element is either an integer or another nested list of the same type, implement an iterator that returns all integers in flattened depth-first order. Support next() and hasNext() .

Classic stack-based lazy flatten. Push top-level elements onto a stack in reverse. On hasNext() , peek: if the top is a list, pop and push its elements in reverse, then retry. If it is an integer, return true.

The interviewer pushed on amortized complexity: each element is pushed and popped once across the iterator's lifetime, so total work is linear distributed across next() calls.

Practice it: This question is coming soon to HackTheRounds. Coding 2: Group Anagrams With Better Than Sort

Problem:

This question is coming soon to HackTheRounds. Given an array of strings, group anagrams together. Standard solution sorts each string and uses that as a dictionary key, which is O(n k log k) where k is the max string length. The interviewer required a strictly better solution.

The answer is a counting tuple. For each string, build a length-26 char count array, freeze it to a tuple, and use that as the dictionary key. Per-string work drops from O(k log k) to O(k) .

The interviewer floated "could you use the product of primes as the key?" which explodes on long strings via 64-bit overflow. I mentioned the overflow aloud, she agreed counting arrays are safer, and I moved on. Closing comment was "your counting-array approach is more suitable for production than sort-based keying," which felt like a positive signal.

Practice it: This question is coming soon to HackTheRounds. Round 3: Hiring Manager (60 min)

This is the round I lost on, an

This question is coming soon to HackTheRounds. d I did not realize it in the moment. The HM opened with a fifteen-minute self-introduction, dug into two of my resume projects for about twenty minutes each with a heavy focus on infrastructure choices and team dynamics, and closed with a single hard DP coding problem.

Behavioral: Project Deep Dives

The three questions the HM kept circling back to:

  1. What was the most technically challenging part of the project, and what specifically did you own?
  2. When you hit a disagreement with a teammate, how did you resolve it?
  3. Tell me about a time an emergency happened and you had to respond under pressure.

For question 1, I described a latency regression. The follow-up "what was your instrumentation strategy before you started optimizing?" caught me off guard; I admitted I had started optimizing without baseline metrics and had to back up. A minor red flag I served up voluntarily.

For question 2, I used a database-choice disagreement. The follow-up "did you end up being right?" is a trap. I said the team went with the other person's choice and it worked out fine, then leaned too enthusiastically into "I was wrong, they were right."

Coding: Hard DP

The coding problem at the end was a partition-style DP: given an array of integers and an integer k , partition the array into k non-empty contiguous subarrays to minimize the maximum subarray sum. The state is dp[i][j] = minimum possible maximum when partitioning the first i elements into j subarrays. Transition: dp[i][j] = min over split points s of max(dp[s][j-1], sum(s..i)) .

I had the recurrence written in about four minutes but implemented a bug in the prefix-sum computation that caused my output to be off by one in my manual trace. I caught it with two minutes left on the clock and fixed it, but the HM had already seen the bug.

Practice it: This question is coming soon to HackTheRounds. Result

Rejection email five business days later. The recruiter's note

This question is coming soon to HackTheRounds. said the Round 3 HM had been the soft decline. No specific feedback was offered, which is standard. Looking back, I think two things hurt me in Round 3: the accidentally-self-served red flag on instrumentation in the behavioral, and the visible DP bug at the end. Either alone would have been survivable. Both together gave the HM enough to lean "no."

Tips

  1. Treat Rounds 1 and 2 as one block of four coding problems. Both rounds grade on the same rubric: correctness, communication, edge-case coverage. Signals are additive, so bring full energy to all four.
  2. The HM round is the highest-leverage round in this loop. Most new grads coast in treating it as "just behavioral." The HM has veto power, asks a hard coding problem, and will follow up on every resume project. Prep for it harder than the coding rounds, not less.
  3. Prep measurement-first project stories. TikTok's infra-flavored HMs press on "how did you know this was the actual problem" before accepting any optimization story. If your narrative does not lead with baseline instrumentation, rebuild it.
  4. Commit to your approach within five minutes. The 25-minute-per-problem pace punishes indecision. Say the approach out loud within five minutes even if unsure. You can pivot later, but you cannot recover from fifteen minutes in your head.
  5. Do not volunteer weak moments in behavioral answers. I served up the "I optimized without measuring" detail thinking it showed growth. The HM recorded it as a concern. Honest does not have to be gift-wrapped.
  6. Practice partition DP cold. The Round 3 problem was partition-max-minimized, a genre that shows up in 2026 TikTok loops repeatedly. If you cannot derive the `dp[i][j]` recurrence in three minutes, drill it.

If this loop lands on your calendar, budget the HM round at least as much attention as the coding rounds. That is the piece I would change.