Only 1 round, which consisted of 2 interviews. The first was a coding system design question, and the second was a traditional LeetCode problem.
Here is the first question:
You're given a Frame class and a VideoPlayer class with the following operations:
Read(): reads and returns the next frame of the video, or indicates that the end of the video has been reached.Render(frame): renders a frame on the screen.
Implement on_play_click() to play the complete video, from the first frame through the last frame.
Requirements:
- Render the video at a strict rate of 25 frames per second.
Read()andRender()are not thread-safe. Make sure calls to these APIs are correctly serialized and that neither operation is invoked concurrently in an unsafe way.
The solution was to implement a producer/consumer setup that would produce frames by calling Read(), and then consume those frames by calling Render(). You need to know low-level programming, concurrency, threads, locks, condition variables, etc.
The second question was a regular LeetCode-style problem: given a list of points on a 2D plane, determine whether there's a vertical line the points are symmetric (mirrored) about — if you folded the plane along that line, every point would land exactly on another point from the list (a point can also sit right on the line itself).
The solution was a linear pass: store the first half of the points in a dictionary along with a counter for duplicates, then verify with the second half of the array that every point has a reflected point.
Happy to elaborate — message me if you have questions.
Discussion
Loading comments…