Pergunta de entrevista da empresa Microsoft

Write a function to list all documents under your C: drive.

Resposta da entrevista

Sigiloso

16 de mar. de 2010

create a recursive function that would return the list of documents from a folder.. It'd go something like (ya sorry for the bad coding standard here) function ListofDocuments SearchFolder(folder name) var tempDocuments = new ListofDocuments(); For each folder in current folder tempDocuments =+ SearchFolder(thisFolder) Loop tempDocuments += get documents from current folder return tempDocuments End Now run: print SearchFolder("C:\")