Blog

MCQs

Disclaimer:

Educational Use Only:

The website links provided are to be used strictly for educational and knowledge-gaining purposes only.

No Misuse:

Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.

Respect for Websites and Businesses:

Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.

Acknowledge Value of Knowledge:

Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.

No Endorsement:

The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.

User Responsibility:

By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.


Overall MCQs for Reference

 

  1. What is recursion?
    a. Looping through elements sequentially
    b. Calling a function inside itself
    c. Sorting array elements
    d. Declaring a variable twice
    Answer: bsanfoundry+1​
  2. Which is an essential feature of recursive functions?
    a. Infinite loops
    b. Input validation
    c. Base case
    d. String parsing
    Answer: cgeeksforgeeks+1​
  3. In recursion, the process stops when?
    a. Memory is full
    b. A break statement triggers
    c. A base condition is met
    d. An error is raised
    Answer: csanfoundry+1​
  4. Which sorting algorithm uses recursion?
    a. Bubble sort
    b. Insertion sort
    c. Merge sort
    d. Counting sort
    Answer: cguvi+1​
  5. What does “Recursive Feature Elimination (RFE)” do in machine learning?
    a. Trains models in a loop
    b. Iteratively removes less important features
    c. Increases the number of features
    d. Sorts features by name
    Answer: bgeeksforgeeks​
  6. Which algorithm divides the problem into subproblems and solves recursively?
    a. Brute force
    b. Greedy algorithms
    c. Divide and conquer
    d. Dynamic programming
    Answer: clenovo+1​
  7. Recursive algorithms often result in which structure?
    a. Linear search
    b. Tree structure
    c. Array traversal
    d. Hash maps
    Answer: bupgrad+1​
  8. Which operation is naturally implemented with recursion on trees?
    a. Preorder traversal
    b. Adding elements to list
    c. Sequential search
    d. Sorting in-place
    Answer: aupgrad+1​
  9. Why is a base case crucial in recursion?
    a. Prevents errors
    b. Ensures infinite calls
    c. Terminates recursive calls
    d. Optimizes performance
    Answer: cgeeksforgeeks+1​
  10. Which problem is widely solved using recursion?
    a. Linear regression
    b. Tower of Hanoi
    c. Logistic regression
    d. Data normalization
    Answer: binterviewkickstart+1​
  11. What happens if a recursive function lacks a correct base case?
    a. Compilation error
    b. Stack overflow
    c. Faster execution
    d. Return zero
    Answer: bsanfoundry+1​
  12. Which is NOT a direct application of recursion?
    a. Factorial calculation
    b. Tree traversal
    c. Data encryption
    d. Fibonacci sequence
    Answer: cguvi+1​
  13. What technique helps prevent redundant calculations in recursion?
    a. Memoization
    b. Encryption
    c. String reversal
    d. Sorting
    Answer: adevinterview+1​
  14. Which design pattern is the basis of dynamic programming?
    a. Divide and conquer
    b. Greedy
    c. Brute force
    d. Linear search
    Answer: aalooba+1​
  15. In recursive approach, problem size is typically:
    a. Increased with each call
    b. Decreased with each call
    c. Remains constant
    d. Multiplied randomly
    Answer: bgeeksforgeeks+1​
  16. A function that calls itself directly is called:
    a. Mutual recursion
    b. Direct recursion
    c. Indirect recursion
    d. None of these
    Answer: bgeeksforgeeks+1​
  17. Recursive Feature Elimination (RFE) relies on:
    a. Model weights
    b. Data normalization
    c. Feature scaling
    d. Data shuffling
    Answer: ageeksforgeeks​
  18. Backtracking in AI is often implemented using:
    a. Iteration
    b. Recursion
    c. Sorting
    d. Hashing
    Answer: blenovo+1​
  19. Which of the following is an example of indirect recursion?
    a. Function A calls itself
    b. Function A calls B, and B calls A
    c. Function A returns a value
    d. Function B is never called
    Answer: bgeeksforgeeks+1​
  20. Recursion is inefficient without:
    a. Memoization
    b. Data splitting
    c. Model validation
    d. Data augmentation
    Answer: adevinterview+1​
  21. One advantage of recursion in code is:
    a. Code simplicity
    b. Memory efficiency
    c. Slow execution
    d. Higher time complexity
    Answer: adatacamp+1​
  22. The primary risk when using recursion is:
    a. Network failure
    b. Stack overflow
    c. Data loss
    d. Model underfitting
    Answer: bsanfoundry+1​
  23. Which scenario rarely uses recursion?
    a. Searching trees
    b. Calculating factorials
    c. Flat list iteration
    d. Generating Fibonacci sequence
    Answer: cguvi+1​
  24. What ensures recursion stops calling itself?
    a. Loop counter
    b. Base condition
    c. External function
    d. Time delay
    Answer: bgeeksforgeeks+1​
  25. Which of these is NOT recursively solvable?
    a. N-Queens puzzle
    b. Sudoku
    c. Array index assignment
    d. Tree traversal
    Answer: cupgrad+1​
  26. What is the output of recursive factorial(3)?
    a. 3
    b. 6
    c. 9
    d. 12
    Answer: bdatacamp+1​
  27. Which application commonly uses recursion in machine learning?
    a. Parameter tuning
    b. Building decision trees
    c. Linear regression
    d. Random sampling
    Answer: balooba+1​
  28. In recursive binary search, recursion ends when:
    a. Target found or subarray empty
    b. Array sorted
    c. Data loaded
    d. Threshold met
    Answer: aupgrad+1​
  29. Recursive algorithms can be replaced by:
    a. Loops and stacks
    b. Direct variable assignment
    c. Variable overwriting
    d. Hash tables
    Answer: aalooba+1​
  30. Which of the following about recursion is false?
    a. Requires a base case
    b. Can always replace for-loops
    c. Uses the call stack
    d. May be memory-intensive
    Answer: blenovo+1​
  31. In which task is recursion most unsuitable?
    a. Computing nth Fibonacci number
    b. Deep tree traversal
    c. Simple linear iteration
    d. Maze solving
    Answer: cguvi+1​
  32. Recursive functions store state in:
    a. Global variables
    b. Call stack
    c. Hard disk
    d. Cache only
    Answer: bsanfoundry+1​
  33. Infinite recursion leads to:
    a. Program optimization
    b. Stack overflow
    c. Model training
    d. Faster code
    Answer: bgeeksforgeeks+1​
  34. Divide and conquer is a classic:
    a. Recursive paradigm
    b. Iterative solution
    c. Flat design
    d. Non-algorithmic approach
    Answer: alenovo+1​
  35. Which data structure helps in implementing recursion internally?
    a. HashMap
    b. Stack
    c. Queue
    d. Heap
    Answer: bguvi+1​
  36. Which of the following is a recursive method for feature selection?
    a. Feature hashing
    b. Recursive Feature Elimination (RFE)
    c. Feature engineering
    d. Feature bagging
    Answer: bgeeksforgeeks​
  37. Recursion is used for:
    a. Data classification
    b. Traversing graph structures
    c. Increasing run-time
    d. Data scaling
    Answer: bupgrad+1​
  38. Which is an example of backtracking via recursion?
    a. N-Queens problem
    b. Linear regression
    c. Classification trees
    d. Data encoding
    Answer: alenovo+1​
  39. Which property is shared by all recursive algorithms?
    a. At least one base case
    b. Infinite loop as goal
    c. Data must be numeric
    d. Output must be true
    Answer: asanfoundry+1​
  40. What is tail recursion?
    a. Recursion after a for-loop
    b. Recursive calls made only at the end of function
    c. Unoptimized recursion
    d. Non-functional recursion
    Answer: bdevinterview+1​
  41. Recursion improves readability by:
    a. Reducing lines of code
    b. Increasing code complexity
    c. Adding more loops
    d. Using low-level language
    Answer: adatacamp+1​
  42. The major limitation of recursion is:
    a. System dependency
    b. Stack space limitation
    c. Too much abstraction
    d. Input data size
    Answer: bgeeksforgeeks+1​
  43. Recursive solutions for deep trees risk:
    a. Memory leaks
    b. Stack overflow
    c. Disk failure
    d. Slower performance only
    Answer: bguvi+1​
  44. Recursive Feature Elimination is best used for:
    a. Deep neural networks
    b. Feature selection
    c. Hyperparameter tuning
    d. Data generation
    Answer: bgeeksforgeeks​
  45. Which code fragment best illustrates recursion?

