Facebook/Meta | Phone Screen | New Grad
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-01-04Added By Anonymous
Source: Link
Company: Meta
Role: New Grad
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
This was the first question:
Given a non-empty array of integers, return up to k most frequent elements, in the order of frequency descending.
Example: [1,1,1,2,2,3] and k = 2
and here was the second:
Write a function that, given a binary tree of integers, returns the sums of all the root-to-leaf paths.
Example:
2
/ \
3 5
/ \
1 5