Facebook | Software Engineer(E4), Product | London | Phone Screen | December | Pass
Anonymous User
3274

Interview was of 45min dot. 40 min for coding and remaning 5 mins for role discussion and about the company etc.

Q1: Given a sequence of integers and an integer total target, return whether a contiguous sequence of integers sums up to target.

input: [1, 3, 1, 4, 23], target = 8 : True
input: [1, 3, 1, 4, 23], target = 7 : False

  • First he asked me to solved it where both +ve and -ve numbers are present in the array.
  • then asked to solve for the case where only +ve integers are present in the array

Q2: Find a path through maze stored in a 2D array.
You are given a game board represented as a 2D array of zeroes and ones. Zero stands for passable positions and one stands for impassable positions. Design an algorithm to find a path from top left corner to bottom right corner.

For example,
entrance (0, 0)
0 0 0 0 0 0 0
0 0 1 0 0 1 0
0 0 1 0 1 1 0
0 0 1 0 1 0 1
1 1 1 0 0 0 0 (N - 1, N - 1) -> exit

a possible path is:
entrance ->
+ + + + 0 0 0
0 0 1 + 0 1 0
0 0 1 + 1 1 0
0 0 1 + 1 0 1
1 1 1 + + + + -> exit
Assuming a zero-indexed grid of rows and columns, we'd return:
(0, 0) -> (0, 1) -> (0, 2) -> (0, 3) -> (1, 3) -> (2, 3) ->
(3, 3) -> (4, 3) -> (4, 4) -> (4, 5) -> (4, 6)

Got the mail from the recruiter after a day, that the feedback of the screening round is +ve and they want to move forward with the onsite loop.

Comments (5)