• FRQ Review: Test 2
  • What I Did Well
  • Where I Need to Improve
  • MCQ Review: Practice Test 2

    I learnt many valuable skills while taking this College Board Practice MC Exam, including:

    • Time management during the test (I accidentally spent too long on the initial questions and had to rush towards the end)
    • Code analysis in segments

    On this MC, I earned a 37/42. My analytics are as follows:

    After viewing my score, I checked the topic breakdowns to determine which big ideas I need to work on the most. My mistakes mainly centered in the Informal Run-Time Analysis topic, which falls under the Data Collections unit. Notably, my Class Creation score went up compared to last trimester, which is an improvement!

    Mistakes and Corrections

    Question 22

    Selected: "*" is printed n more times than "@".

    Correct: "*" is printed m more times than "@".

    I got this question wrong because I misread the letter in the answer choice (silly mistake).

    Question 34

    Selected:

    if (theMajor.equals(k.getMajor()))
    {
       count++;
    }
    sum += k.getAge();
    

    Correct:

    if (theMajor.equals(k.getMajor()))
    {
       sum += k.getAge();
       count++;
    }
    

    I got this question wrong because while I correctly identified all the parts of the loop, I placed them in wrong segments (I need to add to age within the actual loop).

    Question 35

    Selected: 17

    Correct: 26

    When I answered this question, I was rushing and beginning to stress; therefore, I got it wrong.

    Question 41

    Selected: Compare Values - 15 times, Assign to Temp - 6 times

    Correct: Compare Values - 15 times, Assign to Temp - 5 times

    I got this question wrong because I selected an incorrect number of times for Assign to Temp. I evaluated the Assign to Temp array as an element instead.

    Question 42

    Selected: ***** **** *** **

    Correct: ** *** **** *****

    I got this question wrong because I incorrectly read stars(num - 1) as the last line of the method instead of occurring before the print statements.

    FRQ Review: Test 2

    Working through these FRQs helped me realize that I mostly understand the logic behind problems. I can read a prompt, break it down, and figure out what needs to happen step by step. However, I struggle with remembering exact Java syntax and how to properly structure my code when writing it from memory.

    When I approach a problem, I can usually:

    • Identify what the method is supposed to accomplish
    • Determine what variables are needed
    • Recognize patterns like counting, searching, resetting, or comparing
    • Translate the word problem into logical steps

    But when it comes to actually writing the code, I hesitate because I forget small syntax details or how to format certain structures correctly.


    Question 1a: RobotMover Constructor

    In this problem, I understood that:

    • I needed to generate random moves
    • Each move had equal probability
    • Each move needed an underscore after it
    • I needed to repeat this numMoves times

    I understood the algorithm, but I struggled with recalling the exact syntax for generating random numbers and properly building the string. Eventually, with research, I came to the solution.

    public RobotMover(int numMoves)
    {
        moveSequence = "";
        
        String[] moves = {"up", "down", "left", "right"};
        
        for (int i = 0; i < numMoves; i++)
        {
            int randIndex = (int)(Math.random() * 4);
            moveSequence += moves[randIndex] + "_";
        }
    }
    

    Question 1b: countOccurrences Method

    Here, I understood that:

    • I needed to search for a substring
    • I had to count how many times it appeared
    • I had to allow overlapping matches
    • I could not modify the original string

    The logic made sense to me, but I struggled with remembering how to properly use indexOf() with a starting index and how to structure the loop correctly.

    public int countOccurrences(String str)
    {
        int count = 0;
        int index = 0;
    
        while (index <= moveSequence.length() - str.length())
        {
            int found = moveSequence.indexOf(str, index);
            
            if (found == -1)
            {
                break;
            }
    
            count++;
            index = found + 1;   // move forward to allow overlapping matches
        }
    
        return count;
    }
    

    Question 2: LapTracker

    In this problem, I understood that:

    • I needed to track the lap total
    • I needed to track how many times the method was called
    • After a certain number of calls, the count resets
    • The reset happens after returning the current total

    The logic was clear, but I hesitated with syntax related to instance variables and resetting values correctly. The corrected code is below. During the FRQ, I wrote incorrect code, but I was able to correct it afterwards as shown here.

    public class LapTracker
    {
        private int resetFrequency;
        private int lapCount;
        private int callCount;
    
        public LapTracker(int n)
        {
            resetFrequency = n;
            lapCount = 0;
            callCount = 0;
        }
    
        public int addLaps(int laps)
        {
            lapCount += laps;
            callCount++;
    
            int result = lapCount;
    
            if (callCount == resetFrequency)
            {
                lapCount = 0;
                callCount = 0;
            }
    
            return result;
        }
    }
    

    Question 3: PlayerAnalysis

    Here, I knew I needed to:

    • Compare each player’s score to a target
    • Track the smallest difference
    • Return the corresponding player ID
    • Not modify the list

    I understood that I needed to initialize using the first element, then loop through the rest. However, I sometimes second-guessed loop bounds and comparison syntax.

    public String playerWithClosestScore(int targetScore)
    {
        Player closestPlayer = playerList.get(0);
        int smallestDiff = Math.abs(closestPlayer.getScore() - targetScore);
    
        for (int i = 1; i < playerList.size(); i++)
        {
            Player current = playerList.get(i);
            int currentDiff = Math.abs(current.getScore() - targetScore);
    
            if (currentDiff < smallestDiff)
            {
                smallestDiff = currentDiff;
                closestPlayer = current;
            }
        }
    
        return closestPlayer.getID();
    }
    

    Question 4: WordGrid

    In this problem, I understood that:

    • I needed nested loops
    • I needed to compare string lengths
    • A row was valid if each length was greater than or equal to the previous
    • I had to count how many rows satisfied the condition

    The logic was straightforward, but writing nested loops from memory is still something I need more practice with.

    Code Placeholder

    public int countOrderedRows()
    {
        int count = 0;
    
        for (int r = 0; r < grid.length; r++)
        {
            boolean ordered = true;
    
            for (int c = 1; c < grid[r].length; c++)
            {
                if (grid[r][c].length() < grid[r][c - 1].length())
                {
                    ordered = false;
                }
            }
    
            if (ordered)
            {
                count++;
            }
        }
    
        return count;
    }
    

    What I Did Well

    • I consistently understood the algorithm before coding.
    • I could explain what needed to happen in plain language.

    Where I Need to Improve

    1. Syntax Fluency

    I need more practice writing:

    • For loops from memory
    • Nested loops
    • Method headers
    • Class structures
    • Built-in method calls

    2. Speed and Execution

    Even when I know the logic, I slow down because I:

    • Second-guess syntax and forget small details
    • Worry about missing parentheses or braces

    I need more timed practice to build fluency and capability.