0% found this document useful (0 votes)
62 views

System Programing Questions

System programing questions

Uploaded by

somsonengda
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

System Programing Questions

System programing questions

Uploaded by

somsonengda
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

System programing question

1. Among the following commands which is used to display the directory attributes rather
than its contents?
a) Is-l-d
b) Is-l
c) Is-x
d) Is-F
2. Which of the following is sits between the user and the Unix Systems?
a) CPU
b) hardware
c) Logic
d) Shell
3. Which command is used to display the characteristics of a process?
a) ps
b) au
c) du
d) all
4. Which of the following statements are true?
a) possible to directly link user-space applications with kernel space
b) user-space applications must be allowed to directly execute kernel code
c) The C library is at the heart of Unix applications
d) All
5. Which UNIX command is used for changing the current file directory?
a) rm
b) pwd
c) cp
d) cd
6. Which of the following system calls are used for creating and removing directories?
a) rmdir and chown
b) mkdir and rmdir
c) chdir and chown
d) mkdir and chdir
7. Among the following which one is true about hard links?
a) hard links allow multiple links map different names to the same inode
b) hard links allow for complex filesystem structures with multiple pathnames
pointing to the same data
c) Hard links cannot span filesystems
d) all
8. Which of the following is UNIX character devices?
a) hard disks
b) CD-ROM drives
c) Keyboard
d) Flash disk
9. Which of the following is the core of the Linux operating system?
a) Vi Editor
b) Kernel
c) Command Line
d) Terminal
10. Which is the correct command syntax to locate a file containing the words "hello" and
"this"?
a) locate -i *hello*this
b) locate -i **hello**this
c) locate -i *hello*this*
d) locate -i **hello**this**
11. Which of the following Linux command is used to know which directory you are in?
a) know
b) pwd
c) help
d) cwd
12. As a system programmer, you want to create a new directory named XYZ, which
command will be used for this purpose?
a) cd XYZ
b) mkdir XYZ
c) chdir XYZ
d) md XYZ
13. How do you show all processes being run by a particular user?
a) cat /etc/activeprocess | grep USERNAME
b) cat /home/USERNAME/open.process
c) top -U [USERNAME]
d) netstat -u USERNAME
14. When the exit status of the process is undefined?
a) the main function is not declared to return an integer
b) main does a return without a return value
c) any of these functions is called without an exit status
d) all
15. Which of the following is the advantages of shared libraries in Linux programming?
a) reduce the size of executable file
b) library functions can be replaced with new versions without having to relink
edit every program
c) a &b
d) None
16. Which of the following is not the advantages of malloc function?
a) easier to use in threaded programs
b) provide a simple interface that allows memory to be allocated in small units
c) allow us to arbitrarily deallocate blocks of memory
d) the allocated memory is initialized
17. ______a method that kernel uses to minimize the frequency of disk access by
maintaining a pool of internal data buffer to increase the response time and throughput?
a) Pooling
b) Buffer cache
c) Swapping
d) Spooling
18. Which of the following command is used to take the backup in UNIX?
a) backup
b) zip
c) gzip
d) cpio
19. Which of the following commands will display all the files in your current directory
and its subdirectories including the hidden files?
a) ls –a
b) ls –R
c) ls –aR
d) ls –l
20. Which of the following command displays the current date in the format dd/mm/yyyy?
a) date +”/%d/%m/20%y”
b) date +%d/%m/%Y
c) date +”%d/%m/%Y”
d) date +/%d/%m/20%y
21. Which of the following function is used for allocate memory dynamically from the
stack?
a) malloc()
b) alloca()
c) free()
d) none
22. Which of the following is true about the alloca () function?
a) it allocate block of memory is slower than malloc function
b) it allocates is automatically freed when the stack frame is removed
c) it needs to maintain a list of free blocks
d) none

