2023 AP CSA FRQ 2: Sign Solution + Rubric

May 2026 exam uses a NEW point structure — tap for details

This page shows the original 2023 FRQ 2, which the College Board scored on a 9-point rubric. The May 2026 exam uses a NEW point distribution and structure — the patterns and traps on this page still apply, but expect different point values and formats on test day.

FRQ 1: 7 points (2 parts: Part A 4pts + Part B 3pts) — Methods & Control Structures

FRQ 2: 7 points (single part) — Class Design

FRQ 3: 5 points (single part) — Data Analysis with ArrayList

FRQ 4: 6 points (single part) — 2D Array

Total Section II: 25 points = 45% of exam score. Only Question 1 has two parts on the 2026 exam; Questions 2, 3, and 4 each have a single part.

Sources: Official College Board CED, Exam Overview (page 145) · Skylight Publishing CED Sample FR Solutions (page 161 reference)

2023 AP CSA FRQ 2: Sign — Complete Solution & Rubric

Step-by-step solution to 2023 AP CSA FRQ 2 (Sign) with the official 9-point rubric, common mistakes that cost points, and a built-in 22-minute practice timer. Written by an AP Computer Science teacher whose students earn 5s at more than 2x the national rate.

Year: 2023 Question: 2 of 4 Points: 9 Topics: Class Writing, Constructors Difficulty: Medium
Recommended pace: 22:00 per FRQ 22:00

The Official 2023 FRQ 2 Question

The complete prompt is in the PDF below. Use the recap above the editor to keep the key requirements in mind while you write your response.

The PDF cannot be embedded on this device.

Open Prompt PDF in New Tab

Write Your Sign Class Response

Read the prompt above and write your response in the editor. The real AP exam in Bluebook gives you the prompt and a blank editor — no requirement summary, no hints. Practice like that here. When you’re done, click Reveal Solution & Scoring Rubric below to compare your code against the official rubric.

Sign.java Tab indents | Enter auto-indents | Brackets auto-close
Drag bottom-right corner to resize editor ⇲

Ready to self-grade? Compare your code against the official 9-point rubric below. AP FRQs are graded by trained human readers, so we don’t auto-score — you’ll learn more by checking your work against the rubric criteria yourself.

What the Prompt Was Asking

Before reading the solution, check whether your response covered each of these requirements:

Write: public class Sign with constructor Sign(String, int), public int numberOfLines() and public String getLines()

Required behavior:

  • Class skeleton: public class Sign, private String for the message and private int for the width, constructor Sign(String, int) initializing both from parameters (no void return type!), method headers public int numberOfLines() and public String getLines() — both with no parameters.
  • numberOfLines: divide message.length() by width using integer division. If the length is evenly divisible (length % width == 0), return length / width. Otherwise add 1 to account for the partial last line: return length / width + 1.
  • getLines: handle the empty-string case by returning null. Otherwise build a String by looping with substring(i*width, (i+1)*width) chunks separated by semicolons. The LAST chunk has no trailing semicolon — append message.substring((linesNeeded - 1) * width) after the loop.

How to Write the Sign Class Step-by-Step

// Sample solution adapted from official scoring guidelines
// 2023 AP CSA FRQ 2: Sign (class-write, worth 9 points)

public class Sign {
    private String message;
    private int width;

    public Sign(String msg, int w) {
        message = msg;
        width = w;
    }

    public int numberOfLines() {
        if (message.length() % width == 0) {
            return message.length() / width;
        }
        return message.length() / width + 1;
    }

    public String getLines() {
        if (message.length() == 0) {
            return null;
        }
        int lines = numberOfLines();
        String result = "";
        // Loop through all but the last line, appending content + semicolon
        for (int i = 0; i < lines - 1; i++) {
            result += message.substring(i * width, (i + 1) * width) + ";";
        }
        // Append the final segment with NO trailing semicolon
        result += message.substring((lines - 1) * width);
        return result;
    }
}

Official 9-Point Scoring Rubric for Sign

Pts Criterion
+1 Class header public class Sign (no parens)
+1 Private instance variables initialized in constructor from parameters
+1 Constructor header Sign(String, int) with no return type
+1 Method headers public int numberOfLines() and public String getLines()
+1 numberOfLines divides message.length() by width
+1 numberOfLines returns appropriate value for partial last line (algorithm)
+1 getLines returns null for empty message
+1 Calls substring and length on String objects
+1 getLines constructs delimited output with NO trailing semicolon (algorithm)

Common Mistakes That Cost Points on FRQ 2

