All 57 questions
What is recursion?
Asked in 4 of 374 interviews · last asked Oct 6 · Concept · Junior
Show answer
Recursion is when a function calls itself to solve a smaller version of the same problem. A base case stops the calls. Each call must move toward that base case, and its result returns to the previous call.
- The base case handles a simple input without another recursive call.
- The recursive case reduces the problem and calls the function again.
- Recursive calls usually use stack space; too many calls can cause a stack overflow.
Pythondef factorial(n): if n < 0: raise ValueError("n must be nonnegative") if n == 0: return 1 return n * factorial(n - 1) print(factorial(4)) # 24What the interviewer checks: The interviewer checks whether you understand self-calls, base cases, and why recursion stops.
Other ways it was asked
- “Can you explain recursion?”
- “Can you explain to me how recursion works?”
- “What is recursion, and how does it work?”
Explain what dynamic programming is.
Asked in 3 of 374 interviews · last asked Oct 9 · Concept · Junior
Other ways it was asked
- “What do you know about dynamic programming?”
- “Why is dynamic programming useful, and when would you use it?”
Give a problem suited to a greedy algorithm and explain why local choices produce an optimal solution.
Asked in 3 of 374 interviews · last asked Sep 4 · Concept · Junior
Other ways it was asked
- “Can you provide a specific example where a greedy algorithm is effectively used?”
- “Describe a problem where a greedy algorithm is appropriate. What makes choosing the best local option at each step effective?”
- “Can you give an example of a problem suited to a greedy approach and explain why?”
Why use dynamic programming for coin change, and how does it compare with recursive search?
Asked in 2 of 374 interviews · last asked Sep 15 · Concept · Mid-level
Other ways it was asked
- “What is the significance of dynamic programming in solving the coin change problem as compared to a greedy approach?”
- “Can you elaborate on how dynamic programming ensures finding the optimal solution in the coin change problem?”
- “Why is dynamic programming appropriate for the coin-change problem, and what other approaches could you use?”
Can you write a Python program to demonstrate dynamic programming?
Asked in 2 of 374 interviews · last asked Jul 17 · Write code · Mid-level
Other ways it was asked
- “Give an example code that demonstrates dynamic programming in Python.”
How could you systematically explore smaller subsets while checking that no selected elements are consecutive and no pair sums to 13?
Asked once · last asked Jun 6 · Scenario · Junior
Other ways it was asked
- “How would you build a valid subset incrementally while ensuring that no selected elements are consecutive and no pair sums to 13?”
- “How could you diagram possible subsets to check that no two selected elements are consecutive and no pair sums to 13?”
How would you solve the N-Queens problem using reinforcement learning?
Asked once · last asked Aug 13 · Scenario · Mid-level
How would you solve the longest palindromic subsequence problem using dynamic programming?
Asked once · last asked Aug 22 · Write code · Mid-level
How would your integer-to-Roman-numeral conversion algorithm handle 700?
Asked once · last asked Aug 31 · Write code · Junior
Other ways it was asked
- “How can an integer-to-Roman-numeral conversion algorithm handle values such as 3, 7, 4, and 9 without mapping every possible value individually?”
- “How should an integer-to-Roman-numeral algorithm handle values that are multiples of 4 or 9, such as 40, 90, 400, and 900?”
- “How would you handle 700 when converting integers to Roman numerals if your base values are 3, 7, 4, and 9?”
Given the conditions of no consecutive elements and no pairs summing to 13, what patterns or smaller cases do you notice that could help simplify the problem?
Asked once · last asked Jun 6 · Scenario · Junior
How could you use examples with four or five numbers to test your approach to selecting a subset with no consecutive elements and no pair summing to 13?
Asked once · last asked Jun 6 · Scenario · Junior
Other ways it was asked
- “What assumptions would you make when selecting a subset with no consecutive elements and no pair summing to 13, and how could testing them refine your approach?”
Write a Python code example demonstrating a divide-and-conquer algorithm.
Asked once · last asked Jul 17 · Write code · Junior
Other ways it was asked
- “Write a Python code example demonstrating the divide-and-conquer algorithm.”
Write a Python function that flattens a nested dictionary into a flat format using dot-separated keys.
Asked once · last asked Jul 24 · Write code · Mid-level
How would you implement nested dictionary flattening iteratively, without recursion?
Asked once · last asked Jul 24 · Write code · Mid-level
Can you discuss the limitations of greedy algorithms or when they might not provide an optimal solution?
Asked once · last asked Jul 27 · Concept · Junior
In the activity selection problem with activities having start and finish times, what algorithm selects the maximum number of non-overlapping activities?
Asked once · last asked Jul 27 · Concept · Junior
Why does the greedy approach yield an optimal solution to the activity selection problem?
Asked once · last asked Jul 27 · Concept · Junior
Other ways it was asked
- “Can you elaborate on why the greedy approach works best for the activity selection problem?”
What are the necessary conditions for a problem to be solvable by a greedy algorithm?
Asked once · last asked Jul 27 · Concept · Junior
How can recursion be applied to generate permutations of a set?
Asked once · last asked Jul 27 · Concept · Junior
How would you handle duplicate elements in the input set while generating permutations?
Asked once · last asked Jul 27 · Scenario · Mid-level
How does divide and conquer affect time complexity as input size grows, and how does it compare with a straightforward algorithm?
Asked once · last asked Aug 10 · Concept · Junior
How would you use Redis to solve the N-Queens problem?
Asked once · last asked Aug 13 · Scenario · Mid-level
How would you convert 900 to a Roman numeral, and what steps would the algorithm take?
Asked once · last asked Aug 31 · Write code · Junior
Do you need to map every value individually when converting integers to Roman numerals, including values such as 900, 800, 700, 600, 400, 90, 80, and 70?
Asked once · last asked Aug 31 · Write code · Junior
How would you handle values such as 90 and other tens when converting integers to Roman numerals?
Asked once · last asked Aug 31 · Write code · Junior
Can you print all subsequences of the array [1, 2, 3]?
Asked once · last asked Sep 10 · Write code · Junior
Explain how the Fibonacci sequence is calculated, including its time complexity.
Asked once · last asked Sep 13 · Concept · Junior
What is the time complexity of the recursive Fibonacci algorithm: O(n²) or O(2^n)?
Asked once · last asked Sep 13 · Concept · Junior
Given an amount and coins of denominations 1, 5, 10, and 20, return the fewest coins possible and specify how many coins of each denomination are used.
Asked once · last asked Sep 15 · Write code · Mid-level
What test cases would you write to verify a coin-change function?
Asked once · last asked Sep 15 · Write code · Mid-level
How should a coin-change solution handle a negative amount, and how would you decide on that behavior?
Asked once · last asked Sep 15 · Scenario · Mid-level
Would adding a coin denomination such as 13 change your approach to the coin-change problem?
Asked once · last asked Sep 15 · Scenario · Mid-level
When would you decide that iterative loops are safer than recursion?
Asked once · last asked Oct 6 · Concept · Junior
How do you analyze the time and space complexity of a dynamic programming solution?
Asked once · last asked Oct 11 · Concept · Mid-level
In Elixir recursion, when do you use `when`, and what expressions can appear in a `when` guard?
Asked once · last asked Oct 13 · Concept · Junior
Can you explain the difference between two-dimensional and three-dimensional dynamic programming?
Asked once · last asked Oct 15 · Concept · Junior
Solve the Matrix Chain Multiplication problem.
Asked once · last asked Oct 15 · Write code · Mid-level
What does dp[i][j] represent in the Matrix Chain Multiplication problem?
Asked once · last asked Oct 15 · Concept · Junior
What is recursion, what are some examples of its use, and what problems can it solve?
Asked once · last asked Jan 20 · Concept · Junior
Can you implement a dynamic programming algorithm?
Asked once · last asked Aug 17 · Write code · Junior
Other ways it was asked
- “Can you implement a dynamic programming algorithm and a divide-and-conquer algorithm?”
- “Can you demonstrate a dynamic programming algorithm with an example?”
- “Can you write a dynamic programming algorithm?”
Can you tell me about top-down dynamic programming?
Asked once · last asked Jul 13 · Concept · Junior
Other ways it was asked
- “What does top-down dynamic programming do?”
For a subset selection problem where no two selected elements are consecutive and no pair sums to 13, what constraints must a valid subset satisfy?
Asked once · last asked Jun 6 · Scenario · Junior
How would you enforce the no-consecutive-elements constraint when selecting a subset?
Asked once · last asked Jun 6 · Scenario · Junior
How would you ensure that no two selected elements sum to 13 as you expand a subset?
Asked once · last asked Jun 6 · Scenario · Junior
Can you explain what the top-down approach in programming is?
Asked once · last asked Jul 13 · Concept · Junior
What is simulated annealing?
Asked once · last asked Jul 13 · Concept · Junior
Write a program demonstrating a divide-and-conquer algorithm.
Asked once · last asked Jul 17 · Write code · Mid-level
Other ways it was asked
- “Write a program example for divide and conquer.”
Explain LLMs and write a Python program demonstrating dynamic programming.
Asked once · last asked Jul 17 · Write code · Junior
Can you explain a simple example of where recursion could be useful?
Asked once · last asked Jul 27 · Concept · Junior
What challenges might you face when using recursion?
Asked once · last asked Jul 27 · Concept · Junior
Given a list of integers and a target value, can you write Python code to identify the integers that add up to the target?
Asked once · last asked Aug 11 · Write code · Junior
What is the N-Queens problem?
Asked once · last asked Aug 13 · Concept · Junior
Can you write pseudocode illustrating recursion?
Asked once · last asked Aug 13 · Write code · Junior
Other ways it was asked
- “Can you give me the pseudocode of recursion?”
Can you write a program using recursion?
Asked once · last asked Aug 13 · Write code · Junior
For the optimization problem, what does it mean if there is no feasible solution?
Asked once · last asked Sep 3 · Concept · Mid-level
What approach would you consider for the coin-change problem, and why?
Asked once · last asked Sep 15 · Write code · Mid-level
For a coin-change problem using denominations 1, 5, 10, and 20, what is the minimum-coin result for an amount of 26?
Asked once · last asked Sep 15 · Write code · Junior
More Data Structures and Algorithms interview questions
- All Data Structures and Algorithms interview questions
- DSA Basics and Time Complexity Interview Questions
- Array and String Interview Questions
- Linked List, Stack and Queue Interview Questions
- Hash Map and Set Interview Questions
- Searching and Sorting Interview Questions
- Tree, Graph and Heap Interview Questions
- Algorithm Design and Optimization Interview Questions
- Compiler, Math and Logic Puzzle Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every Data Structures and Algorithms interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
374 interviews, 269 candidates, Sep 2025 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension