Unix/Linux programming Interview Questions And Answers
Download Unix/Linux programming Interview Questions and Answers PDF
Elevate your Unix/Linux programming interview readiness with our detailed compilation of 15 questions. These questions are specifically selected to challenge and enhance your knowledge in Unix/Linux programming. Perfect for all proficiency levels, they are key to your interview success. Download the free PDF to have all 15 questions at your fingertips. This resource is designed to boost your confidence and ensure you're interview-ready.
15 Unix/Linux programming Questions and Answers:
Unix/Linux programming Job Interview Questions Table of Contents:
1 :: What is the major advantage of a hash table?
The major advantage of a hash table is its speed. Because the hash function is to take a range of key values and transform them into index values in such a way that the key values are distributed randomly across all the indices of a hash table.
Read More2 :: What are the techniques that you use to handle the collisions in hash tables?
We can use two major techniques to handle the collisions. They are open addressing and separate chaining. In open addressing, data items that hash to a full array cell are placed in another cell in the array. In separate chaining, each array element consist of a linked list. All data items hashing to a given array index are inserted in that list.
Read More3 :: In Unix OS, what is the file server?
The file server is a machine that shares its disk storage and files with other machines on the network.
Read More4 :: What is NFS? What is its job?
NFS stands for Network File System. NFS enables filesystems physically residing on one computer system to be used by other computers in the network, appearing to users on the remote host as just another local disk.
Read More5 :: What is CVS? List some useful CVS commands?
CVS is Concurrent Version System. It is the front end to the RCS revision control system which extends the notion of revision control from a collection of files in a single directory to a hierarchical collection of directories consisting of revision controlled files. These directories and files can be combined together to form a software release.
There are some useful commands that are being used very often. They are
► cvs checkout
► cvs update
► cvs add
► cvs remove
► cvs commit
Read MoreThere are some useful commands that are being used very often. They are
► cvs checkout
► cvs update
► cvs add
► cvs remove
► cvs commit
7 :: How would you create shared and dynamic libraries?
Well shared libraries have 2 types
1) Static
2) Dynamic.
u can create library by
ar cr -o sharedobj.a file1.o file2.o
while file1 and file2 are headfiles (obj)
now put this sharedobj.a into /usr/lib directory
Read More1) Static
2) Dynamic.
u can create library by
ar cr -o sharedobj.a file1.o file2.o
while file1 and file2 are headfiles (obj)
now put this sharedobj.a into /usr/lib directory
8 :: What are the differences between Shared and Dynamic libraries?
There are two ways in which a library is shared. Static and dynamic
In statically linked library the code of library is referenced at compile time and the result executable will be bigger.
I dynamically linked libraries the code of library is referenced at run time and resulting executable will be smaller. But drwaback is that at run time this will need the library to reference the library related symbols.
Read MoreIn statically linked library the code of library is referenced at compile time and the result executable will be bigger.
I dynamically linked libraries the code of library is referenced at run time and resulting executable will be smaller. But drwaback is that at run time this will need the library to reference the library related symbols.
9 :: Give examples of how memory leaks can occur with c programs?
Memory leaks can be occured if no allocated memory is freed. for example,malloc() and free().It is always a good practice to release the memory because it can be dangerous. it could afftect the whole program and lead to very difficult situtation. Make sure that you are releasing the allocated memory at time. so next time you write program, think twice before allocating memory. I always writedown a notes before i start program. so i know whats going on.
Momery leak example occurs when a developer allocates memory, assigns it to a pointer, and then assigns a different value to the pointer without freeing the first block of memory. In this example, overwriting the address in the pointer erases the reference to the original block of memory, making it impossible to release.
Read MoreMomery leak example occurs when a developer allocates memory, assigns it to a pointer, and then assigns a different value to the pointer without freeing the first block of memory. In this example, overwriting the address in the pointer erases the reference to the original block of memory, making it impossible to release.
10 :: Explain the Unix file system?
Basically there are 4 different types of file systems in unix ,they are as follows
1.Device file
2.Directory fil.
3.FIFO
4.Regular file
Read More1.Device file
2.Directory fil.
3.FIFO
4.Regular file
11 :: How would you remove a semaphore / shared memory whose owner processes have died?
ipcrm -sem id ; for semaphores
ipcrm -shm id ; for shared mem
Read Moreipcrm -shm id ; for shared mem
12 :: What is stty used for?
Sets options for your terminal.
Print or change terminal characteristics.
Read MorePrint or change terminal characteristics.
13 :: What type of scheduling is used in Unix?
Multi Level Feedback Queue Scheduling with each queue in round robin.
Read More14 :: Explain difference between IPC mechanisms?
Ipc mechanisms are mianly 5 types
1.pipes:it is related data only send from one pipe output is giving to another pipe input
to share resouses pipe are used
drawback:itis only related process only communicated
2.message queues:message queues are un related process are also communicate with message queues
drawback:user dont know which process curently works
share memory:memory shared in distributed systems some memory wants to share some files that time it is use full
semaphores
semaphore is integer type and in semaphore resourses give coding like negetive value means process are wants to use perticular resource waiting only and 0 means no process is waiting and 1 means one resource is free and
sockets:sockets also ipc it is comunicate clients and server
with socket system calls connection oriented and connection less also
Read More1.pipes:it is related data only send from one pipe output is giving to another pipe input
to share resouses pipe are used
drawback:itis only related process only communicated
2.message queues:message queues are un related process are also communicate with message queues
drawback:user dont know which process curently works
share memory:memory shared in distributed systems some memory wants to share some files that time it is use full
semaphores
semaphore is integer type and in semaphore resourses give coding like negetive value means process are wants to use perticular resource waiting only and 0 means no process is waiting and 1 means one resource is free and
sockets:sockets also ipc it is comunicate clients and server
with socket system calls connection oriented and connection less also
15 :: Construct pipes to execute the following jobs?
Who | echo "total users `who|wc -l`"ls | grep -c "poem" | tee filename.txtcat file1 file2 >> filetoappendto.txt??rm -rf dir1 | tee errorlog
Read More