Google Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

First, the question is not that clear, what does the interviewer want to see. But it seems that it requires to design a System like Git.
Second, the solution is like:
1) Keep a list of managed files (say, L) and their status.
2) Each file has a connection to all related commits. (commits are ranked based on time)
3) Each commit has a connection to all related file (including not-changed files).

For the latest version, scan the files and fetch the latest files.
For one particular commit, scan the related files and fetch the files.

Each time, when a new commit happens,
1) If the commit new a file, insert the file to L.
2) For all modified files, insert the commit into the beginning.
3) Insert the commit to the ranked commit list.

- xuyan.nus June 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what does graphical model really mean? you can maintain in-memory linked list of all commits, new commit is appended to a tail, this can be generated from information stored in files.

- confused_banda January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i think graphical model here means how we model all of these commits info and present it in UI. And we are asked how to update this UI model when a new commit file is read. Hope I am not mistaken.

- Guy January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

@kelvin: how do you not know the requirements if you got question in ur interview?

- Anonymous January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Because he was not on an interview. He posting questions from some book or other resource.

- Anonymous January 31, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Linked list ??? but I do not know how many Files were affected and I do not know how people review the commit . I do not understand what does graphical model really mean?
, but what about using Big-table
with commit as row-key and he remainder of attributes as column family

- henok January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i think graphical model here means how we model all of these commits info and present it in UI. And we are asked how to update this UI model when a new commit file is read. Hope I am not mistaken.

- Guy January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Maintain a DAG with latest commit file at HEAD maintained by a pointer for each branch.

- 4rk January 31, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More