Interview Round DistributionClick any round below to filter
Topics:
Showing 20 of 100 results for TicketmasterPage 1 of 5
Coding
47
Iterator over a Binary Search Tree
Implement an iterator over a binary search tree.
Input: root = [7,3,15,null,null,9,20], calls: next(), hasNext(), next()
Output: 3, TRUE, 7
Explanation: The iterator yields the smallest value (3), confirms more nodes exist, then properly yields the next in-order value (7).
Find the lowest common ancestor of a binary tree.
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. The LCA is defined between two nodes p and q as the lowest node in the tree that has both p and q as descendants.
Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4
Output: 5
Explanation:…
Top K Frequent Elements
Find the top K frequent elements in an array.
Input: nums = [4,4,4,4,5,5,6], k = 1
Output: [4]
Explanation: The number 4 appears four times, easily making it the single most frequent element in the data structure.