




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A practice exam focused on computational thinking, covering key concepts such as decomposition, pattern recognition, abstraction, and algorithm design. It includes multiple-choice questions with detailed explanations, making it an excellent resource for students preparing for exams or seeking to deepen their understanding of computational thinking principles. The questions cover a range of topics, from basic definitions to more complex problem-solving strategies, offering a comprehensive review of the subject. This practice exam is designed to help learners apply computational thinking to various problem-solving scenarios. It tests understanding of data types, algorithmic strategies, and ethical considerations in automated decision-making systems. The detailed explanations provided for each answer enhance learning and retention, making it a valuable tool for both self-study and classroom use.
Typology: Exams
1 / 102
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. Which of the following best defines computational thinking (CT)? A) Memorizing programming syntax B) Applying systematic problem‑solving methods that include decomposition, pattern recognition, abstraction, and algorithm design C) Using a calculator to perform arithmetic D) Writing code without planning Answer: B Explanation: CT is a problem‑solving process that uses the four cornerstones—decomposition, pattern recognition, abstraction, and algorithm design—to formulate solutions, not merely memorizing syntax or using tools without thought. Question 2. In the CT pillar of decomposition, what is the primary purpose of breaking a problem into sub‑problems? A) To increase the overall execution time B) To make each part more manageable and testable independently C) To hide the problem’s complexity from users D) To avoid using any algorithms Answer: B Explanation: Decomposition simplifies a large problem by dividing it into smaller, independent pieces that can be solved and verified separately. Question 3. Which of the following is an example of pattern recognition? A) Writing a loop that counts from 1 to 10 B) Noticing that every time a list is sorted, the smallest element moves to the first position C) Defining a variable type for a user’s age
D) Choosing a programming language for a project Answer: B Explanation: Recognizing that the smallest element ends up first after sorting is identifying a regularity—a pattern—in the behavior of the sorting process. Question 4. Which data type is most appropriate for storing the result of the logical expression “5 > 3”? A) Integer B) Float C) String D) Boolean Answer: D Explanation: The expression evaluates to true or false, which is a Boolean value. Question 5. In problem formulation, why is it important to define inputs, outputs, and constraints explicitly? A) It allows the programmer to skip testing B) It clarifies the problem scope and guides algorithm design C) It makes the code run faster automatically D) It eliminates the need for documentation Answer: B Explanation: Clear statements of inputs, outputs, and constraints set boundaries and requirements, enabling precise algorithm development and verification.
C) Set D) Linked list Answer: C Explanation: A set ADT defines those operations abstractly; its implementation (e.g., hash table, tree) is hidden. Question 9. When choosing a data structure to implement a “first‑in‑first‑out” (FIFO) behavior, which structure is most appropriate? A) Stack B) Queue C) Binary search tree D) Hash map Answer: B Explanation: Queues enforce FIFO ordering, matching the required behavior. Question 10. Which of the following statements about abstraction is true? A) Abstraction adds more detail to a model B) Abstraction removes irrelevant details to focus on essential features C) Abstraction is only used in high‑level programming languages D) Abstraction eliminates the need for algorithms Answer: B Explanation: Abstraction deliberately hides non‑essential details so that the core concept can be addressed more easily.
Question 11. In a hierarchical decomposition, the top‑level function is often called the: A) Leaf node B) Root function C) Recursive call D) Conditional branch Answer: B Explanation: The root function represents the highest level of the hierarchy, from which sub‑functions (leaf nodes) descend. Question 12. Which of the following is a characteristic of a well‑designed algorithm? A) Ambiguous steps that can be interpreted in many ways B) Dependence on specific hardware features C) Clear, finite sequence of instructions that lead to a solution D) Unlimited use of global variables Answer: C Explanation: A good algorithm must be precise, unambiguous, and terminate after a finite number of steps. Question 13. Which algorithmic strategy repeatedly makes the locally optimal choice hoping to find a global optimum? A) Brute force B) Greedy C) Divide and conquer
Question 16. Which of the following is an example of a constraint in problem formulation? A) The program must run on Windows only B) The user’s name is stored as a string C) The algorithm must produce output within 2 seconds for inputs up to 10,000 elements D) The code should be written in Python Answer: C Explanation: Constraints are limits on resources or performance, such as time limits for particular input sizes. Question 17. When modeling a physical system, why might a simplification be made that ignores air resistance? A) To make the model more accurate B) To reduce computational complexity while preserving essential behavior C) Because air resistance never affects real systems D) To increase the number of variables Answer: B Explanation: Ignoring air resistance simplifies calculations and reduces complexity, often without significantly affecting the model’s purpose. Question 18. Which of the following best illustrates the concept of “transfer of learning” in computational thinking? A) Using a sorting algorithm learned in computer science to organize a bookshelf B) Memorizing the syntax of a specific programming language
C) Writing code without comments D) Running the same program on different operating systems Answer: A Explanation: Applying a known algorithmic pattern (sorting) to a non‑computational domain shows transfer of learning. Question 19. Which control structure is used when a task must repeat until a condition becomes false? A) Sequence B) Selection (if‑else) C) Loop (while) D) Switch Answer: C Explanation: A while loop continues execution while its condition holds true. Question 20. In pseudocode, which line correctly represents a conditional that executes block A when x is greater than 10? A) IF x > 10 THEN A ENDIF B) WHILE x > 10 DO A C) REPEAT A UNTIL x <= 10 D) FOR x = 1 TO 10 A Answer: A Explanation: The IF‑THEN construct checks the condition and executes A when true.
C) Binary search tree D) Hash table Answer: D Explanation: Hash tables use hashing to achieve O(1) average performance for these operations. Question 24. In the context of CT, what does “generalization” refer to? A) Making a specific solution work for a broader class of problems B. Adding more details to a model C. Restricting a solution to a single case D. Removing all constraints Answer: A Explanation: Generalization abstracts a solution so it can be applied to many similar problems. Question 25. Which of the following best describes a “greedy” algorithm for the coin‑change problem? A) Trying all possible combinations of coins B. Selecting the largest coin value that does not exceed the remaining amount repeatedly C. Sorting coins in ascending order and using the smallest first D. Using dynamic programming to store sub‑solutions Answer: B Explanation: The greedy approach repeatedly picks the biggest coin possible, which works for canonical coin systems.
Question 26. Which modeling technique would you use to predict traffic flow in a city? A. Binary search B. Discrete‑event simulation C. Linear search D. Stack recursion Answer: B Explanation: Discrete‑event simulation can model complex, time‑based interactions like traffic movement. Question 27. Which of the following is NOT a characteristic of a good problem statement? A. Ambiguity B. Specificity about inputs and outputs C. Clearly defined constraints D. Measurable success criteria Answer: A Explanation: Ambiguity makes the problem unclear; a good statement must be precise. Question 28. In a divide‑and‑conquer algorithm, what is the typical sequence of steps? A. Divide, combine, solve B. Solve, divide, combine C. Divide, solve sub‑problems, combine results D. Combine, divide, solve
A. Only to type code into a computer B. To formulate the problem, interpret results, and guide the computational solution C. To replace all algorithmic steps with intuition D. To ensure the computer never makes mistakes Answer: B Explanation: Humans define the problem, decide on abstractions, and evaluate outcomes; they are central to CT. Question 32. Which of the following is an example of a “pattern” that can be reused across many programming tasks? A. The “for‑each” loop that iterates over a collection B. The exact variable names used in a specific program C. The hardware architecture of a CPU D. The color scheme of an IDE Answer: A Explanation: The “for‑each” iteration pattern abstracts over collection types and is widely reusable. Question 33. In algorithm analysis, what does the term “worst‑case” refer to? A. The average time taken over many inputs B. The maximum time the algorithm could take for any input of size n C. The best possible performance on a particular input D. The amount of memory the algorithm uses
Answer: B Explanation: Worst‑case complexity measures the upper bound on running time for the most difficult input of size n. Question 34. Which of the following is a primary advantage of using pseudocode over actual programming language code when designing an algorithm? A. It executes faster on a computer B. It eliminates the need for testing C. It focuses on logic without being distracted by syntax details D. It automatically generates source code Answer: C Explanation: Pseudocode expresses algorithmic ideas clearly, abstracting away language‑specific syntax. Question 35. Which of the following statements about “recursion” is true? A. Recursion always uses more memory than iteration B. A recursive function must have at least one base case to terminate C. Recursion cannot be used for divide‑and‑conquer algorithms D. Recursion is only applicable to sorting problems Answer: B Explanation: The base case prevents infinite calls and ensures termination. Question 36. Which of the following best illustrates “modularity” in software design? A. Writing one gigantic function that does everything
Explanation: Big O abstracts performance by focusing on the dominant term that bounds runtime or space usage. Question 39. Which of the following data structures is most appropriate for implementing a “undo” feature in a text editor? A. Queue B. Stack C. Binary tree D. Hash map Answer: B Explanation: A stack stores actions in LIFO order, allowing the most recent change to be undone first. Question 40. In a flowchart, which symbol typically represents a decision point? A. Rectangle B. Oval C. Diamond D. Parallelogram Answer: C Explanation: Diamonds denote branching based on a condition. Question 41. Which of the following is an example of an “unambiguous” problem statement? A. “Make the program fast.”
B. “Given an array of n integers, output the sum of all even numbers.” C. “Create a cool app.” D. “Write code that works on any computer.” Answer: B Explanation: This statement precisely defines inputs, required processing, and expected output. Question 42. When modeling a population growth using a simple exponential model, which assumption is commonly made? A. Resources are unlimited B. Birth and death rates are zero C. The population size stays constant D. Individuals migrate constantly Answer: A Explanation: Exponential growth assumes no limiting factors, i.e., unlimited resources. Question 43. Which of the following is a key benefit of using an “abstract data type” (ADT) rather than a concrete implementation directly? A. Faster execution speed in all cases B. Ability to change the underlying implementation without affecting client code C. Guarantees of zero memory usage D. Automatic parallelization Answer: B
B. CT techniques such as decomposition and abstraction can be applied in biology, economics, and art C. CT replaces all other scientific methods D. CT is limited to writing software Answer: B Explanation: CT provides universal problem‑solving tools useful across many domains. Question 47. Which of the following statements about “space complexity” is correct? A. It measures the number of lines of code B. It quantifies the amount of memory an algorithm uses as a function of input size C. It is always larger than time complexity D. It only matters for recursive algorithms Answer: B Explanation: Space complexity evaluates memory consumption relative to input size. Question 48. Which of the following is an example of a “greedy” choice that leads to an optimal solution in the activity‑selection problem? A. Selecting the activity that finishes earliest among those that start after the last selected activity B. Choosing the longest activity first C. Randomly picking activities until none remain D. Selecting activities with the highest profit regardless of time Answer: A
Explanation: Picking the earliest‑finishing compatible activity yields an optimal schedule. Question 49. Which of the following best explains why “pattern recognition” is useful in algorithm design? A. It eliminates the need for testing B. Recognizing recurring structures allows reuse of proven algorithmic solutions C. It makes code run faster automatically D. It replaces the need for abstraction Answer: B Explanation: Identifying known patterns (e.g., sorting, searching) lets designers apply existing efficient algorithms. Question 50. Which of the following best illustrates the principle of “least privilege” in automated systems? A. Giving every user administrator rights B. Allowing a program to access only the data it needs to perform its task C. Disabling all security checks D. Sharing passwords among all employees Answer: B Explanation: Limiting access reduces the risk of misuse or accidental damage. Question 51. In a binary tree, which traversal order visits nodes in “root‑left‑right” sequence? A. In‑order