23. Which of the following is not true about threads in Linux programming?
a) sharing information between threads is easy and fast
b) thread creation is faster than process creation
c) a thread uses parallelism which provides a way to improve application
performance
d) threads are independent of one another like processes
24. What happens when a signal is close to being delivered?
a) The signal is ignored
b) The process is terminated
c) A core dump file is generated, and the process terminates
d) The process's execution is resumed or suspended
e) All
25. How to share one thread with other threads within the same process?
a) thread ID
b) code section and data section
c) register set and a stack
d) program counter
26. Which of the following multithreaded model, the entire process will block if a thread
makes a blocking system call?
a) one to many model
b) many to many model
c) many to one model
d) one to one model
27. Which system call can be used by a parent process to determine the termination of child
process?
a) exit
b) wait
c) get
d) fork
28. Among the following which is used for address of the next instruction to be executed
by the current process?
a) Program counter
b) Process stack
c) CPU registers
d) Pipe
29. Which of the following works by dividing the processor’s time?
a) single task operating system
b) kernel
c) multitask operating system
d) applications
30. Which of the following decides which task can have the next time slot?
a) single task operating system
b) application manager
c) multitasking operating systems
d) kernel
31. Which of the following provides a time period for the context switch in Linux?
a) timer
b) counter
c) time machine
d) time slice
32. Where are placed the list of processes that are prepared to be executed and waiting?
a) Job queue
b) Ready queue
c) Execution queue
d) Process queue
33. Which of the following Linux resource limit that controls the maximum number of file
locks that a process may hold?
a) RLIMIT_FSIZE
b) RLIMIT_LOCKS
c) RLIMIT_DATA
d) RLIMIT_MSGQUEUE
34. Which of the following is false about the Virtual memory?
a) Enables users to run programs that are larger than actual physical memory.
b) VM makes the task of programming much easier.
c) It allows processes to share files easily and to implement shared memory.
d) it uses inefficient mechanism for process creation
35. How do you view the documentation for the command ‘kill’ in the Linux terminal?
a) kill –help
b) man kill
c) kill –help
d) doc kill
36. Which of the following userspace is Linux typically paired?
a) Hurd
b) BSD
c) GNU
d) System V
37. If you want to load the main kernel module for USB support. Which command would
help you achieve this task?
a) modprobe usbcore
b) modprobe ehci-ocd
c) modprobe uhci-hcd
d) modprobe
38. Which directory contains configuration files in Linux?
a) /bin/
b) /dev/
c) /etc/
d) /root/
39. How many times below program will print hello?

