Facebook virtual onsite

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-07-12Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: unknown
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

Unfortunately I was not able to find the numbers of corresponding problems in leetcode database so please update this thread if you can find them

1. https://leetcode.com/problems/verifying-an-alien-dictionary/
Given two input arrays: one with strings and second with the order of letters, determine if the first array is sorted according to the second array order, e.g.
Example 1:
array1: ["cat", "bat", "dog"]
array2: ['c', 'x', 'b', 'd']
output: TRUE
Example 2:
array1: ["xy", "xa", "x"]
array2: ['y', 'a', 'x']
output: FALSE

2. Given non-decreasing array and a value k return the number of occurences of k in the array (or -1 if the value does not exist in the array)
Example 1:
array: [1, 2, 3, 3, 8]
k: 3
output: 2
Example 2:
array: [1, 2, 3, 3, 8]
k: 4
output: -1

3. A variant of the Candy Crush problem. For the given input string replace each consecutive three same element values by one occurence of this value
Examples:
abbbc → ac
abbbbc → abc
abbc → abbc

4. Desing distributed web crawler using a botnet

Comments