RI 2025 H2 Computing Prelim Paper 1
Uploaded by Kozak327 · 25 August 2026
Preview
Text from the first pagesH2 COMP 9569/2025 RI Year 6 Prelim Exam [Turn over CANDIDATE NAME CLASS 25 COMPUTING 9569/01 Paper 1 Written September 2025 3 hours READ THESE INSTRUCTIONS FIRST Writing papers will be provided with the question paper. Write your name and class on all the work you hand in. Write in dark blue or black pen. You are reminded of the need for clear presentation in your answers. Staple the provided coverpage in front of your answer script. Answer all questions. Approved calculators are allowed. The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 100. FOR EXAMINER’S USE Q1 Q2 Q3 Q4 Q5 Q6 Q7 TOTAL 100 This document consists of 8 printed pages. RAFFLES INSTITUTION Mathematics Department RAFFLES INSTITUTION 2025 YEAR 6 PRELIMINARY EXAMINATION
1 A company operates a ride-hailing platform that allows passengers to book rides via a mobile app. A relational database is being designed to manage rides, drivers, passengers, and payments. Each ride includes: • a unique RideID • PickupLocation • DropoffLocation • RideDateTime • Status (e.g., completed, cancelled, ongoing) • DriverID • PassengerID Each driver includes: • a unique DriverID • FullName • VehicleNumber • LicenseExpiryDate • ContactNumber Each passenger includes: • a unique PassengerID • FullName • PhoneNumber • EmailAddress Each payment includes: • a unique PaymentID • RideID • PaymentMethod (e.g., credit card, e-wallet) • FareAmount • PaymentStatus (e.g., paid, pending) (a) Draw an entity -relationship (ER) diagram showing the four entities and the relationships between them. [3] (b) Write table definitions for each of the tables so that they are in third normal form, using this format: TableName (Attribute1, Attribute2, Attribute3, …) (i) Ride [2] (ii) Driver [2] (iii) Passenger [2] (iv) Payment [2]
H2 COMP 9569/2025 RI Year 6 Prelim Exam [Turn over (c) (i) The company wants to know which drivers earned the most. Write an SQL query to calculate the total fare amount collected by each DriverID, and sort the results in descending order of total fare. [4] (ii) Write an SQL query to update the PaymentStatus of a ride with RideID = 'R7645' to 'paid'. [2] (d) The company is planning to collect customer reviews and use them to improve driver performance. Justify three reasons why a NoSQL database might be more suitable than a relational database for storing customer reviews for the ride-hailing platform. [3] During the booking process, the following personal data is collected and stored: • From the passenger: full name, mobile number, pickup and drop -off location, and ride history. • From the driver: full name, contact number, vehicle number, driving license number, and real-time location when online. The system also stores in-app messages between drivers and passengers. (e) From the perspective of a passenger, explain two concerns you may have about how your personal data is used or shared. [2] (f) From the perspective of a driver, explain two responsibilities you have under PDPA when handling passenger data. [2] (g) To prevent misuse of passenger information, the company plans to work with a third-party fraud analysis firm. What actions should the company take before sharing personal data with this vendor? [2]
2 A large e-commerce company is building its order management system. As millions of customers place, modify, and cancel orders daily, choosing the correct data structures is critical for performance. The system must support the following operations efficiently: • AddOrder(orderID): Adds a new order with a unique orderID • CheckOrderExists(orderID): Checks whether an order exists • GetMostRecentOrder(): Retrieves the latest order placed • GetAllOrdersSorted(): Returns all orders sorted by orderID The development team is considering various data structures: • Unordered List (Array or Linked List) • Hash Table • Binary Search Tree (Self-balancing) • Stack (a) For each operation above, select the most suitable data structure from the list provided (Unordered List, Hash Table, BST, Stack), and justify your choice using Big-O notation. [4] (b) Explain why using a linked list to implement CheckOrderExists(orderID) would be inefficient at scale. [2] (c) The company is considering using a hash table to manage all active orders. Explain why using a hash table is not ideal, and propose a suitable data structure. [3] (d) During a Black Friday sale, the sales volume typically increases dramatically. Certain popular items may have limited stock, so it is important for the system to support a feature that allows merchants to fulfil orders in chronological order. You are tasked with selecting the most appropriate data structure to support this operation. You may choose from the list of data structures provided above, or propose an alternative. Justify your choice clearly. [2]
H2 COMP 9569/2025 RI Year 6 Prelim Exam [Turn over 3 A robotics company is developing a simulation system for different types of warehouse robots. These robots help with tasks such as transporting items, sorting packages, and restocking shelves. Each robot stores the following common data: • robotID: a unique robot ID • status: status (active or charging) • batteryLevel: current battery level (initialised to 100) • location: location in the warehouse (zone ID as a string) There are three types of robots: • Transport robots carry items from one zone to another. These robots have a maximum load of 100kg (kgCarried). • Sorting robots identify and sort parcels. They store the number of parcels sorted per hour (parcelsPerHour) • Restock robots move items from the storage area to shelves. They store the number of shelves restocked per cycle (shelvesRestocked). Each robot has a method PerformTask(): • A transport robot’s battery level decreases by 5% for every 10kg it carries. • A sorting robot’s battery level decreases by 2% for every 10 parcels sorted. • A restock robot’s battery level decreases by 3% per shelf restocked. When a robot’s battery level reaches 10% or less, its status is set to charging. Object-oriented programming will be used to simulate these robots. (a) Draw a class diagram for the simulation described above. Include: • the superclass • any subclasses • inheritance • attributes • appropriate methods [8] (b) (i) Describe instantiation, with an example from simulation. [2] (ii) Describe encapsulation, using an example from the simulation. [2] (iii) Describe inheritance, using an example from the simulation. [2] (iv) Describe polymorphism, using an example from the simulation. [2] (c) The system includes validation for the number of kilograms carried per trip by a transport robot. Provide examples of test data for the input variable kgCarried. [4]
4 The function EvaluatePostfix is designed to evaluate a postfix arithmetic expression at runtime. The expression is stored as a queue of tokens (either integers or operators) from left to right. For example, the postfix expression 5 2 - 3 * is stored as the queue [5, 2, '-', 3, '*'], which corresponds to the infix expression (5 - 2) * 3. The pseudocode is given below: 01 FUNCTION EvaluatePostfix(Tokens : QUEUE) RETURNS INTEGER 02 DECLARE Stack AS EMPTY STACK 03 REPEAT 04 Token ← DEQUEUE Tokens 05 IF Token IS INTEGER THEN 06 PUSH Token TO Stack 07 ELSE 08 A ← POP Stack 09 B ← POP Stack 10 IF Token = '+' THEN 11 PUSH (B + A) TO Stack 12 ELSE IF Token = '-' THEN 13
Content continues in the PDF. Download PDF
Related notes
- JPJC 2024 JC2 Prelim Paper 2 QPExam Papers · 2024
- JPJC 2024 JC2 Prelim Paper 2 MS v2Exam Papers · 2024
- JPJC 2024 JC2 Year-End Exam H2 Computing Paper 1Exam Papers · 2024
- JPJC 2024 JC2 Year-End Exam H2 Computing Paper 1 Marking SchemeExam Papers · 2024
- 2024 ASR H2 Computing Prelim P1 SolExam Papers · 2024
- 2024 ASR H2 Computing Prelim P1 QnsExam Papers · 2024
- 2025 VJC H2 Computing Prelim Paper 1Exam Papers · 2025
- 2025 VJC H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- 2025 TJC H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- RVHS 2025 H2 Computing Prelim Paper 1Exam Papers · 2025
- RVHS 2025 H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- RI 2025 H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- See all H2 Computing notes

