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
Q21medium
You are writing a program to distribute 100 tasks among 3 workers. You want to know how many tasks will be left over after each worker gets an equal share. Which operator should you use?
Q22medium
Look at this logic:

flag = True
x = 5
if (flag == True OR (x / 0 == 0)):
    print("Success")
In a language with Short-Circuit Evaluation, what happens?
Q23medium
You are building a weather app. You find that you are writing the code to convert Celsius to Fahrenheit in the "Hourly View," the "Daily View," and the "Settings" page. What is the best problem-solving action?
Q24medium
A developer is writing an infinite loop intentionally for a server but notices it is consuming 100% of the CPU. What is the best way to "solve" this performance problem without stopping the loop?
Q25hard
You need to write a program that calculates taxes based on the user's country. Instead of a giant if-else chain with 200 countries, you use a "Lookup Table" (Dictionary/Map) where the key is the country name and the value is the tax rate. This is an example of: