Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which compiling option can be used for finding which part of the program is consuming most of the processing time?(a) -f(b) -g(c) -p(d) -cThe question was posed to me in an online quiz.I need to ask this question from The Compilation Process-II topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Right OPTION is (c) -P

To elaborate: The -p instructs the compiler to produce codes which count the number of times each routine is CALLED and this is useful for finding the processing time of the programs.

2.

Which statement is used to condense the code to improve the eligibility?(a) # define MACRO()(b) # include(c) if(d) else-ifThis question was posed to me in a job interview.This question is from The Compilation Process in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Correct CHOICE is (a) # DEFINE MACRO()

To elaborate: The # define MACRO() statement is used to condense the code for improving the code eligibility or for SPACE REASONS.

3.

Which of the following gives the final control to the programmer?(a) linker(b) compiler(c) locater(d) simulatorThis question was posed to me in a national level competition.Question is taken from The Compilation Process-II in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

The correct option is (a) LINKER

The explanation is: The linker can give the final CONTROL to the PROGRAMMER concerning how unresolved references are reconciled, where the sections are located in the MEMORY, which routines are used, and so on.

4.

Which of the following produces an assembler file in the compilation process?(a) pre-processor(b) assembler(c) compiler(d) post-processingThe question was asked in a job interview.My question comes from The Compilation Process topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

The correct option is (c) COMPILER

Easy explanation: The output of the pre-PROCESSOR is given to the compiler in which it PRODUCES an assembler FILE from the INSTRUCTION codes of the processor.

5.

Which of the following has the include file?(a) emulator(b) debugger(c) pre-processor(d) simulatorThe question was asked during an interview.This is a very interesting question from The Compilation Process in section Writing Software for Embedded Systems of Embedded Systems

Answer»

The correct answer is (c) pre-processor

To explain I would say: The pre-processor produces the source code before it goes to the compiler and this ALLOWS the programmer to define variable TYPES, CONSTANTS, and much other INFORMATION. This pre-processor also has to include files and combines them into the program source.

6.

Which compiling option can generate symbolic debug information for debuggers?(a) -c(b) -p(c) -f(d) -gThis question was addressed to me in quiz.This intriguing question originated from The Compilation Process-II topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

The CORRECT choice is (d) -g

Explanation: The -g GENERATES the symbolic DEBUG information for the debuggers. Without this, the debugger cannot print the variable values, it can only work at the assembler level. The symbolic information is passed through the compilation process and stored in the EXECUTABLE file.

7.

Which compiling option is used to compile programs to form part of a library?(a) -c(b) -p(c) -f(d) -gThe question was asked in final exam.The question is from The Compilation Process-II topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer» CORRECT choice is (a) -c

The explanation is: There are SEVERAL options for the COMPILERS. The option -c compiles the linking stage and then LEAVES the object file. This option is used to compile PROGRAMS to form a part of the library.
8.

Which is the standard C compiler used for the UNIX systems?(a) simulator(b) compiler(c) cc(d) scThis question was addressed to me in class test.I want to ask this question from The Compilation Process-II in division Writing Software for Embedded Systems of Embedded Systems

Answer» CORRECT answer is (C) cc

Easiest explanation: The cc is the STANDARD C compiler used in the UNIX system. Its command lines can be pre-processed, COMPILED, assembled and linked to create an executable FILE.
9.

Which of the following are header files?(a) #include(b) file(c) struct()(d) proc()This question was addressed to me in homework.The origin of the question is The Compilation Process-II in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

The CORRECT ANSWER is (a) #include

Explanation: The #include is a header file which DEFINES the STANDARD constants, variable types, and many other functions. This can also include some standard libraries.

10.

Which of the following processes the source code before it goes to the compiler?(a) compiler(b) simulator(c) pre-processor(d) emulatorI have been asked this question in semester exam.My question is from The Compilation Process in portion Writing Software for Embedded Systems of Embedded Systems

Answer» RIGHT ANSWER is (c) pre-processor

The BEST explanation: The pre-processor is responsible for processing the source code before it goes to the COMPILER and this in turn allows the programmer to define variable types, constants, and much other information.
11.

Which file is converted to an object file?(a) hex file(b) decoded file(c) coded file(d) assembly fileThe question was asked by my school principal while I was bunking the class.My doubt stems from The Compilation Process topic in section Writing Software for Embedded Systems of Embedded Systems

Answer»

