Explore topic-wise MCQs in Testing Subject.

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

1.

If there is no base criteria in a recursive program, the program will ................

A. not be executed
B. execute until all conditions match
C. execute infinitely
D. obtain progressive approach
Answer» D. obtain progressive approach
2.

For implementing recursive function the data structure used is:

A. Stack
B. Queue
C. Linked List
D. Tree
Answer» B. Queue
3.

Which of the following algorithm cannot be designed without recursion?

A. Tower of Hanoi
B. Fibonacci Series
C. Tree Traversal
D. All can be designed without recursion
Answer» E.
4.

When a function is recursively called, all automatic variables

A. Are initialized during each execution of the function
B. Are retained from the last execution
C. Are maintained in a queue
D. None of these
Answer» B. Are retained from the last execution
5.

An iterative function is preferred when its recursive equivalent is__________.

A. Complex
B. Simple
C. Efficient
D. None of the above
Answer» B. Simple
6.

For certain problems, a recursive solution is ____________as in the case of factorial of a number.

A. Straightforward
B. Single
C. Both (a) and (b)
D. None of the above
Answer» D. None of the above
7.

Infinite recursion leads to ...............

A. Overflow of run-time stack
B. Underflow of registers usage
C. Overflow of I/O cycles
D. Underflow of run-time stack
Answer» B. Underflow of registers usage
8.

If an algorithm calls itself to do some part of work, it is said to be

A. Self functioned
B. Recursive
C. Symmetric
D. Self Sequenced
Answer» C. Symmetric
9.

Recursion is memory-intensive because:

A. Recursive functions tend to declare many local variables
B. Previous function calls are still open when the function calls itself and the activation records of these previous calls still occupy space on the call stack
C. Many copies of the function code are created
D. It requires large data values
Answer» C. Many copies of the function code are created
10.

What does the following function print for n = 25?void fun(int n){  if (n == 0)    return;   printf("%d", n%2);  fun(n/2);}

A. 11001
B. 10011
C. 11111
D. 00000
Answer» C. 11111
11.

A subroutine can be coded so that it may call itself recursively, at___________, in order to perform its task.

A. One or more places
B. Two or more places
C. More places
D. None of the above
Answer» B. Two or more places
12.

Part of a recursive algorithm that handles a simple input that can be solved without resorting to a recursive call, is known as

A. Base case
B. Recursive case
C. Summation case
D. Relational case
Answer» B. Recursive case
13.

Running out of memory may occur due to

A. Non-recursive call
B. Recursive function call
C. Use of more extern variable
D. None of these
Answer» C. Use of more extern variable
14.

Predict output of following programConsider the following recursive function fun(x, y). What is the value of fun(4, 3)int fun(int x, int y) {  if (x == 0)    return y;  return fun(x - 1,  x + y);}

A. 13
B. 12
C. 9
D. 10
Answer» B. 12
15.

An algorithm that calls itself directly or indirectly is known as

A. Sub algorithm
B. Recursion
C. Polish notation
D. Traversal algorithm
Answer» C. Polish notation
16.

Tower of hanoi is a classic example of

A. divide and conquer
B. recursive approach
C. B but not A
D. Both A & B
Answer» E.
17.

The following formula will produceFn = Fn-1 + Fn-2

A. Armstrong Number
B. Fibonacci Series
C. Euler Number
D. Prime Number
Answer» C. Euler Number
18.

What’s happen if base condition is not defined in recursion ?

A. Stack underflow
B. Stack Overflow
C. None of these
D. Both a and b
Answer» C. None of these
19.

Recursion uses more memory space than iteration because

A. it uses stack instead of queue.
B. every recursive call has to be stored.
C. both A & B are true.
D. None of the above are true.
Answer» C. both A & B are true.
20.

What about recursion is true in comparison with iteration?

A. very expensive in terms of memory.
B. low performance.
C. every recursive program can be written with iteration too.
D. all of the above are true.
Answer» E.
21.

Which Data Structure is used to perform Recursion?

A. Queue
B. Stack
C. Linked List
D. Tree
Answer» C. Linked List
22.

A procedure that calls itself is called

A. illegal call
B. reverse polish
C. recursive
D. none of the above
Answer» D. none of the above
23.

If there's no base criteria in a recursive program, the program will

A. not be executed.
B. execute until all conditions match.
C. execute infinitely.
D. obtain progressive approach.
Answer» D. obtain progressive approach.
24.

13?$

A. 7
B. Infinite loop
C. 17
Answer» C. 17
25.

3?$

A. 27
B. 3.0
C. None of the mentioned
Answer» D.
26.

011$

A. 110
B. 3
C. Infinite loop
Answer» B. 3
27.

return$

A. printf(“%d “, n)
B. if(n == 0)
C. my_recursive_function(n-1)
Answer» C. my_recursive_function(n-1)
28.

Prints the numbers from 10 to 1

A. Prints the numbers from 10 to 0
B. Prints the numbers from 1 to 10
C. Prints the numbers from 0 to 10
Answer» C. Prints the numbers from 0 to 10
29.

9 time?

A. 10 times
B. 0 times
C. Infinite number of times
Answer» D.
30.

1?

A. 1
B. 10 9 8 … 1 0
C. 10 9 8 … 1
Answer» D.
31.

Higher

A. Higher-level-expt
B. Lower
C. Lower-level-expt
Answer» D.
32.

++++2

A. +++++2
B. +++++
C. 2
Answer» D.
33.

What value will assigned, if there is no argument marked by a matching keyword?

A. T
B. NIL
C. False
D. Both NIL & False
Answer» C. False
34.

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 error
Answer» B. Run time error
35.

Which can appear without an initial form?

A. Parameter
B. Block parameter
C. Optional parameter
D. Aux parameter
Answer» E.
36.

In recursion, the condition for which the function will stop calling itself is ____________

A. Best case
B. Worst case
C. Base case
D. There is no such condition
Answer» D. There is no such condition
37.

The principle of stack is __________

A. First in first out
B. First in last out
C. Last in first out
D. Last in last out
Answer» C. Last in first out
38.

Which eliminate the need for many auxiliaries?

A. Parameters
B. Block parameters
C. Optional parameters
D. All of the mentioned
Answer» D. All of the mentioned
39.

Recursion is similar to which of the following?

A. Switch Case
B. Loop
C. If-else
D. None of the mentioned
Answer» C. If-else
40.

The data structure used to implement recursive function calls _____________

A. Array
B. Linked list
C. Binary tree
D. Stack
Answer» D. Stack
41.

Which allow procedures to use themselves again?

A. Recursion
B. Reuse
C. Reintiate
D. None of the mentioned
Answer» B. Reuse
42.

Which of the following problems can be solved using recursion?

A. Factorial of a number
B. Nth fibonacci number
C. Length of a string
D. All of the mentioned
Answer» E.
43.

Only problems that are recursively defined can be solved using recursion. True or False?

A. True
B. False
Answer» C.
44.

Which of these data types is used by operating system to manage the Recursion in Java?

A. Array
B. Stack
C. Queue
D. Tree
Answer» C. Queue