AP Computer Science Principles Quiz: Parallel And Distributed Computing
20 questions · exam conditions
0:00
Parallel And Distributed ComputingQuestion 1 of 20

A program contains a setup task that must run first and takes 5 minutes. It then has 10 independent processing tasks, each of which takes 10 minutes to run on a single processor. Finally, a cleanup task must run last and takes 5 minutes.

If this program is run on a parallel system with 5 processors, what is the minimum total execution time?

30 minutes
25 minutes
110 minutes
22 minutes
← Back to quizzes

AP Computer Science Principles Quiz

AP Computer Science Principles Quiz: Parallel And Distributed Computing

Practice Parallel And Distributed Computing in AP Computer Science Principles with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.

What this quiz covers

This quiz focuses on Parallel And Distributed Computing, giving you a quick way to practice the rules, question types, and explanations that matter most for AP Computer Science Principles.

How to use this quiz

Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.

All questions

Question 1

A program contains a setup task that must run first and takes 5 minutes. It then has 10 independent processing tasks, each of which takes 10 minutes to run on a single processor. Finally, a cleanup task must run last and takes 5 minutes.

If this program is run on a parallel system with 5 processors, what is the minimum total execution time?

  1. 30 minutes (correct answer)
  2. 25 minutes
  3. 110 minutes
  4. 22 minutes

Explanation: The program has two sequential parts (setup and cleanup) and one parallel part (10 processing tasks). First, the setup runs sequentially for 5 minutes. Next, the 10 processing tasks run in parallel on 5 processors. Each processor will handle 10/5 = 2 tasks. Since each task takes 10 minutes, each processor will take 2 * 10 = 20 minutes. The parallel part takes 20 minutes. Finally, the cleanup runs sequentially for 5 minutes. The total time is 5 (setup) + 20 (parallel) + 5 (cleanup) = 30 minutes. (C) is the sequential time. (B) and (D) are incorrect calculations.

Question 2

A programmer is trying to improve the performance of a data analysis program by using parallel computing. After rewriting the code to use 8 processors instead of 1, they notice the program is only 3 times faster, not 8 times faster. Which of the following is the most likely explanation for this?

  1. The program contains a sequential portion that cannot be parallelized, limiting the overall speedup. (correct answer)
  2. The processors used in the parallel solution are slower than the single processor used in the sequential solution.
  3. Distributed computing would have been a better model for this problem than parallel computing.
  4. The program requires more data storage when run in parallel, which slows down the execution time.

Explanation: The efficiency of a parallel solution is limited by the portion of the program that must be executed sequentially. This sequential part creates a bottleneck, preventing the speedup from being directly proportional to the number of processors. (B) is a possible but less fundamental reason; the question implies identical processing power. (C) is not necessarily true and doesn't explain the specific observation. (D) is not a primary reason for the limitation of speedup.

Question 3

Refer to the text: Genome sequencing pipelines split read alignment into many independent chunks, then merge partial matches; processors must synchronize to avoid duplicate counting. How does parallel computing improve processing speed?

  1. By dividing alignment work into chunks processed simultaneously, then merging results efficiently. (correct answer)
  2. By moving data to distant nodes over the internet, which always accelerates computation.
  3. By ensuring node failures never occur, so no time is lost to recovery procedures.
  4. By replacing algorithmic steps with manual verification to increase accuracy and speed.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically how parallel computing achieves speed improvements in genome sequencing pipelines. Parallel computing divides a single task into smaller subtasks that can be processed simultaneously by multiple processors, then combines the results to complete the original task faster. In this passage, parallel computing is illustrated through genome sequencing pipelines that split read alignment into many independent chunks processed simultaneously, with processors synchronizing to avoid duplicate counting when merging results. Choice A is correct because it accurately describes how parallel computing improves processing speed by dividing alignment work into chunks processed simultaneously, then merging results efficiently - this is the fundamental speedup mechanism of parallel computing. Choice B is incorrect because it describes moving data to distant nodes over the internet, which relates to distributed computing and actually introduces network latency rather than improving speed. To help students: Use the analogy of multiple workers assembling parts of a product simultaneously versus one worker doing everything sequentially. Demonstrate speedup calculations showing how parallel processing reduces time. Watch for: confusion between parallel speedup (simultaneous processing) and distributed computing characteristics.

