Meta Online Assessment Questions
Meta OA Questions
Name | Time | Online Judge | Experience Level | Platform | Difficulty |
---|---|---|---|---|---|
Closest Sum Pair | N/A | N/A | N/A | Hard | |
Binary Tree Post-Order Iterator | N/A | N/A | N/A | Hard | |
Count Difference of Vowels | N/A | N/A | N/A | Hard | |
Process Ratings | N/A | N/A | N/A | Hard |
Closest Sum Pair
Given an ascending array of positive integers, identify two distinct elements whose sum is nearest to a target value target.
Sample Input:
Array: [3, 7, 12, 19, 23, 31, 45]
Target: 50
Sample Output:
[19, 31] because 19 + 31 = 50, which exactly matches the target
Note: The sum may be less than, equal to, or greater than the target value. Choose the pair with the smallest absolute difference from the target.
Method Signature
Implement the function closestSumPair with these parameters:
nums[]: An array of positive integers sorted in ascending order
target: The desired sum value (integer)
Return Value
An array containing exactly two integers from the input array whose sum is closest to target.
Additional Example
Input: [2, 9, 15, 21, 30], target: 25
Output: [2, 21] (sum = 23, difference from target = 2)
Binary Tree Post-Order Iterator
Create an iterator that yields values from a binary tree following post-order traversal sequence. The tree structure must remain unmodified during iteration.
TreeNode Definition: class TreeNode { int data; TreeNode leftChild; TreeNode rightChild; }
Method Signature
PostOrderTreeIterator extends Iterator {
}
Example:
Consider this binary tree:
8 / \ 3 10 / \ \ 1 6 14 / \ / 4 7 13
The iterator should return values in this order: 1, 4, 7, 6, 3, 13, 14, 10, 8
Stay Tuned...
Get one-to-one training from Google Facebook engineers
Top-notch Professionals
Learn from Facebook and Google senior engineers interviewed 100+ candidates.
Most recent interview questions and system design topics gathered from aonecode alumnus.
One-to-one online classes. Get feedbacks from real interviewers.
Customized Private Class
Already a coding expert? - Advance straight to hard interview topics of your interest.
New to the ground? - Develop basic coding skills with your own designated mentor.
Days before interview? - Focus on most important problems in target company question bank.