Mistake 1: Adding a semicolon at the end of every line, including the last. Sample 2B in the official commentary lost Point 9 because the algorithm doesn't properly handle the last line — the else block executes in every iteration, appending an extra semicolon at the end. The rubric explicitly says responses will not earn Point 9 if they 'end the constructed output with a ; or extraneous spaces.' The correct pattern: loop from i=1 to i < linesNeeded (NOT inclusive), then append the final chunk WITHOUT a semicolon after the loop.
Mistake 2: Adding length % width instead of 1 when handling the partial last line. Sample 2B in the official commentary lost Point 6 because instead of adding 1 in the partial-line case, the response added message.length() % width — which can be any value from 0 to width - 1. The correct formula adds exactly 1 when there's a remainder: if (len % width == 0) return len / width; else return len / width + 1.
Mistake 3: Class header includes parentheses (record-style syntax). Sample 2C in the official commentary lost Point 1 because the response includes parentheses in the class header. The class header is JUST public class Sign — no parentheses, no parameters. Parameters belong on the CONSTRUCTOR header. This is the same mistake that appeared on 2024 Q2 Scoreboard (Sample 2C) and 2025 Q2 SignedText (Sample 2C) — students collapse class and constructor into one line.
Mistake 4: Failing to handle the empty-message null case. Sample 2A and Sample 2B in the official commentary both lost Point 7 because getLines does not check for an empty string and return null appropriately. The prompt requires returning null when the message is empty. Add a guard at the START of getLines: if (linesNeeded == 0) return null; (or equivalently, check message.length() == 0 or message.equals('')).
Mistake 5: No constructor at all. Sample 2C in the official commentary lost Points 2 and 3 because the response declared private instance variables but provided no constructor to initialize them. Without a constructor, the parameters from the test code (Sign(String, int)) have nowhere to go — instance variables stay at default values (null and 0). Every Class Writing FRQ requires an explicit constructor that uses ALL provided parameters to initialize the instance variables.
Key Insight: The Sign problem teaches the loop-with-final-different-element pattern that dominates string-building algorithms in AP CSA. When you need a separator between elements (commas, semicolons, hyphens), the cleanest approach is: loop through all elements EXCEPT the last, appending element + separator each time, then append the final element WITHOUT a separator after the loop. Sample 2B lost Point 9 by treating the last line the same as every other line — its else block executed in every iteration, including the last, leaving an extra semicolon at the end. The fix is structural: stop the loop at i < linesNeeded - 1 (or i < linesNeeded with index starting at 1), then handle the final element separately. A second insight specific to Class Writing FRQs: the integer-division pattern len / width + 1 (with the +1 only when there's a remainder) is the standard 'ceiling division' for distributing items into fixed-size groups. Sample 2B lost Point 6 by computing the remainder VALUE instead of just checking IF there's a remainder. The pattern: if (len % width == 0) return len / width; else return len / width + 1; — equivalent to the formula (len + width - 1) / width. This appears on every FRQ that asks 'how many groups are needed to hold N items at K per group.'

FAQs About 2023 AP CSA FRQ 2

What does 2023 AP CSA FRQ 2 Sign test?

Sign tests writing a complete class with a String message, an int width, a constructor, numberOfLines (returns total lines needed when the message is broken into width-sized chunks), and getLines (returns the message broken into lines separated by semicolons, no trailing semicolon). The hardest single point is Point 9: the algorithm must correctly omit the trailing semicolon — Sample 2B in the official commentary lost Point 9 because its loop appended a semicolon at the end of every line, including the last.

How many points is FRQ 2 worth?

9 points, awarded across the rubric criteria. FRQ 2 makes up about 11% of the AP CSA exam score.

What is the most common mistake on 2023 FRQ 2 Sign?

Failing to add 1 to the line count when the message length isn't evenly divisible by width. Sample 2B in the official commentary lost Point 6 because numberOfLines added message.length() % width to the count instead of just adding 1 — the modulo expression could be much larger than 1, producing wildly wrong line counts. The correct pattern: if (length % width == 0) return length / width; else return length / width + 1;

How long should I spend on FRQ 2?

Aim for 22 minutes per FRQ. The AP CSA free-response section is 90 minutes for 4 questions, so 22 minutes per question leaves a 2-minute buffer to review.

Is Sign still relevant for the 2026 AP CSA exam?

Yes. The current AP CSA 4-unit curriculum still tests complete class writing with constructors and instance variables, so Sign is excellent practice for the 2026 exam format.

Where can I find the official scoring guidelines?

College Board publishes the official scoring guidelines as a PDF on AP Central. The rubric on this page mirrors those criteria. You can download the official scoring guidelines here.

Related AP CSA FRQs to Practice Next

If you found Sign useful, work through these next to lock in the same Java concepts:

Why 2023 FRQ 2 Still Matters for the 2026 AP CSA Exam

The 2026 AP CSA curriculum reorganized the topic list into 4 units, but the FRQ types stayed the same. 2023 FRQ 2 (Sign) tests complete class writing with constructors and instance variables, which is still a core part of the exam. Practicing this question prepares you for the Bluebook digital test format and builds the muscle memory you need for the exam on Friday, May 15, 2026.

Get in Touch

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.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]