Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Algorithms & Flow ControlEasy
Q1. What is a flowchart for?
- A.Creating user interface layouts
- B.Designing database table schemas
- C.Visually representing algorithm steps✓ Correct
- D.Writing executable source code
Explanation
Visual representation of algorithm steps.
Report an error in this question
Algorithms & Flow ControlEasy
Q2. Which symbol is a decision?
- A.Diamond✓ Correct
- B.Parallelogram
- C.Rectangle
- D.Oval
Explanation
Diamond = decision.
Report an error in this question
Algorithms & Flow ControlEasy
Q3. Which symbol is a process?
- A.Arrow
- B.Oval
- C.Diamond
- D.Rectangle✓ Correct
Explanation
Rectangle = process.
Report an error in this question
Algorithms & Flow ControlEasy
Q4. What does an oval represent?
- A.Process
- B.Decision
- C.Start or End✓ Correct
- D.Input/Output
Explanation
Oval = terminal.
Report an error in this question
Algorithms & Flow ControlEasy
Q5. What is pseudocode?
- A.A specific programming language
- B.Informal high-level algorithm description✓ Correct
- C.Machine-readable binary code
- D.Directly executable source code
Explanation
Informal algorithm description.
Report an error in this question
Algorithms & Flow ControlEasy
Q6. Three basic control structures?
- A.Start, Process, End
- B.Create, Read, Delete
- C.Sequence, Selection, Iteration✓ Correct
- D.Input, Output, Storage
Explanation
Sequence, selection, iteration.
Report an error in this question
Algorithms & Flow ControlEasy
Q7. What is sequence?
- A.Skipping steps entirely
- B.Repeating a set of steps
- C.Steps in random order
- D.Steps one after another in order✓ Correct
Explanation
Sequential execution in order.
Report an error in this question
Algorithms & Flow ControlEasy
Q8. What does selection do?
- A.Skips all code entirely
- B.Executes all paths at once
- C.Chooses paths based on condition✓ Correct
- D.Repeats code multiple times
Explanation
Chooses paths based on conditions.
Report an error in this question
Algorithms & Flow ControlEasy
Q9. What does iteration do?
- A.Stops the program entirely
- B.Deletes all variable values
- C.Executes code only once
- D.Repeats while condition is true✓ Correct
Explanation
Repeats code while condition holds.
Report an error in this question
Algorithms & Flow ControlEasy
Q10. Which symbol is input/output?
- A.Circle
- B.Parallelogram✓ Correct
- C.Rectangle
- D.Diamond
Explanation
Parallelogram = I/O.
Report an error in this question
Algorithms & Flow ControlMedium
Q11. While vs do-while?
- A.While only runs the loop body once
- B.Do-while never actually executes code
- C.While checks first; do-while runs once✓ Correct
- D.They are exactly the same construct
Explanation
While pre-tests; do-while post-tests.
Report an error in this question
Algorithms & Flow ControlMedium
Q12. Connector symbol indicates?
- A.A terminal or endpoint state
- B.Continuation on another page✓ Correct
- C.A decision point in the flow
- D.An input or output operation
Explanation
Flowchart continues elsewhere.
Report an error in this question
Algorithms & Flow ControlMedium
Q13. What is a nested loop?
- A.A loop inside another loop✓ Correct
- B.A loop that runs just once
- C.A loop with no condition
- D.A loop that never ends
Explanation
Inner loop completes per outer iteration.
Report an error in this question
Algorithms & Flow ControlMedium
Q14. for i=1 to 5 executes how many times?
- A.5 times✓ Correct
- B.6 times
- C.0 times
- D.4 times
Explanation
1 to 5 inclusive = 5.
Report an error in this question
Algorithms & Flow ControlMedium
Q15. What is an infinite loop?
- A.Condition never becomes false✓ Correct
- B.A very fast loop execution
- C.A loop that runs just twice
- D.A loop with an empty body
Explanation
Condition never met for termination.
Report an error in this question
Algorithms & Flow ControlMedium
Q16. What is a sentinel value?
- A.A random value in the data
- B.Special value signaling end of input✓ Correct
- C.An error code returned by functions
- D.A variable name in the program
Explanation
Signals loop termination.
Report an error in this question
Algorithms & Flow ControlMedium
Q17. What does break do?
- A.Skips to the next iteration
- B.Restarts the loop from start
- C.Pauses the loop temporarily
- D.Immediately exits the loop✓ Correct
Explanation
Exits the innermost loop.
Report an error in this question
Algorithms & Flow ControlMedium
Q18. What does continue do?
- A.Breaks out of all nested loops
- B.Skips rest, goes to next iteration✓ Correct
- C.Restarts the entire program run
- D.Exits the loop entirely now
Explanation
Skips to next iteration.
Report an error in this question
Algorithms & Flow ControlMedium
Q19. What is switch-case for?
- A.Handling errors and exceptions
- B.Selecting blocks based on a value✓ Correct
- C.Iterating through a collection
- D.Managing memory allocation tasks
Explanation
Selects code blocks by value.
Report an error in this question
Algorithms & Flow ControlMedium
Q20. x=0; while x<3: print x; x=x+1. Output?
- A.1 2 3
- B.1 2
- C.0 1 2 3
- D.0 1 2✓ Correct
Explanation
Prints 0,1,2 then x=3 fails condition.
Report an error in this question
Algorithms & Flow ControlHard
Q21. for i=1..3, j=1..2: print(i*j). Output?
- A.1 1 2 2 3 3
- B.1 2 2 4 3 6✓ Correct
- C.1 2 3 4 5 6
- D.2 4 6 8 10 12
Explanation
i=1:1,2; i=2:2,4; i=3:3,6.
Report an error in this question
Algorithms & Flow ControlHard
Q22. What is tail recursion?
- A.A recursion that never ends at all
- B.Last operation is the recursive call✓ Correct
- C.Recursion with multiple base cases
- D.A specific type of iterative loop
Explanation
Compiler can optimize to avoid stack overflow.
Report an error in this question
Algorithms & Flow ControlHard
Q23. Recursion vs iteration relationship?
- A.They are completely unrelated concepts
- B.Only recursion works for any problem
- C.Every recursive can become iterative✓ Correct
- D.Iteration is always faster than recursion
Explanation
Computationally equivalent.
Report an error in this question
Algorithms & Flow ControlHard
Q24. Factorial base case?
- A.n * factorial(n-1) recursive call
- B.factorial(n)=n for all values
- C.factorial(0)=1 or factorial(1)=1✓ Correct
- D.No base case is ever needed
Explanation
Stops the recursion.
Report an error in this question
Algorithms & Flow ControlHard
Q25. No base case means?
- A.The function runs much faster
- B.Stack overflow from infinite recursion✓ Correct
- C.The function gives correct results
- D.The function returns zero always
Explanation
Infinite recursion = stack overflow.
Report an error in this question
Algorithms & Flow ControlHard
Q26. What is mutual recursion?
- A.A function calling only itself
- B.Functions calling each other cyclically✓ Correct
- C.A loop nested inside a function
- D.Recursion without any base case
Explanation
Functions call each other in a cycle.
Report an error in this question
Algorithms & Flow ControlHard
Q27. Max depth for naive fibonacci(n)?
- A.n/2
- B.log n
- C.2^n
- D.n✓ Correct
Explanation
Deepest branch has depth n.
Report an error in this question
Algorithms & Flow ControlHard
Q28. What is a coroutine?
- A.A specific type of loop construct
- B.Can suspend and resume execution✓ Correct
- C.A normal sequential function call
- D.An error handler for exceptions
Explanation
Enables cooperative multitasking.
Report an error in this question
Algorithms & Flow ControlHard
Q29. What is short-circuit evaluation?
- A.Evaluating expressions in reverse order
- B.A hardware electrical circuit fault
- C.Always evaluate all operands fully
- D.Stop evaluating when result is known✓ Correct
Explanation
Stops when result is known.
Report an error in this question
Algorithms & Flow ControlHard
Q30. What is a basic block?
- A.A class definition in a program
- B.A function definition in code
- C.One entry, one exit, no branches✓ Correct
- D.Any arbitrary piece of code
Explanation
Straight-line sequence with single entry/exit.
Report an error in this question