Microsoft Interview Question
Software Engineer in Testsmaintain 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.
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.
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