The earlier round 1 also went pretty smoothly, and they notified me about round 2 the next day. This round also wrapped up successfully. The interviewer, after the self-introduction, went straight into a behavioral round — mainly grilling me on my resume: briefly talk about your internship project, what you learned from it, what the most challenging project was, how communication worked within the project team, what role you played, and so on. That took about 20 minutes, then it moved into coding.
Coding: choose a subset from a collection of videos such that the sum of durations of any two consecutive selected videos doesn't exceed the user's attention span, while maximizing total watch time.
Approach: use dynamic programming, where dp[i][last] represents the max watch time considering the first i videos, with the last selected video's index being last. For the transition: if you don't pick the current video, dp[i][last] = dp[i-1][last]; if you do pick it, you need the sum with the previous selected video's duration to be <= the attention span, giving dp[i][i] = dp[i-1][last] + duration[i]. Take max(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 cycles, so you'd need to cap the number of repeats.
You only move to the next round after passing the previous one. This company is pretty efficient — they usually notify you the next day. A lot of my friends who interviewed alongside me also passed rounds one and two.
Discussion
Loading comments…