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
Sort and check adjacent elements
4
Use a nested loop
Question 2
which algorithm would you use to solve a maze problem?
1
Bubble sort
2
Linear search
3
Binary search
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
Optimal substructure
2
A recursive or tabulated formulation
3
Greedy choice property
4
Overlapping subproblems
Question 4
In the bottom‐up tabulation approach to dynamic programming, which of the following is typically the correct order of steps?
1
Write naive recursion → identify overlapping subproblems → memorize → convert to tabulation
2
Define DP state → write recurrence → choose iteration order → fill table → return answer
3
Declare table → fill table arbitrarily → define recurrence → answer
4
Identify recurrence → choose memorization → fill table → return result
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)
3
O(n²)
4
O(ϕ^n) (approx exponential)
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(max(m,n)²)
2
O(m*n)
3
O(2^(m+n))
4
O(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
Activity Selection
2
Huffman Coding
3
Fractional Knapsack
4
0/1 Knapsack
Question 8
Which of the following best describes memorization in dynamic programming?
1
Storing results of subproblems to avoid recomputation
2
Dividing the problem into independent subproblems
3
Filling a table iteratively bottom‐up
4
Greedy selection of the best immediate choice