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
- 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 - Which is an essential feature of recursive functions?
a. Infinite loops
b. Input validation
c. Base case
d. String parsing
Answer: cgeeksforgeeks+1 - 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 - Which sorting algorithm uses recursion?
a. Bubble sort
b. Insertion sort
c. Merge sort
d. Counting sort
Answer: cguvi+1 - 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 - 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 - Recursive algorithms often result in which structure?
a. Linear search
b. Tree structure
c. Array traversal
d. Hash maps
Answer: bupgrad+1 - 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 - 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 - Which problem is widely solved using recursion?
a. Linear regression
b. Tower of Hanoi
c. Logistic regression
d. Data normalization
Answer: binterviewkickstart+1 - 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 - Which is NOT a direct application of recursion?
a. Factorial calculation
b. Tree traversal
c. Data encryption
d. Fibonacci sequence
Answer: cguvi+1 - What technique helps prevent redundant calculations in recursion?
a. Memoization
b. Encryption
c. String reversal
d. Sorting
Answer: adevinterview+1 - Which design pattern is the basis of dynamic programming?
a. Divide and conquer
b. Greedy
c. Brute force
d. Linear search
Answer: aalooba+1 - 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 - A function that calls itself directly is called:
a. Mutual recursion
b. Direct recursion
c. Indirect recursion
d. None of these
Answer: bgeeksforgeeks+1 - Recursive Feature Elimination (RFE) relies on:
a. Model weights
b. Data normalization
c. Feature scaling
d. Data shuffling
Answer: ageeksforgeeks - Backtracking in AI is often implemented using:
a. Iteration
b. Recursion
c. Sorting
d. Hashing
Answer: blenovo+1 - 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 - Recursion is inefficient without:
a. Memoization
b. Data splitting
c. Model validation
d. Data augmentation
Answer: adevinterview+1 - One advantage of recursion in code is:
a. Code simplicity
b. Memory efficiency
c. Slow execution
d. Higher time complexity
Answer: adatacamp+1 - The primary risk when using recursion is:
a. Network failure
b. Stack overflow
c. Data loss
d. Model underfitting
Answer: bsanfoundry+1 - Which scenario rarely uses recursion?
a. Searching trees
b. Calculating factorials
c. Flat list iteration
d. Generating Fibonacci sequence
Answer: cguvi+1 - What ensures recursion stops calling itself?
a. Loop counter
b. Base condition
c. External function
d. Time delay
Answer: bgeeksforgeeks+1 - Which of these is NOT recursively solvable?
a. N-Queens puzzle
b. Sudoku
c. Array index assignment
d. Tree traversal
Answer: cupgrad+1 - What is the output of recursive factorial(3)?
a. 3
b. 6
c. 9
d. 12
Answer: bdatacamp+1 - Which application commonly uses recursion in machine learning?
a. Parameter tuning
b. Building decision trees
c. Linear regression
d. Random sampling
Answer: balooba+1 - 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 - Recursive algorithms can be replaced by:
a. Loops and stacks
b. Direct variable assignment
c. Variable overwriting
d. Hash tables
Answer: aalooba+1 - 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 - 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 - Recursive functions store state in:
a. Global variables
b. Call stack
c. Hard disk
d. Cache only
Answer: bsanfoundry+1 - Infinite recursion leads to:
a. Program optimization
b. Stack overflow
c. Model training
d. Faster code
Answer: bgeeksforgeeks+1 - Divide and conquer is a classic:
a. Recursive paradigm
b. Iterative solution
c. Flat design
d. Non-algorithmic approach
Answer: alenovo+1 - Which data structure helps in implementing recursion internally?
a. HashMap
b. Stack
c. Queue
d. Heap
Answer: bguvi+1 - 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 - Recursion is used for:
a. Data classification
b. Traversing graph structures
c. Increasing run-time
d. Data scaling
Answer: bupgrad+1 - Which is an example of backtracking via recursion?
a. N-Queens problem
b. Linear regression
c. Classification trees
d. Data encoding
Answer: alenovo+1 - 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 - 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 - 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 - The major limitation of recursion is:
a. System dependency
b. Stack space limitation
c. Too much abstraction
d. Input data size
Answer: bgeeksforgeeks+1 - Recursive solutions for deep trees risk:
a. Memory leaks
b. Stack overflow
c. Disk failure
d. Slower performance only
Answer: bguvi+1 - Recursive Feature Elimination is best used for:
a. Deep neural networks
b. Feature selection
c. Hyperparameter tuning
d. Data generation
Answer: bgeeksforgeeks - 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
- 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 - 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 - Recursion helps solve:
a. Graph traversal
b. Linear assignment
c. Simple multiplication
d. File loading
Answer: aupgrad+1 - 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 - 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+1iable type mismatch
Answer: ageeksforgeeks+1
- https://www.sanfoundry.com/data-structure-questions-answers-recursion/
- https://www.geeksforgeeks.org/dsa/introduction-to-recursion-2/
- https://www.guvi.in/blog/recursion-algorithms-in-dsa/
- https://www.alooba.com/skills/concepts/programming/programming-concepts/algorithms/recursion/
- https://www.geeksforgeeks.org/machine-learning/machine-learning-interview-questions/
- https://www.lenovo.com/ie/en/glossary/recursion/
- https://www.upgrad.com/blog/recursion-in-data-structure/
- https://interviewkickstart.com/blogs/learn/recursion
- https://www.geeksforgeeks.org/dsa/top-50-interview-problems-on-recursion-algorithm/
- https://devinterview.io/questions/data-structures-and-algorithms/recursion-algorithm-interview-questions/
- https://www.geeksforgeeks.org/dsa/recursion-practice-problems-solutions/
- https://www.datacamp.com/tutorial/recursion-in-python
- https://pythongeeks.org/quizzes/quiz-on-recursion-in-python/
- https://www.geeksforgeeks.org/quizzes/top-mcqs-on-recursion-algorithm-with-answers/
- https://testbook.com/objective-questions/mcq-on-function-recursion–5eea6a1139140f30f369ebac
- https://www.w3resource.com/python-exercises/data-structures-and-algorithms/python-recursion.php
- https://www.youtube.com/watch?v=Jz5Fqt98XpM
- https://interviewing.io/recursion-interview-questions
- https://www.guvi.in/blog/machine-learning-interview-questions-and-answers/
- https://www.techinterviewhandbook.org/algorithms/recursion/