Unix/Linux Operating Systems: Processes, IPC & System Calls

Test your knowledge of Unix/Linux operating system concepts including process management, inter-process communication, file operations, system calls, and device files.

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

2 Does Linux supports multi-threading?

  1. 1 No
  2. 2 Yes
  3. 3
  4. 4
Question 2 Multiple Choice (Multiple Answers)

3 How to create devices/device files in Linux

  1. 1 mkdev
  2. 2 mknod
  3. 3 lndev
  4. 4 None
Question 3 Multiple Choice (Multiple Answers)

4 What is a /dev/zero device in Linux?

  1. 1 A dummy device to represent memory
  2. 2 A dummy device to represent the processor
  3. 3 A dummy device to provide infinite number of zeros
  4. 4 None
Question 4 Multiple Choice (Multiple Answers)

5 What is /dev/full device in Linux?

  1. 1 A device file to represent that the current file system is full
  2. 2 A device file to test scenarios of testing a /dev/full
  3. 3 Invalid device
  4. 4 None
Question 5 Multiple Choice (Multiple Answers)

6 What is /dev/random device?

  1. 1 A dummy device to represent swap
  2. 2 A dummy device to represent any device
  3. 3 A dummy device to provide infinite number of randon numbers
  4. 4 Invalid device
Question 6 Multiple Choice (Multiple Answers)

7 Zombie process will have parent as init

  1. 1 True
  2. 2 False
  3. 3
  4. 4
Question 7 Multiple Choice (Multiple Answers)

8 The correct set of sequence for file operations for a file say 'test'

  1. 1 lseek(), open(), write(), close()
  2. 2 open(), write(), lseek(), close()
  3. 3 open(), lseek(), open(), , write() close()
  4. 4 None
Question 8 Multiple Choice (Multiple Answers)

9 Difference between fork() & vfork()

  1. 1 vforlk() allows more one child process to be created simaltaneously whereas for() allows only one
  2. 2 vfork() retains same PID for child & parent known as virtual PID
  3. 3 vfork() suspends the parent process until child process exits
  4. 4 fork() & vfork() are same
Question 9 Multiple Choice (Multiple Answers)

10 How can I get/set an environment variable from a program?

  1. 1 getenv(), setenv()
  2. 2 getenv(), putenv()
  3. 3 readenv(), writeenv()
  4. 4 You cannot environmement variables inside a program
Question 10 Multiple Choice (Multiple Answers)

11 What does alarm() do

  1. 1 Wakes up kernel from sleeping
  2. 2 Wakes up devices from sleeping
  3. 3 Invokes a kernel to send SIGALARM to the calling process
  4. 4 Invokes a kernel to send SIGALARM to the registered process
Question 11 Multiple Choice (Multiple Answers)

12 What is a shared memory

  1. 1 A memeory shared between kernel & devices
  2. 2 A memory shared between root user and ordinary user
  3. 3 A memory shared across processes
  4. 4 Harddisk
Question 12 Multiple Choice (Multiple Answers)

13 What is a zombie interval?

  1. 1 The interval between child terminating and the parent calling wait()
  2. 2 The interval between parent terminating and the child calling popen()
  3. 3 The interval between parent terminating and the child termination
  4. 4 None
Question 13 Multiple Choice (Multiple Answers)

14 How do I get my program to act like a daemon?

  1. 1 Run with root user
  2. 2 Run with &
  3. 3 Run with root user using &
  4. 4 None
Question 14 Multiple Choice (Multiple Answers)

15 Why do processes never decrease in size?

  1. 1 They never releases the memory utilized
  2. 2 They release the memory but kernel does not use them
  3. 3 Since they are running
  4. 4 It’s a false statement
Question 15 Multiple Choice (Multiple Answers)

16 How can I find out if someone else has a file open?

  1. 1 Its not possible
  2. 2 use isused() function
  3. 3 Try to open file with locking enabled
  4. 4 Try to write the file after opening
Question 16 Multiple Choice (Multiple Answers)

17 How do I `lock' a file?

  1. 1 Use filelock()
  2. 2 use lockfile()
  3. 3 Use lockfd()
  4. 4 use fcntl()
Question 17 Multiple Choice (Multiple Answers)

18 How do I find the size of a file inside a program?

  1. 1 Use ls -l
  2. 2 Use sizeof()
  3. 3 Use filesize()
  4. 4 Use fstat()
Question 18 Multiple Choice (Multiple Answers)

19 How can I tell how much memory my system has?

  1. 1 Use getmemory()
  2. 2 Use sysctl()
  3. 3 Use freemem()
  4. 4 Use malloc()
Question 19 Multiple Choice (Multiple Answers)

21 What is a socket

  1. 1 A port to connect printer 2
  2. A port to connect keyboard
  3. 3 An abstraction to pass data across processes
  4. 4 A hardware device
Question 20 Multiple Choice (Multiple Answers)

22 What is a semaphore

  1. 1 A mechanism to share non-sharable resources
  2. 2 A mechanism to access memory very fast
  3. 3 A mechanism to access kernel details
  4. 4 None