Correct option is (d) assembly file

The best EXPLANATION: The OUTPUT of the pre-PROCESSOR is given to the compiler which produces an assembler file from the instruction codes of the processor and this possesses LIBRARIES. The assembly file is then converted into the OBJECT file and this contains the hexadecimal coding.

12.

Which statement replaces all occurrences of the identifier with string?(a) # define identifier string(b) # include(c) # define MACRO()(d) # ifdefThe question was posed to me in a job interview.My doubt is from The Compilation Process topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Right CHOICE is (a) # define IDENTIFIER string

For EXPLANATION I would say: # define statement can replace all occurrences of the identifier with string. Similarly, it is able to define the constants, which also MAKE the code EASIER to understand.

13.

Which of the following function can interpret data in the C language?(a) printf(b) scanf(c) proc(d) fileI have been asked this question in final exam.Question is taken from The Compilation Process in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Right ANSWER is (B) scanf

Best explanation: The scanf and printf are the well-known FUNCTIONS in the C language which is USED to interpret data and print data respectively.

14.

Which assembler option runs the m4 macro preprocessor on the source file?(a) -n(b) -m(c) -V(d) -oThis question was posed to me during an online exam.My doubt is from The Compilation Process-II topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Correct option is (b) -m

The explanation is: The option -o puts the assembler into the FILE obj file, -V can WRITE the assembler’s version NUMBER on the standard error output, -m RUNS the macro preprocessor on the source file and -n turns off the long or short address optimization.

15.

Which of the following allows the programmer to define constants?(a) pre-processor(b) compiler(c) emulator(d) debuggerI got this question in an interview.The origin of the question is The Compilation Process topic in section Writing Software for Embedded Systems of Embedded Systems

Answer»

The correct answer is (a) pre-processor

The best explanation: The pre-processor processes the SOURCE code before it GOES to the compiler and this allows the programmer to DEFINE variable types, constants, and much other information.

16.

Which of the following is also known as loader?(a) locater(b) linker(c) assembler(d) compilerI had been asked this question in quiz.I want to ask this question from The Compilation Process-II topic in division Writing Software for Embedded Systems of Embedded Systems

Answer»

The correct choice is (B) linker

The best explanation: The linker is also known as a loader. It can take the OBJECT file and SEARCHES the library files to find the ROUTINE it calls.

17.

Which command takes the object file and searches library files to find the routine calls?(a) simulator(b) emulator(c) debugger(d) linkerThis question was posed to me in semester exam.This interesting question is from The Compilation Process-II in section Writing Software for Embedded Systems of Embedded Systems

Answer»

Right choice is (d) LINKER

The explanation is: The linker is ALSO known as a loader. It can take the object file and searches the library files to find the routine it calls. The linker can give the final control to the programmer CONCERNING how unresolved references are RECONCILED, where the sections are located in the memory, which routines are used, and so on.

18.

Which assembler option is used to turn off long or short address optimization?(a) -n(b) -V(c) -m(d) -oThe question was asked in a job interview.I would like to ask this question from The Compilation Process-II in division Writing Software for Embedded Systems of Embedded Systems

Answer»

Correct answer is (a) -n

To elaborate: The option -o puts the ASSEMBLER into the file OBJ file, -V can write the assembler’s VERSION number on the standard error output, -m runs the macro preprocessor on the source file and -n turns off the LONG or short address optimization.

19.

Which of the following contains the hexadecimal coding?(a) object file(b) assembly file(c) coded file(d) decoded fileThis question was addressed to me by my school principal while I was bunking the class.I want to ask this question from The Compilation Process topic in portion Writing Software for Embedded Systems of Embedded Systems

Answer»

Right option is (a) OBJECT FILE

To explain: The OUTPUT of the pre-PROCESSOR is given to the compiler which produces an assembler file from the instruction codes of the processor and this possesses LIBRARIES and then these assembly file is converted into the object file and this possesses the coding of hexadecimal.

20.

What is the first stage of the compilation process?(a) pre-processing(b) post-processing(c) compilation(d) linkingThis question was posed to me in my homework.Asked question is from The Compilation Process topic in division Writing Software for Embedded Systems of Embedded Systems

Answer» CORRECT OPTION is (a) pre-processing

To EXPLAIN: The pre-processing involves the first stage of the compilation process in which the include files are added. This file DEFINES the standard functions, constants etc and the output is fed to the compiler.