Tuesday 21 May 2013

UNIX LAB VIVA QUESTIONS

CS 353 – ADVANCED UNIX PROGRAMMING LAB.
SAMPLE VIVA QUESTIONS
Basic Questions:

1. What is an operating system?
2. What are main functions of an OS?
3. What is UNIX?
4. What are features of UNIX?
5. Why UNIX is called as portable OS?
6. What makes UNIX an “open” system?
7. What is UNIX philosophy?
8. Who created UNIX?
9. UNIX is a Multiprogrammed Timesharing OS. Is true or false?
10. First version of UNIX was developed by ___________ at Bell Laboratories.
11. UNIX is written in C language by _________________.
12. BSD stands for _________________________________.
13. What is the meaning of the terms program, process, and file.
14. What is a terminal?
15. How to login in UNIX using a terminal?
16. How to login in LINUX using Windows?
17. What is a login of super user in UNIX?
18. How do you terminate a process?
19. How do you suspend the terminal output?
20. How do you resume the terminal output?
21. How do you indicate the end of input when entering text from the keyboard?
22. How to clear a screen?
23. How will you obtain on-line help in UNIX?
24. What are default I/O channels in UNIX for every command or program?
25. What is “/”?
26. What is the difference between absolute path and relative path?
27. Is UNIX case sensitive?
28. Name the four most common UNIX command shells.
29. How do you terminate a shell?
30. What attributes does every file have?
31. What is the difference between a file and a directory?
32. How do you create a file?
33. How do you manipulate the contents of a file?
34. How do you delete a file(s)?
35. How do you rename a file?
36. How do you copy a file from one directory to another directory?
37. How do you move a file from one directory to another directory?
38. How do you change the permissions of a file?
39. How do you list the contents of a file(s)?
40. How do you create an empty files?
41. What is the difference between Hard links and Soft links of a file?
42. Is there any difference between names of files and directories?
43. How do you sort the files?
44. How do you merge the files?
45. How do you print your current working directory?
46. How many blocks are allocated to an empty file?
47. How many blocks are allocated to an empty directory?
48. How do you list the contents of a file screen-by-screen?
49. How do you list the first lines of a file?
50. How do you list the last lines of a file?
51. How do you create a directory?
52. How do you delete a non-empty directory?
53. How do you delete a empty directory(s)?
54. How do you rename a directory?
55. How do you change from one directory to another directory?
56. What happens if you can remove an executable permission to a directory?
57. List the contents of a directory for the following:
a. Only names
b. All entries including hidden files
c. Only directories
d. Number of disk blocks occupied by the files
e. Generates a long listing
f. Recursively lists the contents of a directory and its subdirectories
g. Indicate the type of a file with a special character/symbol
58. How do you list the contents of a directory screen-by-screen?
59. How do you count number of lines, words, and characters in a file?
60. What is user mask?
61. How do you search for a file?
62. How do you search a pattern into a file?
63. What are wild card characters?
64. What are meta characters?
65. What is the purpose of a regular expression?
66. How did awk get its name?
67. How do you substitute pattern2 in place of all occurrences of pattern1 in an
entire file?
68. What are the main differences between sed and awk?
69. How do you map the characters in a file from one character set to another?
70. How do you create a hard link to a file?
71. How do you create a soft link to a file?
72. What are the drawbacks of using a symbolic link?
73. What is a pipe?
74. How do you change to a root directory?
75. How do you change to a home directory?
76. How do you change to a parent directory?
77. How do you list the users who have logged in?
78. How do you count the users who have logged in?
79. What is a Shell?
80. What are the functions of shell?
81. How do you change your default shell?
82. What is the full path of Bourne Shell?
83. What is a script?
84. How do you display information on standard output using shell?
85. What is meant by redirection?
86. What is the purpose of the following redirections:
a. Input
b. Output
c. Input appending
d. Output appending
87. How do you use the command substitution?
88. How do you use the command sequences?
89. How do you use the grouping of commands?
90. How do you use the background processing?
91. What is the difference between a parent shell, a child shell, and a sub shell?
92. What are predefined shell variables?
93. What are special built-in shell variables?
94. What is the effect of use of single quotes and double quotes in shell’s
command substitution?
95. How do you list the processes which are running?
96. How do you kill the process?
97. How do you overload the standard utilities?
98. How do you make a script executable?
99. What is the difference between a built-in command and a utility?
100. How can you enter commands that are longer than one line?
Bourne Shell:
1. Who wrote the Bourne shell?
2. What is meant by the built-in variable $$ ?
3. How do you list the lines 10 to 20 from a specified file?
4. How do you create a shell script?
5. How do you execute a script?
6. How do you create a variable?
7. How do you assign a value to a variable?
8. How do you access a variable? Give suitable examples.
9. How do you read a variable from standard input?
10. What is the option in echo command to enable an escape sequence
characters?
11. Give the meaning of the following variables:
a. $#
b. $?
c. $0
d. $1
12. How do you set the positional parameters?
13. How do you get the positional parameters?
14. How do you change your shell prompt with your name?
15. What is the meaning of an environment variable $IFS ?
16. How do you perform arithmetic operations?
17. List out various categories of binary operators to integer operands?
18. List out various string operators?
19. How do you use the parentheses in expressions? Give suitable examples.
20. How do you use the multiplication operation?
21. How do you form the conditional expressions?
22. How do you form a conditional expression for test command on integers?
23. How do you form a conditional expression for test command on strings?
24. How do you form a conditional expression for test command on files?
25. How do you use the test command?
26. How do you combine multiple conditional expressions using AND?
27. How do you combine multiple conditional expressions using OR?
28. How do you negate a conditional expression?
29. List out various control structures in Bourne shell.
30. Give the structure of a case shell command.
31. Give the structure of a for shell command.
32. Give the structure of a if shell command.
33. Give the structure of a until shell command.
34. Give the structure of a while shell command.
35. How do you change PATH variable?
36. Write a script to find a given number is even or odd?
37. Write a script to find a year whether it is a leap or not? Get the year from the
system date.
38. Write a script to generate Fibonacci series.
39. Write a script to find a factorial of a given number.
40. Write a script to find a given number is a palindrome or not?
41. Write a script to find a given word is a palindrome or not?
42. Write a script to replace all occurrences of a word “UNIX” with “LINUX” in a
given file?
43. Write a script which displays a list of all files in the current directory to
which you have read, write and execute permissions.
44. Write a script to check whether a particular user is logged-in or not.
45. Write a script to display the type of a given file.
46. How do you get the first column of an output of “ls –l” command?
47. How do you get the file permissions of all files in your current working
directory?
48. What is an alternate form of test command?
49. How do you list all lines not matching a word “UNIX” in a file?
50. What is the purpose of utility chsh?
Systems Programming:
1. What is global variable using by perror() subroutine?
2. List of predefined error codes are defined in a file _______________.
3. What is file descriptor?
4. Distinguish between file pointers and file descriptors.
5. List out the file descriptors for I/O channels.
6. What is the difference between a system call and a library routine?
7. What is the difference between O_CREAT and O_TRUNC flags of a file?
8. Answer the following using system calls:
a. How do you create a file?
b. How do you create a directory?
c. How do you open a file in read and write mode?
d. How do you change the permissions of a file?
e. How do you delete a file?
f. How do you create a hard link to an existing file?
g. How do you read a single character from a file?
h. How do you write a single character into a file?
i. How do you read a block from a file?
j. How do you write a block into a file?
k. How do you change a current file position of a file?
l. How do you get the information about a file?
9. How do you read the contents of a file in reverse order?
10. Distinguish between dup() and dep2()?
11. What is the difference between a program and a process?
12. What is the difference between a parent process and a child process?
13. What is the purpose of a getty?
14. When UNIX is started, what is the first process visible in the system?
15. Answer the following using system calls:
a. How do you duplicate a process?
b. How do you obtain a PID of a process?
c. How do you obtain a parent process’ ID number?
d. How do you terminate a process?
e. How do you replace the code, data, and stack of a process?
f. How the parent process is waiting for a termination of a child
process?
g. How do you execute a UNIX command?
h. How do you change a directory?
i. How do you kill a process?
j. How do you suspend a process?
k. How do you resume a process?
l. How do you create a pipe?
16. What is the difference between a fork() and a vfork()?
17. What is difference between execv() and execvp()?
18. How a shell runs a utility?
19. What is orphan process?
20. What is a parent process of a orphan process?
21. What is a zombie process?
22. What is the disadvantage of a zombie process?
23. How do you avoid a zombie process?
24. Under what circumstances do zombies accumulate?
25. Distinguish between a system call and an interrupt?
26. How do you request an alarm signal?
27. What is signal handler?
28. How do you handle signals?
29. How do you protect a critical code with interrupts?
30. How do you handle a death of the children with your routine?
31. What is process group?
32. What is IPC?
33. What is pipe?
34. What is the functionality of a pipe?
35. Distinguish between unnamed pipes and named pipes?
36. What is socket?
37. What are different kinds of sockets?
38. How do you create unnamed socket?
39. How do you name the socket?
40. What is client-server model?
41. What are sequences of primitives using in server program?
42. What are sequences of primitives using in client program?
43. What is shared memory?
44. What are system calls to allocate and use shared memory?
45. What is semaphore?
46. What is binary semaphore?
47. What are semaphore-related system calls?
48. What is kernel?
49. How can you differentiate asynchronous events and synchronous events?
50. Distinguish between user mode and kernel mode.

No comments:

Post a Comment