SAT / PSAT
SAT / PSAT Prep
History & Social Science
AP World History AP US History AP European History AP Human Geography AP US Government & Politics AP Psychology AP Macroeconomics AP Microeconomics
English
AP English Language & Composition AP English Literature & Composition
Math & Computer Science
AP Calculus AB/BC AP Precalculus AP Statistics AP Computer Science A AP Computer Science Principles
Sciences
AP Biology AP Chemistry AP Environmental Science AP Physics 1 AP Physics 2
World Languages & Arts
AP Spanish Language AP Art History AP Music Theory Start studying →
Unit 2 · Selection & Iteration Flashcards Cheat Sheet Essentials Visual Review MC Practice FRQ Practice

AP Computer Science A Unit 2 Practice Questions

35 multiple-choice questions in College Board exam style. Each has four choices and a full explanation of why each option is right or wrong.

← Back to Unit 2 hub
Question 1 of 35 Score: 0/0

Strategy tips

Trace loops by hand: write down the loop variable and any accumulators at each step.

Check the boundary: < vs. <= decides whether the last value is included.

Apply short-circuit rules for && and ||, and use De Morgan’s laws to simplify negations.

Read the explanations even when you got it right, and watch for infinite and off-by-one loops.