Solve BST and Grid Query Problems
Company: Uber
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Quick Answer: This question evaluates understanding of binary search tree order-statistics and grid reachability under threshold constraints, testing competencies in tree traversal and order-sensitive queries, scalable multi-query processing, graph exploration techniques, and dynamic programming for movement-restricted variants, while measuring algorithmic design and complexity analysis. Domain: Coding & Algorithms; level of abstraction: primarily practical application requiring efficient algorithm implementation with a strong conceptual grasp of trade-offs, data-structure selection, and scalability for large inputs.
Part 1: Find the kth Largest Value in a BST
Constraints
- 1 <= number of non-None nodes <= 100000
- 1 <= k <= number of non-None nodes
- -10^9 <= node values <= 10^9
- The input list represents a valid BST