a) 6
b) 8
c) 3
d) 9
40. If you wanted to execute a shell command in the background, which character would
you put at the end of the command line?
a) &
b) ;
c) :
d) @
41. Which of the following is not a feature of UNIX?
a) Multiuser
b) easy to use
c) multitasking
d) portability
42. Which of the following Linux command-line utility that reports or filters out the
adjacent duplicate lines in a file?
a) paste
b) uniq
c) sort
d) cut
43. Which of the following command is used for searching for a pattern in one or more
file(s)?
a) paste
b) cd
c) grep
d) Cp
44. Which of the following cannot be performed by cat command?
a) appending files
b) creating files
c) displaying file
d) deleting files
45. Which of the following commands is known as stream editor?
a) grep
b) tr
c) sed
d) td
46. What is the function of cp command in UNIX?
a) delete a given file
b) change the directory
c) list all the available files in the current directory
d) cp is a command used for copying files and directories
47. Which of the following is the key feathers of Korn shell?
a) perform command line editing
b) maintains command history so that the user can check the last command
executed if required
c) additional flow control structures
d) all
48. Which of the following is commonly used networking commands in UNIX?
a) sh
b) tcsh
c) su
d) ksh
49. Which of the following UNIX commands that are used for displaying the user
information?
a) nslookup
b) tcsh
c) Last
d) Is –F
50. Which of the following is the features of Stateless Linux server?
a) Stores prototype of every machine
b) Store snapshots
c) Store home directories
d) All
51. In signal handling, process that receives cannot take the following action.
a) Ignore the signal such as SIGSTOP and SIGKILL
b) Perform system specified default for signal
c) Catch the signal, when process catches signal except SIGSTOP and SIGKILL
d) None.
52. If the start-up routine were coded in C the call to main could look like
a) main(exit(argc, argv));
b) exit(argc, argv);
c) exit(main(argc, argv));
d) None
53. What is the major disadvantage(s) of shared library?
a) Maintaining a single copy of the library routine somewhere in memory that all
processes references.
b) Reduces the size of each executable file
c) Remove the common library routines from the executable file
d) none
54. #inlude<unistd> this header file referred by
a) void exit (int status);
b) void _Exit(int status);
c) void _exit(int status
d) None
55. which could be the proper syntax of initialization function in memory allocation
a) void *realloc(size_t , size);
b) void *malloc(void *ptr, size_t newsize);
c) void *calloc(size_t nobj, size_t size);
d) All
56. Asynchronous signal/(s)
a) divided by zero
b) keyboard shortcut
c) illegal memory access
d) All
57. Which one is the valid function that refers to #include<unistd.h>
a) int rmdir(const char * pathname);
b) int mkdir(const char * pathname, mode_t mode);
c) int mkdirat(int fd, const char *pathname, mode_t mode);
d) All
58. From the given options which is unique one from the other
a) return the last thread from its start routine
b) calling abort
c) receipt of a signal
d) response of the last thread to a cancellation request
59. Which of the following system software resides in main memory always?
a) Text editor
b) Assembler
c) Linker
d) Loader
60. Daisy chain is a device for?
a) Interconnecting a number of devices to number of controllers
b) Connecting a number of devices to a controller
c) Connecting a number of controller to devices
d) All of above
61. What is bootstrapping?
a) A language interpreting other language program
b) A language compiling other language program
c) A language compile itself
d) All of above
62. Shell is the exclusive feature of
a) UNIX
b) DOS
c) System software
d) Application software
63. A program in execution is called
A. Process B. Instruction C. Procedure D. Function
64. A UNIX device driver is
A. Structured into two halves called top half and bottom half
B. Three equal partitions
C. Unstructured
D. None of the above
65. Memory:-
A. is a device that performs a sequence of operations specified by instructions in memory
B. is the device where information is stored
C. is a sequence of instructions
D. is a computational unit to perform specific functions
66. What will be output of the following code?
#include
int main(){
printf(“%d\t”,sizeof(6.5));
printf(“%d\t”,sizeof(90000));
printf(“%d”,sizeof(‘A’));
return 0;
}
A. 8 4 1 B. 8 4 2 C. 8 4 4 D. 8 4 3
67. What will be output of the following c code? ( according to GCC compiler)
#include
int main(){
signed x;
unsigned y;
x = 10 +- 10u + 10u +- 10;
y = x;
if(x==y)
printf(“%d %d”,x,y);
else if(x!=y)
printf(“%u %u”,x,y);
return 0;
}
a. 0 0 b. 65536 -10 c. 0 65536 d. Compilation error
68. What will be output of the following c code?
#include
int main(){
const int *p;
int a=10;
p=&a;
printf(“%d”,*p);
return 0;
}
A. 0 B. 10 C. Garbage Value D. Any Memory address
69. Which of the following is integral data type?
A. void B. char C. float D. double
70. Expansion time variables are used
A. Before expansion of micro calls
B. Only during expansion of macro calls
C. After expansion of micro calls
D. Any one of the above
71. A model statement contains call for another macro is called as
A. referential macro call
B. nested macro call
C. inbuilt macro call
D. inherited macro call
72. The flow control during macro expansion is
A. combination B. chronological C. indexable D. sequential
73. A ________________ statement declare the name of macro.
a) macro prototype
b) macro definition
c) macro identification
d) None of the above
74. A macro definition consists of
A. A macro prototype statement
B. One or more model statements
C. Macro pre-processor statements
D. All of the above
75. The translator which perform macro expansion is called a
A. Macro processor
B. Macro pre-processor
C. Micro pre-processor
D. assembler
76. Which command is used with vi Editor to delete a single character
A. x B. y C. a D. z
77. What command is used to count the total number of lines, words, and characters
contained in a file?
A. countw B. wcount C. wc D. count p
78. How can you add “Zerihun”, a new user, to your system?
A. Using useradd B. Using adduser C. Using linuxconf D. All
79. What file specifies the order in which to use specified name services?
A. /etc/services B. /etc/nsorder C. /etc/nsswitch.conf D. /etc/hosts
80. How many primary partitions can exist on one drive?
A. 16 B. 4 C. 2 D. 1
81. In which directory can you store system user default files used for creating user
directories?
A. /usr/tmp B. /etc/default C. /etc/skel D. etc/users
82. Which is the correct matching?
A. TIME_OOP : a leap second just occurred
B. TIME_WAIT : a leap second is in progress
C. TIME_BAD : the clock is partially synchronized
D. TIME_OK : the clock is synchronized
83. How to locate and get the process time or in which header file?
A. #include<sys/times.h> C. #include<times.h>
B. #include<utils/times.h> D. #include<clocks.h>
84. Which is not true about the times () system call which retrieves the process time of the
running process and its children, in clock ticks?
Struct tms {

}; clock_t times(struct tms*buf);


