Unit 4: Basic Dynamic Programming - Subjective Questions

CSE330 — Competitive Coding Approaches-Techniques • Practice Questions with Detailed Answers

20 questions

1

Define Dynamic Programming. Explain its main idea and identify the two essential properties required for applying dynamic programming to a problem.

2

Explain how the Fibonacci sequence can be solved using dynamic programming. Derive its recurrence relation and analyze the time and space complexity.

3

Compare the recursive, memoized, and tabulated approaches for computing the th Fibonacci number.

4

What is the tiling problem? Formulate a dynamic programming solution for the number of ways to tile a board using dominoes.

5

Derive the recurrence relation for the tiling problem of a board and explain why the recurrence is correct.

6

Explain the climbing stairs problem and formulate its dynamic programming recurrence when a person can climb either one or two steps at a time.

7

How does the climbing stairs problem change if a person can climb one, two, or three steps at a time? Derive the recurrence and base cases.

8

Distinguish between memoization and tabulation in dynamic programming. Include their processing direction, implementation style, advantages, and limitations.

9

Explain the concepts of state definition and state transition in dynamic programming with a suitable example.

10

Define the optimal substructure property. Explain why it is important in dynamic programming and provide an example.

11

Define the overlapping subproblems property. Illustrate it using the recursive Fibonacci algorithm.

12

Describe the complete process of solving a problem using dynamic programming.

13

Explain how to formulate a dynamic programming problem from a general problem statement. Use the climbing stairs problem as an example.

14

Write and explain a bottom-up tabulation algorithm for computing the Fibonacci sequence up to .

15

Write and explain a memoized recursive algorithm for the climbing stairs problem.

16

Compare the time and space complexity of naive recursion and dynamic programming for a Fibonacci-like recurrence.

17

Explain the difference between counting and optimization dynamic programming problems. Relate both types to the topics in this unit.

18

What are the common techniques used to optimize dynamic programming solutions? Explain them with reference to the Fibonacci or climbing stairs problem.

19

Derive a space-optimized dynamic programming solution for the Fibonacci sequence and explain why the optimization is valid.

20

Discuss common errors made while designing dynamic programming solutions for Fibonacci, tiling, and climbing stairs problems.