Skip to main content
BharatBoard

Last verified: 28 November 2026 across official school board and government recruitment portals.

BharatBoard is a private, independent guide. It does not represent any government entity and does not provide any government service. Information is summarised from official board and government websites.

Tap any MCQ option to check
Original practice paper. Not an official board paper.Session 2026–27

IB · Class 12 · Set 2

Computer Science

15 questions20 marks1 hour

Practice for IB 2026-27 assessments. Examination sessions run in May and November according to school registration.

Independent practice paper — verify on official board sources

Disclaimer: BharatBoard is an independent student and parent guide — not affiliated with, associated with, or endorsed by any Central Board, State Board, school, educational institution, recruitment commission, or government body, and does not represent any government entity. We recommend that you contact and verify all exam results, date sheets, syllabi, school admission dates, eligibility criteria, fee schedules, scholarships, and government job notifications directly with the respective school, institution, Central Board, State Board, or recruitment body via their official websites and notifications. These questions are original practice items for revision. Follow the official syllabus, the prescribed textbooks, and your school or institution. Model answers are a study aid. They are not an official marking scheme.

IB Class 12 Computer Science, Set 2, is an original BharatBoard revision set of 20 marks. It is shorter than a full board paper. The official syllabus and sample papers on the IB website remain the authority.

Timed Exam Mode

Official 60-minute writing countdown

01:00:00

General instructions & how to use this paper

  1. This revision set has 15 questions and 20 marks. Ten questions are one mark. Five questions are two marks. Attempt every question. A calculator is not needed.
  2. Timing is typical months only — always verify the exact dates on the official board website, which change every session.

Section A

· Multiple-choice questions

Attempt all ten 1-mark questions.

10 marks
Q1

In Object-Oriented Programming (OOP), declaring class attributes private and exposing controlled public getter/setter methods exemplifies:

1 mark

Model answer · Option C

Encapsulation hides internal representation details and lets mutator methods validate updates (e.g., rejecting negative account deposits) before modifying fields.

Q2

A CityLibrary object holds a list of Book objects; if the CityLibrary closes, those Book instances are transferred intact to regional branches. Which OOP relationship models this?

1 mark

Model answer · Option B

Aggregation represents a loosely coupled whole-part ("has-a") association where contained objects continue existing independently of the container.

Q3

Subclasses Circle and Rectangle both override calculateArea() inherited from abstract class Shape. Calling s.calculateArea() on a heterogeneous Shape[] array demonstrates:

1 mark

Model answer · Option A

Polymorphism allows one unified interface call s.calculateArea() to invoke each object’s specific overridden implementation dynamically at runtime.

Q4

What distinguishes method overloading from method overriding in Java or C++ OOP design?

1 mark

Model answer · Option D

Compilers resolve overloaded calls statically by argument count/types, whereas overridden subclass methods replace inherited behaviour polymorphically.

Q5

Inside a SensorReading class, field deviceCount is declared static whereas temperatureCelsius is non-static. If 50 objects are instantiated, how many copies of each exist in memory?

1 mark

Model answer · Option C

A static member belongs to the class itself and is shared across every instance, whereas non-static instance attributes are allocated per object.

Q6

In a standard UML class diagram, what visibility access modifiers do the symbols −, #, and + denote respectively?

1 mark

Model answer · Option B

UML notation marks private class-only members with minus (−), subclass-accessible protected members with hash (#), and public interfaces with plus (+).

Q7

Why has variable-width Unicode (UTF-8) replaced 7-bit ASCII across modern globalised software applications?

1 mark

Model answer · Option A

7-bit ASCII is limited to 128 characters (0–127), whereas UTF-8 supports multilingual global scripts seamlessly for internationalisation.

Q8

What primary compile-time benefit arises from declaring ArrayList<Invoice> rather than an untyped raw collection in Java?

1 mark

Model answer · Option D

Parameterised generics let the compiler enforce homogeneous element types, preventing ClassCastException crashes during runtime iteration.

Q9

When a subclass ElectricBus extends superclass Vehicle, what role does calling super(registrationID, capacity) perform on line one of the subclass constructor?

1 mark

Model answer · Option C

Chaining to super(...) reuses validated superclass initialisation logic instead of duplicating code or leaving inherited fields uninitialised.

Q10

From a software-ethics and governance perspective, how can biased historical training datasets harm automated loan-approval or recruitment algorithms?

1 mark

Model answer · Option B

Uncorrected historical skew causes algorithmic decisions to systematically disadvantage underrepresented groups unless audited for fairness and transparency.

Section B

· Short-answer questions

Attempt all five 2-mark questions.

10 marks
Q11

Explain two concrete maintenance benefits of encapsulation when multiple developers collaborate on a large banking codebase.

2 marks

Model answer

Private fields prevent external classes from corrupting invariants directly, and internal data representations (e.g., changing cents from double to long integer) can be refactored without breaking caller code that uses public getters/setters.

Q12

Distinguish clearly between inheritance ("is-a") and composition/aggregation ("has-a") using Hospital, Ward, and Surgeon classes.

2 marks

Model answer

A Surgeon "is-a" MedicalStaff subclass (inheritance sharing staff ID and licensing methods), whereas a Hospital "has-a" collection of Wards (composition) and employs Surgeons (aggregation).

Q13

Explain why declaring a base class Animal with an abstract method makeSound() is cleaner than writing an empty dummy method.

2 marks

Model answer

An abstract class cannot be instantiated accidentally on its own, and marking makeSound() abstract forces every concrete subclass (e.g., Wolf, Eagle) at compile time to supply a meaningful implementation.

Q14

Contrast open-source licensing with proprietary closed-source licensing for a municipal school-management platform.

2 marks

Model answer

Open-source code allows independent security audits, local customisation, and freedom from vendor lock-in, whereas proprietary software restricts source access and charges recurring licence fees in exchange for dedicated vendor SLA support.

Q15

Write the state of private field stock after: Item p = new Item(20); p.restock(15); p.sell(40); assuming sell(q) only deducts q when q ≤ stock.

2 marks

Model answer

Constructor sets stock = 20; restock(15) updates stock to 35; sell(40) fails the validation guard (40 ≤ 35 is false) and rejects the deduction, leaving final stock = 35.

Official syllabus & blueprint sources

Syllabus scope and question-paper structure were verified against the official portals below, which remain the sole authority.