Microsoft Interview Question for Software Engineer in Tests






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

what do you mean by sync? Is it that all the filenames have to be same or the content also have to be same? One solution which immediately comes to my mind is that follow a tree structure and try to superimpose two trees to check if they are equal or not?

- noviceprog May 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

maintain the hash table or other kind database to store the file name and it last sync date.

one by one go over the file, compare the date with the one in the hash table.

if the date is not matched, sync.
if the file is not found, sync and add to the hash table.

- Anonymous May 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Even if the file have different dates , they might be having the same content. Doing the diff ( e.g. Windiff ) on the contents will actually tell you whether they are in sync or out of sync. So run the windiff on them , if there are differences , then sync else update the date and timestamp on older file with teh current timestamp.

- MPH International May 12, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

how about performing a hash on the file content, like the checksum

- Anonymous June 08, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Checksum

- mg August 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ifDir1.FileCount!=Dir2.FileCount

- Mallik August 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Perform MD5 hash function on both directories and compare.

- Sec September 27, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

get the inode structure of directory and check for similarity in file names, content comparison..

- saurabh.comps November 09, 2009 | 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