InterviewDB
Question
Array Reduction 4: Reduce an Array by Repeatedly Removing the Minimum Pair Sum
Question Details
Problem Given an integer array, repeatedly perform the following operation until one element remains: Find the two smallest elements, remove them, and insert their sum back into the array. Return the total cost (sum of all inserted sums across all operations). This is equivalent to building an optimal merge tree (Huffman-style). Example: Approach Use a min-heap. At each step, pop two smallest elements, compute their sum, accumulate cost, and push the sum back. Time: O(n log n). Follow-ups Why do…
Full Details
🔒
Unlock all Snowflake questions
Full insider details, leaked discussions, and candidate experiences.
or every company, $100/year →About This Question
This is a reported interview question from a snowflake interview during the oa round.
It covers the following topics: Heap, Oa, Greedy, Coding, Arrays .
More Snowflake Interview Questions
Reddit
Snowflake screening interviews coming up — system design + coding questions?
Reddit
Tips Systems Role Snowflake
1p3a
snowflake hr screen interview experience for software engineer role
1p3a
Snowflake 2026 Software Engineer Intern VO Interview Experience
1p3a
Snowflake SWE AI/ML Intern Online Assessment Problems