Google Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
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.
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.
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
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.
- xuyan.nus June 26, 2014Second, 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.