← Questions
Rotating title picker for a home-page billboard
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build a component that picks which title to show next in a billboard (or plays next in a playlist). Every title has a relevance score, and scores can change at any time. Each call to get() returns one title, highest score first, and within one pass over the catalog no title is returned twice; when every title has been shown, a new pass starts.
Discuss the data structures for fast get() and score updates, what an update means for a title already shown in this pass, and then make it thread-safe.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
