← Questions
Top K similar movies from a similarity graph
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Movies are nodes with a rating, and an edge links two similar movies; similarity carries across edges. Given a movie and k, return the k highest-rated movies reachable from it, not counting the movie itself. Traverse with BFS and keep the best k in a heap. Follow-up: what problems would this have in production, and how would caching help?
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
