Linux Interview Questions and Answers – File Management 1

Here is a listing of Linux / Unix Technical Interview Questions & Answers for experienced IT professionals as well as fresh engineering graduates. These questions can be attempted by anyone focusing on Linux Development and Systems programming.

1. Each process has unique
a) fd table
b) file table
c) inode table
d) data block table
View Answer

Answer: a
Explanation: None.

2. File descriptor table indexes which kernel structure?
a) struct file
b) strruct fs_struct
c) files_struct
d) struct inode
View Answer

Answer: a
Explanation: None.

3. What is the default number of files open per user process?
a) 0
b) 1
c) 2
d) 3
View Answer

Answer: d
Explanation: None.

4. The file system information is stored in
a) Boot block
b) Super Block
c) Inode Table
d) Data Block
View Answer

Answer: b
Explanation: None.
advertisement
advertisement

5. Switch table is used by
a) device special file
b) directory file
c) fifo
d) link file
View Answer

Answer: a
Explanation: None.

6. What is the use of fcntl function?
a) locking a file
b) reading the file descriptor flag
c) changing the file status flag
d) all of the mentioned
View Answer

Answer: d
Explanation: None.

7. Which function can be used instead of the dup2 to duplicate the file descriptor?
a) read()
b) open()
c) stat()
d) fcntl()
View Answer

Answer: d
Explanation: None.

8. printf() uses which system call
a) open
b) read
c) write
d) close
View Answer

Answer: c
Explanation: None.
advertisement

9. read() system call on success returns
a) 0
b) -1
c) number of character
d) none
View Answer

Answer: c
Explanation: None.

10. Which system call is used to create a hard link?
a) hardlink
b) link
c) symlink
d) ln
View Answer

Answer: b
Explanation: None.
advertisement

11. namei() is
a) ANSI C library function
b) C library function
c) System call
d) kernel routine
View Answer

Answer: d
Explanation: None.

12. dup2(1,0)
a) closes the stdout and copies the stdin descriptor to stdout
b) closes the stdin and copies the stdout descriptor to stdin
c) will produce compilation error
d) None of the mentioned
View Answer

Answer: b
Explanation: None.
Sanfoundry Global Education & Learning Series – Linux Administration & Programming.

Learn detailed answer of these interview questions and an in-depth coverage on Linux Systems Programming by our popular training program titled Linux Systems Programming delivered by our Founder & CTO.

Read here to know more about the skills required to become a Linux Systems Developer.

Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux. These questions focuses on Process Management, Memory Management, File Management, Inter Process Communications, Signal Handling, etc.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.