Thursday, 15 January 2015

Linux Programming Viva Questions And Answers

Linux Programming Viva Questions And Answers

1. Define UNIX?
* To develop an o/s that could serve a large community of users & allow them to share data whenever they require.
2. Define Linux?
* It is a freely distributed implementation of Unix like kernel, the low level core of an o/s.
3. What is an Operating System?
* It is a s/w program design to act as an interface b/w user & the computer.
4. List types of o/s?
* Single user o/s, Multi user o/s, Network o/s.

5. Define features of Linux?
* Multi user capability, Multi task capability,
Communication, Security, Portable.
6. What is Kernel & Shell?
* Kernel is an o/s that provides services like file s/m , memory mgt, CPU scheduling, I/O mgt.
* Shell is an mediator or command interpreter.
7. List types of Shells?
* Bourne shell, C shell, Korn shell.
8. Define Vi editor?
* Vi is text editor.
9. List modes of vi editor?
* Command mode, Insert mode, Exit mode.
10. What is Process?
* A program in execution.
11. List types of Process Status?
* Fore ground process, Back ground process.
12. Define awk?
* It is a powerful native text & manipulation utility.
13. What is sed?
* It is a stream editor & multipurpose tool which combines the work of several filters.
14. What is Script?
* It is a textual form.
15. Define Shell Script?
*A group of commands which stored in one file called Shell script.
16. Define pipe?
* It is a buffer & stores o/p of one action as an i/p to another action.
17. List i/p & o/p redirections?
* Standard i/p, Standard o/p, Standard error.
18. Define Stream& Here document?
* It is simply a sequence of bytes.
* It is a way of passing i/p to a cmd from a shell script.
19. What are Shell MetaCharacters?
* File name Substitution, I/O Redirection,
Process Execution, Quoting Meta characters,
Positional parameters, Special characters.
20. Define Shell Variable?
*It provides ability to store & manipulate information with in the shell program.
21. List types of Variables?
* System defined variable & User defined variable.
22. List types of test command?
* Numerical test, String test, File test.
23. List types of Control structures?
* Selection/Decision, Repetition/Loop, Case-esac.
24. What is Arithmetic shell script?
* It is used for performing arithmetic operations.
25. What is Interactive shell script?
* It is used for reading operations.
26. Define Interrupt process?
* It states that shell script will terminate when ever the interrupt key is pressed.
27. What is purpose of using ‘trap’ cmd?
* It is used to stop Program execution.
28. Define Function?
*It is used to execute a group of statements as bunch.
29. Define File?
* File is a collection of information storing in a container. (Or) It is a collection of records.
30. What are the categories of files?
* Ordinary/regular, Directory, Device files.
31. List Block Types?
*Boot block, Super block, Data block, Inode block.
32. List File Types?
* Regular, Directory, Character special,
Block special, FIFO, Socket, Symbolic link files.
33. List Standard I/O & Stream error functions?
* Std I/O: fopen,fclose,fflush,fseek,fgetc,getc,getchar,
* Std Error: feof,ferror,clearerr.
34. What are Formatted I/O functions?
* I/p: scanf,fscanf,sscanf.
* O/p: printf,fprintf,sprintf & printf,vfprintf,vsprintf.
35. Define System call?
* It is an interface b/w process & kernel.
36. Define Library Function?
* It invokes appropriate kernel services.
37. What is the difference b/w s/m call & library function?
* S/m calls are part of kernel but Library functions are part of linux super structure.
38. Define File Descriptor?
* It is a non –ve integer,depending on permission kernel has to create file descriptor.
39. What are Low level file access permissions?
* creat,open,read,write,close,lseek,stat,fstat,lstat,
access,umask,ioctl,dup/dup1,dup2, fcntl.
40. List File & directory management functions?
41. What is difference b/w Hard link & Soft link?
* Hard link is direct pointer to a file, but Soft link
is indirect pointer to a file.
42. List Directory handling system calls?
* Opendir, readdir, closedir, rewinddir, seekdir, telldir.
43. What is File locking & Record locking?
* File locking locks on entire file where record locking allows a processor to lock a specified portion of a file.
44. List types of locking?
* Advisory locking & Mandatory locking.
45. What is process image?
* It contains user program, user data, stack, PCB.
46. Define PCB?
* Process control block is used to control process states.
47. Define process attributes?
* Process has a series of characteristics which are called as a process attributes.
48. List process states?
* Ready, Execution, Suspend, Stopped, Zombie.
49. Define Zombie process?
* The child process terminates while before the parent dies.
50. Define Orphan process?
* The parent process wants to terminate before the child process.
51. List process management functions?
* fork,vfork,exit,wait,waitpid,exec family ,system.
52. What is vfork?
* It is a virtual fork.
53. Define Signal?
* Signal is a software interrupt.
54. Define Reliable signal?
* Signal is generated by process when event occurs that causes the signal occurs.
55. Define Unreliable signal?
* Signals that cannot be identified.
56. What is IPC?
* Inter process communication describes different ways of msg passing b/w different processes that are running on some o/s.
57. List methods of IPC?
* Pipes, FIFO’s, Msgqueues, Semaphores, Shared m/y.
58. List types of pipes?
* Unidirectional & Bidirectional pipes.
59. What is unidirectional pipe?
* Single directional flow of data.
60. What is Bidirectional pipe?
* Bi directional flow of data.
61. Define FIFO?
*FIFO/Named pipe is a permanent fixture.
62. Define Message Queue?
* It describes storing of data in a orbitary order.
63. Define Semaphore?
* Semaphore is synchronization primitive.
64. Define Shared Memory? * It provides a way around this by letting two
or more processes shared a memory segment.
65. Define Socket?
* It is a local network of a people with outside world process.
66. List Linux API’s of messages?
*msgget, msgsnd, msgrcv, msgctl.
67. List Linux API’s of semaphores?
* Semget, semop, semctl
68. List Linux API’s of shared memory?
* Shmget, shmat, shmdt, shmctl.
69. Define Thread?
* Multiple strands of execution in a single program .
70. Define light weight process?
* It can be viewed as a mapping b/w user threads & kernel threads.
71. List POSIX threads API’s?
* Creating threads, Thread semaphores, Thread mutexes, Thread attributes, cancelling a thread.
72. Define Mutex?
* Which act as an mutual exclusion device to protect sections of code.
73. List Thread attributes?
* detached state,sched policy,sched param,
inherit sched,scope,stack size.
74. List Socket s/m call for connection oriented protocol?
* socket, bind,listen,accept,connect,read,write.
75. List Socket s/m call for connection less protocol?
* socket,bind,sendto,recvfrom.


Post a Comment