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.

What is the binary representation of the integer -14?(a) 11110(b) 01110(c) 01100(d) 11100The question was asked in exam.This question is from Signed Qualifier topic in section Miscellaneous Topics in C of C

Answer» CORRECT choice is (a) 11110

Easiest explanation - The left most bit (most SIGNIFICANT bit) is used to represent the sign of the number: 0 for positive and 1 for negative. For example, a VALUE of positive 14 is written as 01110(in binary). But a value of negative 14 is written as: 11110.
2.

The data structure used to implement recursive function calls _____________(a) Array(b) Linked list(c) Binary tree(d) StackI got this question during an online exam.Question is taken from Recursion topic in section Miscellaneous Topics in C of C

Answer»

Correct choice is (d) Stack

The explanation is: The compiler USES the DATA TYPE stack for implementing NORMAL as well as recursive function CALLS.

3.

The principle of stack is __________(a) First in first out(b) First in last out(c) Last in first out(d) Last in last outThe question was asked in an online quiz.Origin of the question is Recursion in section Miscellaneous Topics in C of C

Answer»

The correct choice is (c) Last in first out

To EXPLAIN: A stack is a last in first out(LIFO) data type. This MEANS that the last ITEM to GET STORED in the stack is the first item to get out of it.

4.

The standard byte order for networks is ____________(a) Bit-Binary(b) Little endian(c) Big endian(d) Bi-endianThis question was addressed to me in my homework.My question is taken from Endianness topic in division Miscellaneous Topics in C of C

Answer» RIGHT option is (C) Big endian

Easiest explanation - The standard byte order (NETWORK byte order) for NETWORKS is big endian. Before TRANSFERRING data on a network, data is converted to big endian.
5.

A machine in which the least significant byte is stored in the smallest address is __________(a) Big endian machine(b) Bi-endian machine(c) Binary bit machine(d) Little endian machineI had been asked this question in an internship interview.My question is from Endianness topic in chapter Miscellaneous Topics in C of C

Answer» CORRECT OPTION is (d) Little endian machine

For explanation: In little endian MACHINES, last byte of binary REPRESENTATION (least significant byte) of a multi byte DATA type is stored first, whereas in big endian method, the first byte of binary representation of a multi byte data type is stored first.
6.

What is the default state of an integer in c language?(a) Signed(b) Unsigned(c) System dependent(d) There is no default stateThe question was posed to me during an interview.I need to ask this question from Signed Qualifier in section Miscellaneous Topics in C of C

Answer»

The correct answer is (a) SIGNED

The best I can explain: The DEFAULT state of an integer in c LANGUAGE is signed. HENCE we can store both positive and negative integer VALUES in it.

7.

It is possible for a processor to support both little and big endian methods.(a) True(b) FalseThe question was posed to me in exam.I'm obligated to ask this question of Endianness topic in chapter Miscellaneous Topics in C of C

Answer»

Right option is (a) True

For explanation: It is possible for a PROCESSOR to support both LITTLE and BIG ENDIAN methods. Such machines are known as bi-endian machines.

8.

In the absence of a exit condition in a recursive function, the following error is given __________(a) Compile time error(b) Run time error(c) Logical error(d) No errorI had been asked this question by my college director while I was bunking the class.My enquiry is from Recursion in division Miscellaneous Topics in C of C

Answer»

Right option is (B) Run time error

Easiest explanation - When a recursive function is called in the absence of an EXIT condition, it results in an INFINITE loop DUE to which the stack keeps getting filled(stack OVERFLOW). This results in a run time error.

9.

File formats which have _________ as a basic unit are independent of endianness.(a) 1 byte(b) 2 bytes(c) 3 bytes(d) 4 bytesThis question was addressed to me by my college professor while I was bunking the class.My enquiry is from Endianness topic in chapter Miscellaneous Topics in C of C

Answer»

Correct ANSWER is (a) 1 byte

Easy EXPLANATION - FILE formats which have 1 byte as the basic unit are not ENDIANNESS dependent. Eg: ASCII FILES. Other file formats have fixed endianness formats.

10.

Suppose we transfer a file written on a little endian machine to a big endian machine and there is no transformation from little endian to big endian, then what happens?(a) The big endian machine throws an error when it receives the file(b) The big endian machine reads the file in the reverse order(c) The big endian machine does not read the file(d) The big endian machine reads the file in the normal orderI got this question during a job interview.I would like to ask this question from Endianness in chapter Miscellaneous Topics in C of C

Answer»

Correct OPTION is (B) The big endian MACHINE reads the FILE in the reverse order

The explanation is: If there is no transformation from little endian to big endian on TRANSFER of a file from a little endian machine to a big endian machine, the big endian machine reads the file in reverse order.

11.

Sign qualifiers can be applied to double.(a) True(b) FalseThis question was posed to me during an interview.This intriguing question comes from Signed Qualifier topic in section Miscellaneous Topics in C of C

Answer»

Correct option is (B) False

For explanation: Sign QUALIFIERS cannot be APPLIED to the data types: FLOAT and DOUBLE

12.

In a signed integer, the sign is represented by ___________(a) Least significant bit(b) Most significant bit(c) System dependent(d) The mean of the most significant bit and the least significant bitThe question was asked in quiz.My enquiry is from Signed Qualifier in section Miscellaneous Topics in C of C

Answer» CORRECT OPTION is (b) Most significant bit

For explanation: In a signed INTEGER, the most significant bit represents the sign whereas, in an unsigned integer, no bit is used to REPRESENT the sign.
13.

If the data “ABCD” is to be stored in a little endian machine, it will be stored as _________(a) ABCD(b) DCBA(c) CDAB(d) BCDAThis question was addressed to me during an interview.My question comes from Endianness in portion Miscellaneous Topics in C of C

Answer»

Correct option is (b) DCBA

Best explanation: In a little endian machine, the least significant byte (right most) is stored in the smallest address. HENCE the DATAABCD” will be stored in the form of “DCBA”.

14.

Which of the following is not an example of big endian machines?(a) Power PC(b) Motorola 68K(c) SPARC processors(d) ARM processorsThis question was posed to me in an international level competition.The query is from Endianness in chapter Miscellaneous Topics in C of C

Answer»

The CORRECT choice is (d) ARM processors

Explanation: ARM PROCESSOR is an example of little endian MACHINE. CURRENT generation ARM processor is an example of bi-endian machine. Power PC, Motorola 68K and SPARC are examples of big endian mahines.