Most frequently asked Facebook interview questions

SHARE:

Facebook interview questions
1. Numbers with a Given Sum

Given an array, please determine whether it contains three numbers whose sum equals to 0.

2. Remove Numbers in Array

Given an array and a value, how to implement a function to remove all instances of that value in place and return the new length? The order of elements can be changed. It doesn't matter what you leave beyond the new length.

3. Maximums in Sliding Windows

Given an array of numbers and a sliding window size, how to get the maximal numbers in all sliding windows?

4. String Path in Matrix

How to implement a function to check whether there is a path for a string in a matrix of characters? It moves to left, right, up and down in a matrix, and a cell for a movement. The path can start from any entry in a matrix. If a cell is occupied by a character of a string on the path, it cannot be occupied by another character again

5. Digits in a Sequence

Numbers are serialized increasingly into a sequence in the format of 0123456789101112131415..., which each digit occupies a position in the sequence. For instance, the digit in the position 5 is 5, in the position 13 is 1, in the position 19 is 4, and so on.

6. Stacks Sharing an Array

How can you implement n (n > 2) stacks in a single array, where no stack overflows until no space left in the entire array space?

7. Minimal Number of Splits on a String

A string can be partitioned into some substrings, such that each substring is a palindrome. For example, there are a few strategies to split the string “abbab” into palindrome substrings, such as: “abba”|”b”, “a”|”b”|”bab” and “a”|”bb”|”a”|”b”.
Given a string str, please get the minimal numbers of splits to partition it into palindromes. The minimal number of splits to partition the string “abbab” into a set of palindromes is 1.

8. Dynamic Programming on Stolen Values

There are n houses built in a line, each of which contains some value in it. A thief is going to steal the maximal value in these houses, but he cannot steal in two adjacent houses because the owner of a stolen house will tell his two neighbors on the left and right side. What is the maximal stolen value?

9. Search in a Rotation of an Array 

When some elements at the beginning of an array are moved to the end, it gets a rotation of the original array. Please implement a function to search a number in a rotation of an increasingly sorted array. Assume there are no duplicated numbers in the array.

Source: Codercareer

COMMENTS

Name

ACADEMICS,8,DATA SCIENCE,1,EXAMS,8,JOBS,11,PLACEMENTS,8,PROJECTS,1,RANKINGS,5,TRENDING,16,
ltr
item
Sezent - accelerate your career: Most frequently asked Facebook interview questions
Most frequently asked Facebook interview questions
http://www.coastalcreative.com/wp-content/uploads/2015/02/Wall-Mural-1-Facebook-1.png
Sezent - accelerate your career
https://sezent.blogspot.com/2017/08/most-frequently-asked-facebook.html
https://sezent.blogspot.com/
https://sezent.blogspot.com/
https://sezent.blogspot.com/2017/08/most-frequently-asked-facebook.html
true
3963786588625899904
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy