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.
More Jane Street Analyst Questions
You are given two identical eggs and a 100-story building. Your task is to determine the highest floor from which you can drop an egg without it breaking.How can you invert a pyramid of coins by moving only three coins?You flip a fair coin repeatedly and stop flipping after three heads in a row occur. What is the expected number of flips required?How many handshakes occur if every person in a room shakes hands with every other person exactly once?Given that the probability it rains on Sunday is 40% and the probability it rains on the weekend (Saturday or Sunday) is 60%, what is the probability it rains on Saturday?
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