CitadelSoftware Engineer InternSoftware Developer InternQuestion #142
If a Binary Search Tree was implemented incorrectly, such that a number to the left of a node is not smaller as it should be, how would you detect this mistake? What is the most efficient way to identify such an error?
Unlock the Full Solution
Enter your email to get the detailed step-by-step solution to this Citadel interview question, plus access to free interview prep resources.
We'll also send you a free HFT mock interview video.
More Citadel Software Engineer Intern Questions
Implement a class for the game Connect 4.Given an array v, find the number of pairs of indices (i, j) such that v[i] = v[j] = v[i+1] + v[i+2] + ... + v[j-1]. Your solution should have time complexity O(n log n).How would you solve a scheduling issue given a directed acyclic graph (DAG) of tasks and k computers? What if k is one or infinity?Design an algorithm to randomly select people in a city such that the probability of selecting someone from a given district is proportional to the district's population size. Additionally, discuss how you would test your implementation and optimize its runtime, considering repeated calls to the selection function with an acceptable error margin.If a Binary Search Tree was implemented incorrectly such that a node has a left child that is not smaller than itself, how would you detect this violation? What is the most efficient method to identify this issue?
Get All 141+ Citadel Questions with Solutions
Plus 16+ hours of video lectures, resume tailoring, and 1:1 mentorship from quants.
Schedule a Call