Reputation: 10153
I was asked during the interview to design a filesystem to allow users to add their own attributes to the files and folders. I just said to add the attributes to file descriptor and allow the search for a file be allowded based on this attribute criteria as well as add this attribute to be shown in file/folder details.
Looks like interviewer was not happy to much with this answer. Any advises how to answer that better?
Upvotes: 0
Views: 458
Reputation: 753765
I strongly suspect that the problem is that you said 'attach to a file descriptor', but a file descriptor is a transient property of a process rather than a permanent attribute of a file. You might well provide a system call to attach an attribute to the file associated with a file descriptor, just as you would also provide one that works with a file name, but the attributes would have to be stored somewhere other than 'the file descriptor'; they'd have to be stored on disk. If you did not make this clear, the interviewer may have misunderstood what you meant.
Upvotes: 3