Question 4

Refer to the text: In genome sequencing, distributed computing stores reads across networked nodes and uses message passing; if one node fails, other nodes continue and data can be re-copied. How does distributed computing enhance fault tolerance?

  1. By keeping computation on one machine so failures cannot spread across a network.
  2. By requiring constant shared-memory access, preventing any single component from failing.
  3. By replicating data and rerouting tasks so other nodes continue when one node fails. (correct answer)
  4. By guaranteeing perfect accuracy in every alignment, eliminating the impact of hardware faults.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically how distributed computing provides fault tolerance in genome sequencing applications. Distributed computing involves multiple independent systems connected via network that can continue operating even when individual nodes fail, unlike parallel computing which typically operates within a single system. In this passage, distributed computing is illustrated through genome sequencing that stores reads across networked nodes using message passing, with the ability to re-copy data and continue when nodes fail. Choice C is correct because it accurately describes how distributed computing enhances fault tolerance by replicating data and rerouting tasks so other nodes can continue when one node fails, which is the fundamental mechanism of fault tolerance in distributed systems. Choice B is incorrect because it describes shared-memory access, which is characteristic of parallel computing within a single system, not distributed computing across networked nodes. To help students: Emphasize that fault tolerance in distributed systems comes from redundancy and independence of nodes. Use real-world examples like cloud storage services that continue working even when servers fail. Watch for: confusion between parallel computing's shared memory and distributed computing's message passing architectures.

Question 5

Refer to the text: Parallel genome alignment requires frequent synchronization to combine partial results; distributed computing communicates through messages and tolerates higher communication delays. What is a key difference between parallel and distributed computing?

  1. Parallel typically uses lower-latency internal communication; distributed typically uses higher-latency network messaging. (correct answer)
  2. Parallel forbids task splitting; distributed requires every task to be identical.
  3. Parallel is inherently fault tolerant; distributed cannot recover from node failures.
  4. Parallel applies only to storage; distributed applies only to computation.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically the communication characteristics that distinguish these two computing paradigms. Parallel computing typically uses fast, low-latency communication within a single system, while distributed computing must handle higher-latency network communication between separate nodes. In this passage, the distinction is illustrated through parallel genome alignment requiring frequent synchronization to combine partial results (implying fast, local communication) versus distributed computing communicating through messages and tolerating higher communication delays. Choice A is correct because it accurately identifies that parallel computing typically uses lower-latency internal communication while distributed computing typically uses higher-latency network messaging, which is a fundamental architectural difference. Choice C is incorrect because it reverses the fault tolerance characteristics - distributed computing is inherently more fault tolerant due to node independence, while parallel computing within one machine is more vulnerable to system-wide failures. To help students: Demonstrate communication speed differences using examples like CPU cache access (nanoseconds) versus network packets (milliseconds). Explain how these differences affect algorithm design. Watch for: students confusing which system has better fault tolerance or misunderstanding the impact of communication latency.

Question 6

