You can refer to the previous round of interview experience,This round also ended well. The interviewer was Chinese, and after a brief self-introduction, we moved into behavioral questions. They mainly drilled into my résumé: briefly describe your internship projects, what you learned from them, what the most challenging project was, how team communication was handled within the project, what role you played, etc. I talked about these for around 20 minutes. After that, we moved on to the coding part.
Coding:
Select a subset of videos such that the sum of the durations of any two consecutively selected videos does not exceed the user’s attention span, and maximize the total watch time.
Approach:
Use dynamic programming. Let dp[i][last] represent the maximum total watch time considering the first i videos, where the last selected video has index last.
If we don’t choose the current video:
dp[i][last] = dp[i - 1][last]
If we choose the current video and the sum of its duration with the previous selected one is ≤ attention span:
dp[i][i] = dp[i - 1][last] + duration[i]
Take max(dp[n][*]) as the result.
The follow-up question was how to handle the case where repeated viewing of the same video is allowed. The state transition needs an additional branch for repeated selections, but this may introduce cycles, so limits must be imposed.
TikTok is very familiar with this format — you only move on to the next round after passing the previous one. Their process is quite fast; usually they notify you the next day. Many of my peers who I’ve been helping mock interviews for also passed rounds 1 and 2. If you’re unsure about TikTok interviews, prepare in advance: the whole process includes BQ, coding, clarifications, walking through your approach, comments, follow-ups, etc. Speed is usually not an issue. Recently Google, Stripe, TikTok, Uber and a few others have been interviewing quite frequently.