Jane StreetAnalystQuantitative AnalystQuestion #607

Design a heap data structure that supports adding elements and removing the top element, with the following constraints: (1) The topmost element must always be less than the topmost element in the left and right child subtrees; (2) The left child subtree must have as many or one more element than the right child subtree. The heap should also support a 'min' function (returns the value at the top of the tree) and an 'empty' function (returns an empty tree). Provide a description and implementation of such a data structure.

Unlock the Full Solution

Enter your email to get the detailed step-by-step solution to this Jane Street interview question, plus access to free interview prep resources.

We'll also send you a free HFT mock interview video.

Get All 664+ Jane Street Questions with Solutions

Plus 16+ hours of video lectures, resume tailoring, and 1:1 mentorship from quants.

Schedule a Call