DOWNLOAD PDF.
*Core Domains*
Primitive Types and ExpressionsProgram Design and Class ConstructionProgram Analysis and LogicArray and ArrayList
ManipulationInheritance and PolymorphismRecursion and Algorithmic EfficiencyEthical Computing and Data PrivacySoftware Development
Life Cycle
*Introduction*
This comprehensive assessment is designed to evaluate a candidate's mastery of the AP Computer Science A curriculum and foundational
software engineering principles. The purpose of this exam is to measure proficiency in object-oriented programming, algorithmic analysis, and
structured problem-solving. Through a combination of technical multiple-choice questions and complex scenario-based queries, this exam
assesses both theoretical knowledge and the ability to apply coding standards to real-world software challenges. Candidates are expected to
demonstrate critical thinking, logical deduction, and an understanding of ethical considerations, ensuring that all solutions prioritize efficiency,
maintainability, and strict adherence to professional programming standards.
SECTION ONE: QUESTIONS 1–100
1. Which of the following best describes the result of integer division in Java when both operands are positive?
A. The result is rounded to the nearest whole number.
B. The fractional part is truncated, leaving only the quotient.
C. The result is promoted to a double automatically.
D. A compilation error occurs if the result is not an integer.
🟢B
🔴 RATIONALE: In Java, integer division discards any remainder, effectively truncating the decimal portion and returning the integer
quotient.
,2. Which access modifier restricts visibility to the same class only?
A. public
B. protected
C. private
D. static
🟢C
🔴 RATIONALE: The private modifier ensures that members are only accessible within the class they are defined in, enforcing
encapsulation.
3. What is the output of System.out.println("5" + 5);?
A. 10
B. 55
C. 5 5
D. Compilation error
🟢B
🔴 RATIONALE: The expression involves string concatenation; the integer 5 is converted to a string and appended to "5".
4. Which data structure is most appropriate for a Last-In-First-Out (LIFO) requirement?
A. ArrayList
B. Array
C. Stack
D. Queue
🟢C
🔴 RATIONALE: A stack is a LIFO data structure where the last element added is the first one removed.
5. Which of the following is true regarding a subclass constructor?
A. It cannot call a superclass constructor.
B. It must call super() as its very first statement.
C. It automatically inherits private methods from the parent.
D. It must define all methods declared in the superclass.
🟢B
🔴 RATIONALE: A subclass constructor must explicitly or implicitly call a superclass constructor using super() as the first line to ensure
proper initialization.
6. If an array arr is initialized as int[] arr = new int[5];, what is the value of arr[2]?
A. 1
, B. null
C. 0
D. Undefined
🟢C
🔴 RATIONALE: In Java, numeric arrays are initialized with default values, which for integers is 0.
7. Which principle allows a subclass to provide a specific implementation of a method already defined in its superclass?
A. Overloading
B. Encapsulation
C. Overriding
D. Abstraction
🟢C
🔴 RATIONALE: Method overriding allows a subclass to change the behavior of an inherited method to suit its specific needs.
8. When is a static variable initialized?
A. When an instance of the class is created.
B. When the class is first loaded into memory.
C. Every time a method is called.
D. It is not initialized until explicitly assigned a value.
🟢B
🔴 RATIONALE: Static variables belong to the class rather than instances, so they are initialized when the class is loaded.
9. Which sorting algorithm typically has a worst-case time complexity of O(n^2)?
A. Merge Sort
B. Quick Sort
C. Selection Sort
D. Binary Search
🟢C
🔴 RATIONALE: Selection Sort compares and swaps elements in a nested loop structure, leading to quadratic time complexity.
10. What is the primary purpose of an interface in Java?
A. To provide multiple inheritance of state.
B. To define a contract that classes must implement.
C. To prevent a class from being instantiated.
D. To provide a concrete implementation for all methods.