Refer to the text: In parallel genome alignment, processors must coordinate when merging partial matches; excessive coordination can reduce speed gains. Which statement best captures a limitation implied by the passage?

  1. Parallel computing cannot run genome sequencing because it never allows task division.
  2. Communication and synchronization overhead can constrain parallel speedup as processors increase. (correct answer)
  3. Distributed computing eliminates all communication delays by using shared memory across nodes.
  4. Fault tolerance is irrelevant in genomics because hardware failures never occur in practice.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically the limitations of parallel computing due to coordination overhead. Parallel computing's speedup is limited by the need for processors to communicate and synchronize, which becomes more significant as the number of processors increases, following Amdahl's Law. In this passage, this limitation is illustrated through parallel genome alignment where processors must coordinate when merging partial matches, and excessive coordination can reduce speed gains. Choice B is correct because it accurately captures that communication and synchronization overhead can constrain parallel speedup as processors increase, which is a fundamental limitation of parallel computing. Choice A is incorrect because it claims parallel computing cannot run genome sequencing or allow task division, which contradicts the passage that explicitly describes parallel genome sequencing through task division. To help students: Introduce Amdahl's Law mathematically and show how even small sequential portions limit speedup. Use examples where adding more processors provides diminishing returns. Watch for: students thinking parallel computing has no limitations or misunderstanding that coordination overhead increases with processor count.

Question 7

Refer to the text: genome sequencing uses parallel computing for rapid per-read analysis and distributed computing for cluster-wide throughput. What is a key difference between parallel and distributed computing?

  1. Parallel computing coordinates processors within a single system, while distributed computing coordinates multiple nodes over a network. (correct answer)
  2. Parallel computing depends on geographic separation, while distributed computing requires one shared cache.
  3. Parallel computing is inherently fault tolerant, while distributed computing fails whenever one node fails.
  4. Parallel computing cannot be used in science, while distributed computing is only for science.

Explanation: This question tests understanding of the fundamental distinction between parallel and distributed computing architectures. Parallel computing coordinates multiple processors within a single computer system, typically sharing memory or connected by fast internal links, while distributed computing coordinates multiple independent computer systems (nodes) connected over a network. In this passage, genome sequencing uses parallel computing for rapid per-read analysis on one system and distributed computing for cluster-wide throughput across multiple systems. Choice A is correct because it accurately states this key architectural difference—parallel computing works within a single system while distributed computing spans multiple networked nodes. Choice C is incorrect because it reverses the fault tolerance characteristics—distributed computing is generally more fault tolerant than parallel computing due to node independence. To help students: Always start with the physical architecture distinction—one system versus multiple systems. Create clear visual representations showing the boundary of a single system versus multiple networked systems. Watch for: misconceptions about which architecture provides better fault tolerance or assumptions about application domains.

Question 8

Based on the passage: Distributed genome workflows replicate data across nodes so alignments can resume after failures; parallel workflows focus on coordinated processors within one machine. How does distributed computing enhance fault tolerance?

  1. By preventing failures through faster processors, so recovery mechanisms are unnecessary.
  2. By using a single shared disk, ensuring all nodes depend on one storage device.
  3. By duplicating data and reassigning tasks when a node becomes unavailable. (correct answer)
  4. By merging partial results more frequently, which guarantees nodes cannot crash mid-task.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically how distributed computing achieves fault tolerance through redundancy and task reassignment. Distributed computing's fault tolerance comes from data replication across independent nodes and the ability to reassign work when nodes fail, unlike parallel computing which typically operates within a single failure domain. In this passage, distributed genome workflows are shown to replicate data across nodes so alignments can resume after failures, contrasting with parallel workflows that focus on coordinated processors within one machine. Choice C is correct because it accurately describes how distributed computing enhances fault tolerance by duplicating data and reassigning tasks when a node becomes unavailable, which are the core mechanisms of fault tolerance in distributed systems. Choice B is incorrect because using a single shared disk would create a single point of failure, eliminating fault tolerance rather than enhancing it - the opposite of distributed computing principles. To help students: Explain redundancy concepts using examples like RAID arrays or backup systems. Demonstrate how task reassignment works when nodes fail in distributed systems. Watch for: students confusing fault tolerance mechanisms with performance optimization or thinking shared resources improve fault tolerance.

Question 9

