← Problems12. Fix a slow groupBy on 2B rowsHardPySpark
00:00 / 20:00

Fix a slow groupBy on 2B rows

Hard·Acceptance ·Asked at Flipkart

An aggregation over 2 billion rows spills to disk on every run. Return the same result inside the limit.

Topics

spark optimization

Similar problems

Community-reported interview topic. Not an official company question and no affiliation is implied.

solution.py
Loading editor…
Draft not saved yet · Spaces 4 · UTF-8 · ⌘↵ run, ⌘⇧↵ submit
Nothing run yet

Run against the public tests, or submit to score against all of them.