We have listed here some multiple choice questions with answers, which has asked by multiple companies like Ericsson, Genpact, Syntel, Virtusa, Zensar etc.

You can prepare your job written and interview by using these sets of question from here.

1. When a target of makefile fails to execute
a) make does not executes any other target dependent on it
b) it returns a status
c) make does not executes any other target dependent on it & it returns a status
d) none of the mentioned

Answer: c

2. Which gcc option includes debugging info in the generated object code?
a) -g
b) -c
c) -p
d) none of the mentioned

Answer: a

3. The -v option of gcc
a) print the commands executed to run the stages of compilation
b) version of the gcc compiler
c) all of the mentioned
d) none of the mentioned

Answer: a

4. Which option of gcc inhibit all warning messages?
a) -w
b) -x
c) -y
d) -z

Answer: a

5. The -H option of gcc
a) prints the name of each header file used
b) is used to include header file
c) ignores the header file which are not required by source code
d) none of the mentioned

Answer: a

6. The -shared option of gcc generates shared ______ for shared library.
a) object file
b) preprocessed file
c) source file
d) none of the mentioned

Answer: a

7. Which option of gcc makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes?
a) -p
b) -P
c) -q
d) -Q

Answer: d

8. Which one of the following is not true?
a) source codes can not be compiled with static libraries in gcc
b) -O is used for optimization in gcc
c) source codes can be compiled
d) none of the mentioned

Answer: a

9. The preprocessor removes the _______ from the source code.
a) comments
b) header files
c) both comments and header files
d) none of the mentioned

Answer: a

10. What is the role of linker in the compilation process?
a) linker links the object code with the library code
b) linker converts machine code into executable machine code
c) linker generates an executable file
d) all of the mentioned

Answer: d

11. The object file contains the
a) assembly code
b) machine code
c) modified source code
d) none of the mentioned

Answer: b

12. The lines in our code that begin with the “#” character are
a) preprocessor directives
b) macros
c) header files
d) none of the mentioned

Answer: a

13. Which compilation step makes sure that all the undefined symbols in the code are resolved.
a) linking
b) compiling
c) preporcessing
d) none of the mentioned

Answer: a

14. The COFF stands for
a) common object file format
b) combined operation for file formats
c) combined object file format
d) none of the mentioned

Answer: a

15. The library contains the
a) pre-compiled object files
b) source files
c) header files
d) none of the mentioned

Answer: a

16. If a program is linked against a static library then
a) machine code of the used function is copied in the executable
b) used function definition is copied into the preprocessd code
c) used function definition is provided at the time of compiling
d) none of the mentioned

Answer: a

17. In linux, the static libraries are mostly installed in
a) /usr/lib
b) /usr/local/lib
c) both /usr/lib and /usr/local/lib
d) none of the mentioned

Answer: c

18. When a program is linked with a shared library
a) only a small table is created in the executable
b) executable contains the whole content of respective .so file
c) executable contains nothing related with the shared libraries
d) none of the mentioned

Answer: a

19. After using the shared library, memory can be done free by calling
a) dlclose
b) slclose
c) lclose
d) none of the mentioned

Answer: a

20. Which command can be used to update the shared library system?
a) lconfig
b) ldconfig
c) slconfig
d) none of the mentioned

Answer: b

21. In GDB, breakpoints can be set by the command
a) break
b) b
c) both break and b
d) none of the mentioned

Answer: c

22. To print the value of a variable while debugging with GDB, ______ command can be used.
a) printf
b) print
c) show
d) none of the mentioned

Answer: b

23. The specific break point can be deleted by _____ command in GDB.
a) delete
b) del
c) remove
d) none of the mentioned

Answer: a

24. Which GDB command is used to examine the memory?
a) x
b) y
c) z
d) none of the mentioned

Answer: a

25. Assemble code of the program can be displayed in GDB by the command
a) disassemble
b) assemble
c) assembly
d) none of the mentioned

Answer: a