a.

python

def sum(n): 

  if n == 0: return 0 

  return n + sum(n-1) 

b.

python

def sum(n): 

  return n + n 

c.

python

while n > 0: n -= 1 

d.

python

for i in range(n): pass 

Answer: apythongeeks+1​

  1. Which is a base case in Fibonacci recursion?
    a. n = 0 or n = 1
    b. n = 2
    c. n = 10
    d. n = -1
    Answer: adatacamp+1​
  2. Recursive binary search is efficient because:
    a. Decreases search space each step
    b. Checks all items sequentially
    c. Only works on unsorted data
    d. Avoids recursion
    Answer: aalooba+1​
  3. Recursion helps solve:
    a. Graph traversal
    b. Linear assignment
    c. Simple multiplication
    d. File loading
    Answer: aupgrad+1​
  4. Which statement is true about recursion in programming?
    a. Must always use loops
    b. Can be memory-intensive with large n
    c. Is faster for every problem
    d. Rarely used in ML
    Answer: blenovo+1​
  5. Which typical programming mistake leads to unintended infinite recursion?
    a. Missing base case
    b. Incorrect indentation
    c. Duplicate variable
    d. Variable type mismatch
    Answer: asanfoundry+1​iable type mismatch
    Answer: ageeksforgeeks+1​

 

  1. https://www.sanfoundry.com/data-structure-questions-answers-recursion/
  2. https://www.geeksforgeeks.org/dsa/introduction-to-recursion-2/
  3. https://www.guvi.in/blog/recursion-algorithms-in-dsa/
  4. https://www.alooba.com/skills/concepts/programming/programming-concepts/algorithms/recursion/
  5. https://www.geeksforgeeks.org/machine-learning/machine-learning-interview-questions/
  6. https://www.lenovo.com/ie/en/glossary/recursion/
  7. https://www.upgrad.com/blog/recursion-in-data-structure/
  8. https://interviewkickstart.com/blogs/learn/recursion
  9. https://www.geeksforgeeks.org/dsa/top-50-interview-problems-on-recursion-algorithm/
  10. https://devinterview.io/questions/data-structures-and-algorithms/recursion-algorithm-interview-questions/
  11. https://www.geeksforgeeks.org/dsa/recursion-practice-problems-solutions/
  12. https://www.datacamp.com/tutorial/recursion-in-python
  13. https://pythongeeks.org/quizzes/quiz-on-recursion-in-python/
  14. https://www.geeksforgeeks.org/quizzes/top-mcqs-on-recursion-algorithm-with-answers/
  15. https://testbook.com/objective-questions/mcq-on-function-recursion–5eea6a1139140f30f369ebac
  16. https://www.w3resource.com/python-exercises/data-structures-and-algorithms/python-recursion.php
  17. https://www.youtube.com/watch?v=Jz5Fqt98XpM
  18. https://interviewing.io/recursion-interview-questions
  19. https://www.guvi.in/blog/machine-learning-interview-questions-and-answers/
  20. https://www.techinterviewhandbook.org/algorithms/recursion/

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!