Round 1 went pretty smoothly, and they told me about round 2 the next day — this round also wrapped up well. After a self-introduction, the interviewer moved into behavioral questions, mostly digging into my resume: briefly describe your internship project, what you learned from it, what was the most challenging project, how communication worked within the project team, what role you played, and so on. That took about 20 minutes, then coding.
Coding: from a set of videos, choose a subset such that for any two consecutive selected videos, the sum of their durations doesn't exceed the user's attention span, while maximizing total watch time.
My approach: dynamic programming, where dp[i][last] represents the maximum watch time considering the first i videos, with the index of the last selected video being last. For the transition, if you don't select the current video, dp[i][last] = dp[i-1][last]; if you do select it, you need the duration sum with the previous selected video to be within the attention span, giving dp[i][i] = dp[i-1][last] + duration[i]. Take the max over dp[n].
The follow-up asked how to handle it if repeat viewing of the same video is allowed — the state transition would need an extra branch for repeated selection, but that could create a loop, so you'd need to cap the number of repeats.
You only move on to the next round after passing the current one, and TikTok's process is pretty fast — they usually notify you the next day. A lot of the people I've been doing mock interviews with here have passed round 1 and round 2.
Discussion
Loading comments…