APCSP Computational Thinking Practices 2 — Questions and Answers
Question 1: A programmer notices that a function she wrote to find the maximum value in a list returns the wrong answer when the list contains duplicate values. Which computational thinking practice is she applying when she identifies and isolates this specific scenario?
- Abstraction
- Debugging (Correct answer)
- Decomposition
- Generalization
Correct answer: Debugging
Debugging involves identifying, isolating, and correcting errors in a program, including finding edge cases like duplicate values.
Question 2: Which of the following best describes the concept of 'abstraction' in computational thinking?
- Breaking a problem into smaller sub-problems
- Removing unnecessary details to focus on essential features (Correct answer)
- Repeating a set of instructions multiple times
- Translating a solution into a specific programming language
Correct answer: Removing unnecessary details to focus on essential features
Abstraction means hiding irrelevant details and focusing only on the information necessary to solve the problem at hand.
Question 3: A student wants to simulate how a virus spreads through a school. She models each student as a node and each contact as an edge. What type of computational model is she using?
- Sequential model
- Graph-based model (Correct answer)
- Relational model
- Regression model
Correct answer: Graph-based model
A graph-based model uses nodes and edges to represent relationships, making it ideal for modeling contact networks like disease spread.
Question 4: Which of the following is an example of 'decomposition' as a computational thinking strategy?
- Writing pseudocode for an entire program at once
- Splitting a music app into separate modules for playback, search, and playlists (Correct answer)
- Combining two programs into a single function
- Testing an algorithm on a very large dataset
Correct answer: Splitting a music app into separate modules for playback, search, and playlists
Decomposition is the process of breaking a complex problem or system into smaller, more manageable parts.
Question 5: When evaluating a computational artifact, a student considers whether the program produces the correct output for all possible inputs, including unexpected ones. What practice does this represent?
- Collaboration
- Testing and verification (Correct answer)
- Documentation
- Optimization
Correct answer: Testing and verification
Testing and verification involves running a program against various inputs, including edge cases, to confirm it behaves correctly.
Question 6: A team of students is building an app. One student handles the user interface, another manages the database, and a third writes the core logic. Which computational thinking practice does this workflow reflect?
- Abstraction
- Iteration
- Decomposition with collaboration (Correct answer)
- Pattern recognition
Correct answer: Decomposition with collaboration
Dividing a project into distinct roles combines decomposition (breaking the problem apart) with collaboration (working together).
Question 7: Which of the following scenarios best demonstrates 'pattern recognition' in computational thinking?
- Writing a loop to repeat instructions 10 times
- Noticing that sorting algorithms all require comparing elements (Correct answer)
- Using a variable to store a user's name
- Drawing a flowchart of a program's logic
Correct answer: Noticing that sorting algorithms all require comparing elements
Pattern recognition involves identifying similarities or recurring structures across different problems, such as recognizing that all sorting algorithms use comparisons.
A programmer notices that a function she wrote to find the maximum value in a list returns the wrong answer when the list contains duplicate values.
Which computational thinking practice is she applying when she identifies and isolates this specific scenario?