## Solutions Engineer Interview Questions

- 7of 7 votes

AnswersGive an array A of n integers where 1 <= a[i] <= K.

- aonecoding July 12, 2018 in United States

Find out the length of the shortest sequence that can be constructed out of numbers 1, 2, .. k that is NOT a subsequence of A.

eg. A = [4, 2, 1, 2, 3, 3, 2, 4, 1], K = 4

All single digits appears. Each of the 16 double digit sequences, (1,1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2) ... appears. Because (1, 1, 2) doesn't appear, return 3.| Report Duplicate | Flag | PURGE

Google Solutions Engineer - 4of 4 votes

AnswerWish Interview

- aonecoding November 03, 2017 in United States

-Phone: Two sum, Three sum, N sum(recursion)

Onsite:

-Implement merge sort (recursion&iteration)

-Merge two sorted arrays: one of length m+n, the other n; store the result in the longer array

-Given a number print diamond:

Given 1

Pirnt 1

Given 3

Print

1

121

1

Given 5

Print

1

121

12321

121

1

- Rank N people in a game. There may be a tie among participants. How many possible ways of ranking there is.

- Design: Define a bot as an IP that hits the web app over M times in the past T seconds (not necessarily hits on the same page. Also take into account different API calls.) How to design a bot detector layer and where to place it in the system.| Report Duplicate | Flag | PURGE

Wish Solutions Engineer Algorithm - 0of 0 votes

Answer/*Find minimum size of text window which contain all keywords of a search query from document.

- npkatre104 June 16, 2017 in United States

Order of keywords don't matter.

Input:

Document: "MS(1) x y Is MS(5) x y MS(8) x Is Awesome x y z Awesome"

doc index dictionary:

{

Keyword: Index Position for keyword in doc

"MS": [1,5,8],

"Is": [4,10]

"Awesome": [ 11, 15] (n)

}

Search Input 1 : "MS is" ( k)

Result: "Is MS Ms" --> [Ms: 5 ; "Is" : 4] --> 2

Search Input 2: "Ms is Awesome",

Result : "MS x is Awesome" --> [Ms:8, Is: 10, Awesome: 11] ---> 4

for -> n

n^k

[1 4 5 8 10 11 15]

*/| Report Duplicate | Flag | PURGE

Microsoft Solutions Engineer - 2of 2 votes

AnswersIterate over a singly linked list backwards. Call print on each node.

Example: The list A->B->C should print as

"C B A"`class Node { public Node next; public String value; }`

There are 4 solutions

- Nerd March 16, 2017 in Europe

1) recursive

2) iterative with O(n) memory

3) iterative with O(1) memory and O(n²) runtime

4) iterative with O(1) memory and O(n) runtime (for this solution the initial list may be modified)

Explain all 4 solutions and write the code for solutions 3 and 4| Report Duplicate | Flag | PURGE

Facebook Solutions Engineer Coding - 1of 1 vote

AnswersYou are given an array of integers.

- Nerd March 16, 2017 in Europe

Write an algorithm that brings all nonzero elements to the left of the array, and returns the number of nonzero elements.

The algorithm should operate in place, i.e. shouldn't create a new array.

The order of the nonzero elements does not matter. The numbers that remain in the right portion of the array can be anything.

Example:

given the array [ 1, 0, 2, 0, 0, 3, 4 ],

a possible answer is [ 4, 1, 3, 2, ?, ?, ? ], 4 non-zero elements, where "?" can be any number.

Code should have good complexity and minimize the number of writes to the array.| Report Duplicate | Flag | PURGE

Facebook Solutions Engineer Coding

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window