Facebook/Meta | Phone Screen | New Grad
Anonymous User
3883

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
Comments (7)