Based on the passage: Parallel genome alignment uses many processors in one system with tight coordination; distributed systems use separate nodes communicating over a network and can keep running during node failures. What is a key difference between parallel and distributed computing?

  1. Parallel uses networked nodes; distributed uses shared memory inside one machine.
  2. Parallel relies on local processor coordination; distributed relies on message-based network communication. (correct answer)
  3. Parallel exists only for small data sets; distributed exists only for large data sets.
  4. Parallel eliminates communication needs; distributed eliminates the need for task distribution.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically the key architectural differences between these two computing paradigms. Parallel computing uses multiple processors within one system with shared memory and tight coordination, while distributed computing uses separate networked nodes that communicate through message passing. In this passage, the distinction is illustrated through genome alignment using many processors in one system with tight coordination (parallel) versus separate nodes communicating over a network with fault tolerance capabilities (distributed). Choice B is correct because it accurately identifies that parallel computing relies on local processor coordination within one machine, while distributed computing relies on message-based network communication between separate nodes. Choice A is incorrect because it reverses the characteristics - parallel computing uses shared memory inside one machine, not networked nodes, which is a fundamental misconception students often have. To help students: Create comparison charts showing parallel (one machine, multiple processors, shared memory) versus distributed (multiple machines, network communication, message passing). Practice categorizing real computing scenarios. Watch for: students reversing the characteristics or thinking the difference is only about data size.

Question 10

Based on the passage: A lab uses a supercomputer where many processors share fast internal links for genome alignment; another lab uses a cluster of separate machines that exchange messages and replicate data. Which scenario best exemplifies distributed computing?

  1. One computer splits alignment across its processors and merges results through shared coordination.
  2. A single processor runs all alignments sequentially to avoid synchronization overhead.
  3. Multiple networked nodes store read subsets, exchange messages, and continue if one node fails. (correct answer)
  4. A faster algorithm alone replaces computation, removing the need for additional hardware.

Explanation: This question tests understanding of parallel and distributed computing concepts, specifically identifying which scenario exemplifies distributed computing versus parallel computing. Distributed computing involves multiple independent computers (nodes) connected via network, each with its own processor and memory, communicating through message passing and providing fault tolerance. In this passage, two scenarios are presented: a supercomputer with processors sharing fast internal links (parallel) and a cluster of separate machines exchanging messages with data replication (distributed). Choice C is correct because it accurately describes distributed computing - multiple networked nodes that store read subsets, exchange messages, and can continue operating if one node fails, which are the defining characteristics of distributed systems. Choice A is incorrect because it describes parallel computing - one computer splitting work across its processors with shared coordination, which is characteristic of parallel systems within a single machine. To help students: Emphasize the physical separation of machines in distributed computing versus multiple processors in one machine for parallel computing. Use diagrams showing network connections between separate computers versus internal processor connections. Watch for: students focusing on task division rather than system architecture when distinguishing between parallel and distributed computing.

Question 11

A research project requires analyzing vast amounts of astronomical data. The work is divided and sent to thousands of volunteers' personal computers around the world to process during their idle time. Which computational model does this scenario best illustrate?

  1. Sequential computing, because each computer processes its data chunk in order.
  2. Fault-tolerant computing, because if one computer fails, the system can still continue processing data on other machines.
  3. Parallel computing, because multiple processors within a single supercomputer are working on the data simultaneously.
  4. Distributed computing, because multiple independent devices are being used to run parts of the same program. (correct answer)

Explanation: This is a classic example of distributed computing, where a task is spread across multiple, geographically separate computers connected by a network. (A) is incorrect because the overall project is not sequential. (B) describes a characteristic of this system but not the fundamental computational model. (C) is incorrect because the scenario describes using many separate personal computers, not a single supercomputer.

Question 12

A program consists of four independent tasks. On a single processor, Task W takes 10 seconds, Task X takes 20 seconds, Task Y takes 30 seconds, and Task Z takes 40 seconds.

