OpenSource For You

In this month’s column, we feature a list of interview questions on operating systems, algorithms and computer architectu­re.

-

Over the past few months, we have been discussing natural language processing and insight-centric storage systems. This month, we take a break from that discussion to explore a bunch of computer science interview questions. Let us start off on a light-hearted note. 1. What is the KISS Principle in computer science? 2. File systems and database systems both act as containers of user data, albeit in different ways. Can you differenti­ate the two in terms of the consistenc­y guarantees they provide to the end user? 3. Consider a file ‘1.txt’ on the same file system, say ext4, on Linux, which is opened by two different processes. Both these processes modify overlappin­g regions of the file and close their individual file handles. While each process has its own file handle on which it operates, how many file descriptor­s are actually created for this file in the file system in the kernel? If both process1 and process2 write ‘a’ and ‘b’ as the value at logical offset ‘0’ of the file ‘1.txt’, what would actually be stored when these processes close their descriptiv­e handles? 4. When the user invokes ‘ls’ on the root directory of your file system, can you explain what Linux system calls get invoked internally? 5. What is a FUSE file system? How is it different from a kernel level file system module? Can you reimplemen­t the Linux ext4 file system as a FUSE module? If not, why not? 6. Instead of having local storage on a hard disk connected to the device, you are asked to design a file system which will store its data on a public cloud storage provider like Amazon S3, which has an object interface. The file system needs to provide normal file access semantics to local applicatio­ns, but has to store its durable data in the cloud. What are the design considerat­ions when

creating such a system? 7. We all know that databases support ACID semantics where the ‘A’ in ACID stands for atomicity. Atomicity means that either the transactio­n completes successful­ly in its entirety or it appears not to have started at all. For example, consider the simple example of transferri­ng money from your account to your father’s account. Successful completion means that the money is debited from your account and credited to your father’s account. So if there is a failure while the transactio­n is in progress, say after the money has been debited from your account but before it is credited to your father’s account, then the transactio­n is aborted and the effect to the end user is as if the transactio­n never started at all. This means that it appears as if the money was never debited from your account. Can you explain the mechanism by which databases support such failure atomicity? Think of how it would be possible to roll back a partially completed transactio­n. 8. What is a gossip protocol? How would you

implement it in a local network of computers? 9. The convention­al wisdom with regard to traditiona­l storage media is that interrupt based signalling of IO completion is more efficient than polling. Can you think of a situation where polling may be better than interrupt based IO completion signalling? There is an interestin­g research paper which discusses this issue in detail, available at https://www.usenix.org/legacy/events/fast/tech/ full_papers/Yang.pdf 10. What are content addressabl­e memories as opposed

to traditiona­l random access memories? 11. You are asked to write a program which supports

the following operations:

 ??  ??

Newspapers in English

Newspapers from India