The exercise-1 editor asks you to traverse. These six ask which traversal the problem actually calls for and what breaks when the bounds are copied from a different one.
Applied Practice
6 questions · scenario driven · every answer is recorded for your teacher
Question 1 of 6Apply
A method must return true as soon as it finds a negative value in an array of 100000 elements.
Which traversal is best and why?
Incorrect. Two passes cannot beat one pass that stops early.
Incorrect. Correct answer, wasted work: it still visits all 100000 elements after the answer is settled.
Correct. Correct. Returning from inside the loop is the idiomatic early exit and the point of the question.
Incorrect. Counting every negative computes far more than the question asked for.
Question 2 of 6Analyze
A traversal must compare each element to the one after it, for an array of length n.
What is the correct loop bound?
Incorrect. On the last pass arr[i + 1] is out of bounds and throws.
Correct. Correct. When the body reaches ahead, the bound must retreat by exactly as far as it reaches.
Incorrect. Even further out of bounds than i < n.
Incorrect. Halving skips most pairs. Adjacent pairs overlap; they do not partition the array.
Question 3 of 6Apply
A program must print an array in reverse order.
Which loop header is correct?
Correct. Correct. Starts at the last legal index and stops after index 0 has been printed.
Incorrect. Stops one early and never prints arr[0].
Incorrect. Starts at 0 and decrements away from the bound, immediately going negative.
Incorrect. Starts one past the end and throws on the first access.
Question 4 of 6Analyze
A loop is meant to visit only the even-numbered positions 0, 2, 4 and so on.
Which approach is most direct?
Incorrect. The enhanced for cannot express a stride, so this reintroduces an index by hand.
Incorrect. Direction is irrelevant, and starting backward changes which positions are even.
Incorrect. Correct results, but it tests a condition on every element it was never going to use.
Correct. Correct. The step belongs in the loop header when the pattern is regular.
Question 5 of 6Evaluate
A student traverses with a while loop but forgets to increment the counter inside it.
What is the result?
Incorrect. The compiler has no way to know the loop was meant to advance.
Incorrect. Nothing ends the loop after one pass; the condition is still true.
Correct. Correct. This is why the for loop gathers all three parts into its header where an omission is visible.
Incorrect. The index never changes and never leaves bounds, so no exception is thrown. It simply hangs.
Question 6 of 6Apply
A method must total only the elements strictly greater than a given threshold.
Where does the accumulator belong?
Incorrect. Declaring it inside resets it every iteration, so the result is only ever the last qualifying value.
Correct. Correct. An accumulator must outlive the iteration that updates it.
Incorrect. Same defect as A, narrowed to qualifying elements. It still resets.
Incorrect. It cannot be filled after the loop; there is nothing left to iterate over.
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed.
Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Typically responds within 24 hours
✓
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
34.8% of Tanner’s CSP students score 5s. The national average is 9.6%.
I’m a Student
I’m a Teacher
✓Free AP CSP Big Ideas cheat sheet (PDF)
✓Daily practice questions covering all 5 Big Ideas
✓Create Task tips that actually work — from a real AP teacher
✓Free class codes with student progress tracking
✓3 full practice exams + Top 100 questions for your class
✓Create Task guidance and pseudocode reference sheets
Which AP CS exams are you prepping for?
✓
You’re in!
Your Big Ideas cheat sheet is on its way.
No thanks, I’ll figure it out myself
Avg student improvement: 2+ score levels | Real AP teacher, not just a tutor
AP Cybersecurity — National Launch 2026–27
Get Early Access to AP Cyber
AP Cyber launches nationally fall 2026. Get in early to help shape the course — start free with Unit 1 and the free teacher gradebook.
✓
You’re in — you’re on the AP Cyber early-access list!
Tanner will follow up personally within 48 hours. Your feedback will directly shape what gets built.
Step 1 of 4
Early Access — Limited Spots
Who are you?
Are you a teacher or a student?
I’m a Teacher
I’m a Student
Free to start — Unit 1 and the teacher gradebook are always free, no credit card.
Founding teachers unlock all 5 units and get direct input on what we build.
Not interested right now
Step 2 of 4
Your School
Tell us about your class
Other AP CS courses you teach
Your Situation
Tell us about yourself
Step 3 of 4
Classroom Needs
What does your classroom need? (select all that apply)
How You Study
What would help you most? (select all that apply)
Step 4 of 4
Almost Done
Where should we send your early-access details?
Free gradebook + Unit 1 | Your feedback shapes the course | Built by a real AP teacher