← Questions
Top k values per key in a MapReduce job
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Write the reduce side of a MapReduce job. The mapper passes each (key, value) pair through unchanged and the shuffle groups pairs by key. For every key, output its k largest values (fewer if the key has fewer than k; duplicate values count separately). Keep only k values per key in memory with a bounded min-heap, and be ready to discuss what changes when one key's values don't fit on a single reducer.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
