Problem Solving Using Programming MCQs

Topic-wise practice questions for Problem Solving & Analytical Skills. Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q11hard
Trace this recursion:

function mystery(n):
    if (n == 1): return 1
    return n + mystery(n - 1)
print(mystery(3))
Q12easy
What is the "Scope" of a variable?
Q13medium
Consider this function:

function check(val):
    if (val > 10):
        return "High"
    if (val > 5):
        return "Medium"
    return "Low"
print(check(7))
Q14easy
In programming, what is a "Side Effect"?
Q15medium
Which of the following is the primary benefit of "Modularization" in a large programming project?
Q16medium
A client wants a simple website with 3 pages. A junior developer suggests using a complex Microservices architecture with a Kubernetes cluster. This is a violation of which principle?
Q17easy
Why is "Separation of Concerns" a vital strategy in complex problem solving?
Q18hard
Trace the following pseudocode. What is the final value of result?

x = 10
y = 5
function update(a, b):
    return (a * 2) - b
result = update(y, x)
Q19easy
What is the difference between "Imperative" and "Declarative" programming styles in problem solving?
Q20hard
You are writing an algorithm to paginate search results. You have TotalItems = 55 and ItemsPerPage = 10. Which formula correctly calculates the total number of pages needed?