A. Clock_ t tms_utime; // user time consumed
B. Clock_t tms_stime; // system time consumed
C. Clock_t tms_cutime; //system time consumed by children
D. Clock_t tms_usertime; //user time consumed by children
85. The simplest interface to the signal features of the UNIX System is the signal
function.so, which could be the correct syntax ?
A. void (int) (*signal(int signo, void (*func)(int)))(int);
B. void (void (*signal(int signo, void) (*func)(int)))(int);
C. void (*signal(int signo, void (*func)(int)))(int);
D. None

86. Which is not true about closing the opened file?


#include <fcntl.h>
int close(int fd);
A. fd: file descriptor B. 0 :on success C. -1 : on error D. NULL : on error
87. How to create threads?
#include<pthread.h>
A. int pthread_create(pthread_t *restrict tidp, const pthread_attr_t *restrict attr,void
*(*start_rtn) (void*), void *restrict arg);
B. pthread_t pthread_self(void);
C. int pthread_equal(pthread_t tid1, pthread_t tid2);
D. pthread_t create(thread tid1);
88. Which is the correct signature to exit thread?
#include<pthread.h>
A. int pthread_exit_();
B. void pthread_exit(void*rval_ptr);
C. void pthread_exit(void);
D. int pthread_exit(0);
89. From the following given options one is not describe about signals?
A. software interrupts
B. most nontrivial application programs need to deal with signal
C. signals provide a way of handling asynchronous events
D. signals have the capacity to protect the system
90. true about signals:
a) SIGFPE : bus error
b) SIGCONT : restart
c) SIGILL : interrupt the process
d) SIGINT : division by zero
91. From the following which could be fully describe about Application Programming
Interface (API)?
a) The interface by which one piece of software communicates with another at the
source level
b) It provides abstraction by providing a standard set of interfaces at low level
piece
c) Binary interface between two or more pieces of software on a particular
architecture
d) They are concerned with issues such as calling conventions, byte ordering,
register use, system call invocation.
92. Which is the correct scenario about POSIX?
a) Richard Stallman suggested the standard be named POSIX
b) Tim-Berners Lee was published the first POSIX Standard
c) Daphne Koller is the first linux standard inventor
d) Geoffrey Hinton who was the first unix standard inventor
93. Which are not correct primitive system data types ?
A. mode_t B. cclock_t C. size_t D. ssize_t
94. the primitive system data type which is used to define the file sizes and balances
A. gid_t B. ino_t C. off_t D. pid_t
95. in which of the following header file the system primitive system data types found?
A. <sys/types.h> B. <types.h> C. <util.h> D. <ctype.h>
96. Which is the correct signature of symbolic link?
a) int symlink(const char *pathname, const char *slink);
b) void symlink(const char *pathname, const char *slink);
c) char symlink(const char *pathname, const char *slink);
d) string symlink(const char *pathname, const char *slink);
97. What is the difference between hard and symbolic link ?
a) A soft link is a file all its own, and the file references or points to the exact spot
on a hard drive where the Inode stores the data.
b) A hard link isn't a separate file, it points to the name of the original file, rather
than to a spot on the hard drive
c) soft link is similar to file shortcut where as hard link is copy of original file
d) A and B
98. Which are not Valid optional constants of open() and openat() system:
a) O_APPEND
b) O_CREAT
c) O_NOFOLLOW
d) O_ASYNCNO
99. How to use lseek function?
A. <unistd.h> off_t lseek(int fd, off_t offset, int whence);
B. <stdio.h> offset_t lseek(int fd, off_t offset, int whence);
C. <apue.h> offset_t lseek(int fd, off_t offset, int whence);
D. <types.h> int lseek(int fd, int offset, int whence);
100. How many data structure uses the kernel to represent an open file?
A. 1 B. 2 C. 3 D. 4

You might also like