If the program is run on a computer with two identical processors that can run in parallel, what is the minimum time to execute all four tasks?

  1. 50 seconds (correct answer)
  2. 60 seconds
  3. 70 seconds
  4. 100 seconds

Explanation: To minimize the total time, the tasks should be distributed as evenly as possible between the two processors. Processor 1 can take Task Z (40s). Processor 2 can take Task Y (30s). Then, Processor 1 can take Task W (10s) after it finishes Task Z, for a total of 50s. Processor 2 can take Task X (20s) after it finishes Task Y, for a total of 50s. The entire program finishes when the last processor finishes, which is at 50 seconds. Another optimal distribution is Processor 1: Z (40s) + W (10s) = 50s; Processor 2: Y (30s) + X (20s) = 50s. The total time is 50 seconds. (D) is the sequential time. (B) and (C) represent non-optimal task distributions.

Question 13

A video rendering task takes 24 minutes to complete using a sequential computing solution on a single processor. By using a parallel computing solution with four processors, the same task is completed in 6 minutes. What is the speedup of the parallel solution?

  1. 0.25
  2. 4 (correct answer)
  3. 18
  4. 30

Explanation: Speedup is calculated as the time it took to complete the task sequentially divided by the time it took to complete the task in parallel. In this case, Speedup = 24 minutes / 6 minutes = 4. (A) is the inverse calculation. (C) is the difference in time. (D) is the sum of the times.

Question 14

A program has a sequential portion that takes 10 seconds to run. The rest of the program consists of a single large task that takes 80 seconds on one processor. This large task can be perfectly split among multiple processors.

If the program is run using a parallel solution with four processors, what will be the total execution time?

  1. 20 seconds
  2. 22.5 seconds
  3. 30 seconds (correct answer)
  4. 90 seconds

Explanation: The total time for a parallel solution is the time for its sequential tasks plus the time for the longest of its parallel tasks. The sequential portion is 10 seconds. The parallelizable task takes 80 seconds on one processor, so with four processors, it will take 80 / 4 = 20 seconds. The total time is 10 seconds (sequential) + 20 seconds (parallel) = 30 seconds. (A) ignores the sequential part. (B) is the total sequential time (90s) divided by 4. (D) is the total sequential time.

Question 15

A computation is split into 10 equal, independent tasks. A sequential system takes 100 seconds to complete all tasks. A parallel system with 10 processors is used to run the same computation.

Assuming no overhead from parallelization, what is the execution time of the parallel system?

  1. 10 seconds (correct answer)
  2. 50 seconds
  3. 90 seconds
  4. 100 seconds

Explanation: If the sequential system takes 100 seconds for 10 equal tasks, each task takes 100 / 10 = 10 seconds. Since there are 10 processors and 10 independent tasks, each processor can take one task. All tasks will run simultaneously and finish in 10 seconds. The total time for the parallel system is the time it takes for the longest task to complete, which is 10 seconds.

Question 16

A program consists of five tasks to be executed. Task 1 (10 ms) must be completed before any other task can start. Tasks 2 (20 ms), 3 (30 ms), and 4 (40 ms) are independent of each other but depend on Task 1. Task 5 (15 ms) can only start after Tasks 2, 3, and 4 are all complete.

What is the minimum execution time for this program using a system with three processors running in parallel?

  1. 65 ms (correct answer)
  2. 75 ms
  3. 85 ms
  4. 115 ms

Explanation: The program has two sequential portions (Task 1 and Task 5) and a parallel portion (Tasks 2, 3, 4). First, Task 1 runs sequentially: 10 ms. Then, Tasks 2, 3, and 4 can run in parallel on the three processors. The time for this parallel portion is determined by the longest task, which is Task 4 at 40 ms. After these are done, Task 5 runs sequentially: 15 ms. The total time is 10 ms (Task 1) + 40 ms (longest of parallel tasks) + 15 ms (Task 5) = 65 ms. (D) is the total sequential time.

