Facebook 'onsite' interview London 21

I interviewed at Facebook, following some questions that can help:

First screening interview

  1. given a string remove all consecutive characters such as 'abba' => '', 'abbc' => 'ac', 'adeesso' => 'ado'
  2. given a vacuum in a floor with obstacles, return a list of coordinates of the farthest room where the vacuum can go.
  • you don't know where the robot is at the begining, the robot can move only vertically and horizontally.

On site Interview
Coding 1

  1. given a sorted array of int (including negatives) return an array result containing squares of each number sorted (of course, one pass of the array);
  2. given a Graph, return true if it's bipartite Graph, false otherwise. You are not given how the graph is represented.

Coding 2

  1. Given a LinkedList and an integer k, remove the k-st element of the list from the end (1 pass);
  2. Given a String with numbers and brackets, return a binary tree built from the string: given -> 4(2(3)(1))(6(5)) return
		    4
         /     \
        2       6
       / \     / 
     3   1   5 

Bahavioural
Standard questions on past experiencies. The interviwers did insist on more than one time I had a disagreement with a colleague, not just related to technical aspects.

System Design
design spotify new feature where people can see other friends top 10 played songs.
You are given 2 rest APIs to use if you want to, of course no constraints on badget. You're also given the number of users and songs and you do not have to specify how streaming platform is done or friends is done, neither the timeline, users feature etc. Just return 10 top song of a friend if I type his name on the search bar.

Second Behavioural Interview
Standard questions, this was nasty interviwer as he looked like a robot just to make questions.
And coding exercise to make in 5 minutes: given an array of integer, return number of times the sub sequences changes direction: asc/desc.

Result
I didn't pass the 2 coding sessions. I managed to complete the first exercise in each session but I didn't complete the Graph and for building the tree, my solution was really close but apparently I missed the negative case or maybe it wasn't enough.

Hope that helps.
Good luck anyone :)

Comments (15)