LogIn
I don't have account.

Practice coding-problems Quizzes

Strengthen your understanding of coding-problems with DevBrainiac's interactive quizzes designed for learners at every level. These quizzes help you practice essential concepts, improve accuracy and build a strong technical foundation. With instant feedback and topic-focused questions, you can easily identify weak areas and boost your confidence for exams and coding interviews.

Explore All coding-problems Quizzes

Learn coding-problems step by step with interactive quizzes designed for beginners and learners revising key concepts. Build a strong foundation with clear, structured practice in coding-problems.
Question 1
How do you efficiently check if an array contains a duplicate in O(n) time complexity?
1
Use a binary search
2
Use a hash set
3
Use a nested loop
4
Sort and check adjacent elements
Question 2
which algorithm would you use to solve a maze problem?
1
Binary search
2
Linear search
3
Bubble sort
4
Depth-first search
Question 3
Which of the following is not a necessary property for a problem to be solved effectively by dynamic programming?
1
Greedy choice property
2
Overlapping subproblems
3
A recursive or tabulated formulation
4
Optimal substructure
Question 4
In the bottom‐up tabulation approach to dynamic programming, which of the following is typically the correct order of steps?
1
Identify recurrence → choose memorization → fill table → return result
2
Write naive recursion → identify overlapping subproblems → memorize → convert to tabulation
3
Declare table → fill table arbitrarily → define recurrence → answer
4
Define DP state → write recurrence → choose iteration order → fill table → return answer
Question 5
Consider a code for the problem of computing the nth Fibonacci number using dynamic programming (either memoization or tabulation). What is the time complexity of the optimal DP solution?
1
O(log n)
2
O(ϕ^n) (approx exponential)
3
O(n)
4
O(n²)
Question 6
The problem: “Given two sequences X and Y of lengths m and n, find the length of their Longest Common Subsequence (LCS)”. What is the typical time complexity of the standard DP solution?
1
O(m+n)
2
O(m*n)
3
O(max(m,n)²)
4
O(2^(m+n))
Question 7
In the context of coding interview problems, which of the following is least likely to be solved by a pure greedy algorithm and more likely to require dynamic programming?
1
0/1 Knapsack
2
Huffman Coding
3
Fractional Knapsack
4
Activity Selection
Question 8
Which of the following best describes memorization in dynamic programming?
1
Filling a table iteratively bottom‐up
2
Storing results of subproblems to avoid recomputation
3
Dividing the problem into independent subproblems
4
Greedy selection of the best immediate choice