Question 17

A sequential program is converted to a parallel program. The speedup of the parallel solution is defined as the time taken by the sequential program divided by the time taken by the parallel program. If a parallel program using 8 processors has a speedup of 8, what can be concluded?

  1. The problem has no sequential portion and was perfectly parallelizable. (correct answer)
  2. The parallel program has a bug, as speedup cannot equal the number of processors.
  3. The sequential program was inefficiently written, making the speedup seem larger.
  4. The parallel program requires significantly more memory than the sequential program.

Explanation: A speedup that is equal to the number of processors is called linear speedup. This is the theoretical maximum and is only achievable if the entire problem can be perfectly divided into independent parts with no overhead for communication or synchronization, meaning it has no sequential portion. (B) is incorrect; this is the ideal, though rare, outcome. (C) is a possibility in the real world but (A) is the direct computational conclusion. (D) is not related to the concept of speedup.

Question 18

A city wants to optimize its traffic light system by analyzing a year's worth of traffic data from thousands of sensors. The dataset is several terabytes in size. Why would a distributed computing model be more suitable for this task than a single high-performance computer?

  1. A distributed system can process the massive dataset in parallel across many machines, reducing the overall time required. (correct answer)
  2. A single computer is incapable of performing the complex mathematical calculations required for traffic analysis.
  3. Distributed computing uses a special algorithm that guarantees finding the most optimal traffic patterns.
  4. A single computer cannot be connected to the Internet, which is required to access the sensor data.

Explanation: The primary challenge here is the massive size of the dataset. Distributed computing allows the data and the processing to be spread across many machines, which can work in parallel to analyze their portion of the data, significantly speeding up the task. A single computer, even a powerful one, might take an impractically long time. (B) is incorrect, as a single computer is capable of the math, just not on that scale in a reasonable time. (C) is incorrect, as no model guarantees optimality. (D) is incorrect.

Question 19

A computer system uses two processors to run a program. The program has two tasks. Task A takes 30 seconds. Task B takes 50 seconds. The two tasks are independent and can be run in parallel.

What is the total time it will take for the system to complete the program?

  1. 20 seconds
  2. 30 seconds
  3. 50 seconds (correct answer)
  4. 80 seconds

Explanation: When independent tasks are run in parallel, the total execution time is determined by the longest-running task. Processor 1 can run Task A (30s) and Processor 2 can run Task B (50s). The program is not finished until both tasks are complete. Since Task B is the longer task, the total time will be 50 seconds. (D) would be the time if the tasks were run sequentially. (B) is the time for the shorter task. (A) is the difference in times.

Question 20

Refer to the text: in genome sequencing, distributed nodes communicate via network messages, unlike tightly coupled parallel processors. What is a key difference between parallel and distributed computing?

  1. Distributed systems usually require message passing, while parallel systems often use shared memory or fast links. (correct answer)
  2. Distributed systems cannot scale, while parallel systems scale indefinitely without coordination.
  3. Parallel systems communicate only through the public internet, while distributed systems never communicate.
  4. Parallel computing is defined as any computing that uses electricity, unlike distributed computing.

Explanation: This question tests understanding of communication differences between parallel and distributed computing architectures. Parallel computing typically uses shared memory or fast interconnects for processor communication within a single system, while distributed computing relies on network message passing between separate nodes. In this passage, genome sequencing explicitly contrasts distributed nodes communicating via network messages with tightly coupled parallel processors. Choice A is correct because it accurately identifies this key distinction—distributed systems require message passing while parallel systems often use shared memory or fast links. Choice C is incorrect because it makes false claims about communication methods—parallel systems don't exclusively use public internet, and distributed systems must communicate to function. To help students: Create comparison charts showing communication methods for each architecture. Emphasize that communication method follows from physical architecture—close processors can share memory, distant nodes cannot. Watch for: oversimplification of communication patterns or absolute statements about what each system can or cannot do.