FRQ workshop: the 4 question types
The free-response section
- The AP CSA exam has multiple-choice and free-response sections. In the current format, you enter both kinds of answers in the Bluebook app; free response asks you to write Java code.
- The current free-response section has 4 questions (FRQs). The four focus areas below describe the current format; check the official exam page for your exam year.
- This lesson is a quick map of the 4 types. Knowing the pattern makes the exam much less scary. You can do this!
Type 1: Methods and Control Structures
- Question 1 currently asks for two methods, or a constructor and a method, in a supplied class. Part A uses iteration, selection or both and calls methods; Part B calls
Stringmethods. - The surrounding class is supplied. Follow each requested method or constructor header and its specification.
- The short counting example below practises one useful skill; it is not a complete current Question 1. Also practise constructors, method calls and
Stringoperations.
public class Grades {
// Count the scores that are 60 or more.
public static int countPassing(int[] scores) {
int count = 0;
for (int s : scores) {
if (s >= 60) {
count = count + 1;
}
}
return count;
}
public static void main(String[] args) {
int[] scores = {72, 40, 95, 60, 33};
System.out.println(countPassing(scores)); // 3
}
}
Type 2: Class Design
- You are given a description of a class and must write the whole class.
- That means: instance variables, a constructor, and the methods they ask for.
- Remember
privatefields, the constructor with the same name as the class, andthis.field = field. Lesson 6 covers this.
public class Student {
private String name;
private int score;
public Student(String name, int score) {
this.name = name;
this.score = score;
}
public int getScore() {
return score;
}
}
Type 3: Data analysis with ArrayList
- Question 3 currently asks you to write a method that uses, analyses and manipulates data in an
ArrayList. Array traversal is useful preparation, but the current focus isArrayList. - Common jobs: find a value, count items, remove items, or build a new list.
- Watch the index carefully when you remove while looping. Lessons 9–11 cover this.
// Count the Strings longer than 3 letters.
int count = 0;
for (int i = 0; i < words.size(); i++) {
if (words.get(i).length() > 3) {
count++;
}
}
return count;
Type 4: 2-D Array
- You work with a 2-D array (a grid of rows and columns).
- You use nested loops: an outer loop for rows, an inner loop for columns.
- Common jobs: sum a row, sum a column, find the largest value, or count matches. Lesson 12 covers this.
// Add up every value in the grid.
int total = 0;
for (int r = 0; r < grid.length; r++) {
for (int c = 0; c < grid[r].length; c++) {
total += grid[r][c];
}
}
return total;
Exam strategy: read carefully
- Read the whole question first. Underline what the method must return and what its parameters are.
- Look at the example table they give. It shows exactly what your code should produce.
- Copy the method header they give you. Do not change its name, parameters, or return type.
Exam strategy: write methods that work
- Write the base of a loop first, then fill in the body. Get it running in your head step by step.
- Traverse correctly: start the index at
0, stop atlength(orsize()); check the edges. - Use
returnwith the right type. If the header saysint, return anint.
Exam strategy: small wins add up
- You get points for parts that work, even if the whole method is not perfect. Always write something.
- Use only Java you know from this course. Simple, correct code beats clever code.
- Check your work with the example values from the question before you move on.
You are ready
- The current focus areas are methods and control, class design, ArrayList data analysis, and 2-D arrays. Exam formats can change; use the official page for the year you are taking.
- Use the earlier lessons to review the relevant operations, then practise complete released questions and compare with their official scoring guidelines. The tasks here are focused practice, not official AP questions or a prediction of your AP score.
- Stay calm, read carefully, and write the code you know. Good luck on the exam!
Common mistakes
- Match the method header exactly: the return type and the parameters.
- Read the whole prompt before you start coding.
Now you try
- Try one FRQ-style method yourself — the same shape as Type 1 above.
- Press Check answer to compile and run it on the server.
Difficulty 5/5 · 400 coins + a small bonus on first completion today
FRQ practice — Type 1 (Methods). Complete countAtLeast(int[] scores, int limit) so it returns how many values in scores are at least limit (greater than or equal). Use a loop and an if, like the worked example above.
Click Run to see the output here.
Difficulty 5/5 · 400 coins + a small bonus on first completion today
FRQ practice — Type 2 (Class design). Complete the Rectangle class: store width and height from the constructor, and finish area() so it returns width × height. This practises constructor and method implementation; a complete official question can include more requirements.
Click Run to see the output here.
Difficulty 5/5 · 400 coins + a small bonus on first completion today
Complete countLong(ArrayList<String> words, int limit) to count strings whose length is strictly greater than limit. The list and its strings are non-null; an empty list returns 0. This is focused ArrayList practice, not a complete official FRQ.
Click Run to see the output here.
Difficulty 5/5 · 400 coins + a small bonus on first completion today
Complete countNegative(int[][] grid) to count values less than 0 across all rows. Rows are non-null but may have different lengths or be empty; the grid itself may have no rows. Do not change the grid.
Click Run to see the output here.