Meta Interview
Anonymous User
5845

Screening:

Q1: 680. Valid Palindrome II => follow-up: 12116: Valid Palindrome III (just asked for the signature of recursive call)
Q2: 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)

On-site:
ML system design: Design an add prediction for facebook Reels.

Coding:

  1. 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)

  2. 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. [1,2,3,4]

  3. 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)

  4. 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"]. => (I suggested using Trie and the interviewer accepted: save all words as Trie data structure and then DFS traversing the tree.)
    the -> the
    their -> the
    there -> the
    dog -> dog
    cat -> cat

Comments (14)