Screening
Questions:
Question
-
- Valid Palindrome II
- Follow-up: 12116: Valid Palindrome III (just asked for the signature of recursive call)
- Given an array of positive integers and a target K, return a boolean to tell if there is any continuous sub-array that sums to the target. Variation of (560. Subarray Sum Equals K)
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
On-site
Questions:
Question
ML system design: Design an add prediction for Facebook Reels.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Coding
Questions:
-
Question
Merge Two Sorted Interval Arrays: Given two sorted, non-overlapping interval lists, return a 3rd interval list that is the union of the input interval lists. (variation of 986. Interval List Intersections)
-
Question
City Generator: Given a list of city names and their corresponding populations, write a program to output a city name subject to the following constraint: the probability of the program to output a city's name is based on its population divided by the sum of all cities' population. Assume the program will be repeatedly called many times.
- Example input: [1,2,3,4]
-
Question
Write a function that, given a binary tree of integers, returns the sums of all the root-to-leaf paths. (variation 129. Sum Root to Leaf Numbers)
-
Question
Given a set of words, find the minimal subset that satisfies the following requirement: for every word X in the input, there exists a word Y in the output where Y is a prefix of X.
- Example input: ["the", "their", "there", "dog", "cat"].
- The corresponding minimal subset satisfying the requirement is ["the", "dog", "cat"].
- Suggested using Trie and the interviewer accepted: save all words as Trie data structure and then DFS traversing the tree.
- Example output:
- the -> the
- their -> the
- there -> the
- dog -> dog
- cat -> cat
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.