← Goldman Sachs questions

Probability of array being a minheap and local minima

Filed under Goldman Sachs

Given numbers inserted in random order into a binary heap, determine the probability that the resulting array forms a valid min-heap, and efficiently find a local minimum in an unsorted array.

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 Goldman Sachs questions

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