4.6 of 5 634 reviews
www.facebook.com Menlo Park, CA 5000+ Employees

Facebook Production Engineer Interview Question

I interviewed in Menlo Park, CA and was asked:
"For a given set of software checkins, write a program that will determine which part along the branch where the fault lies."
Add Tags [?]
Answer Flag Question

Part of a Production Engineer Interview Review - one of 998 Facebook Interview Reviews

Answers & Comments

of 2
first, design a test case to detect the failure.
next, determine the last known "good" state of the software, i.e. the revision number of the last known "good" state.
now, write a script that will check out each subsequent revision starting from the known good revision, build, run the test case and examine the output.
When output fails, you can determine the revision at which the bug was introduced.
- Anonymous on Nov 28, 2012 Flag Response
of 2
A - array of versions, |A| = n
check(A[0]) = true - first version is fine
check(A[n-1]) = false - last version has the fault

binary search:

int start = 0;
int end = n-1;
 int middle = (end+start)/2;
 if (check(A[middle])) start = middle;
 else end = middle;

A[end] is the version with the fault
- Anonymous on Feb 7, 2013 Flag Response
of 0
I would write an integration test, for that scenario which started to fail. Then I'd write a shell script which would run that test over some amount of last revisions. Once test is failed, you've found a revision where mistake was made.
- holms on Aug 19, 2013 Flag Response

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Facebook interview questions and advice. All interview reviews posted anonymously by Facebook employees and interview candidates.