โ† Amazon questions

Sum of K largest elements in a stream

Filed under Amazon

Given an infinite stream of integers, design a data structure or algorithm to efficiently find the sum of the K largest elements at any point in time.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.