Question 1 · Multiple Choice
1 marksWhich of the following 8-bit binary representations represents the decimal number -58 in two's complement representation?
- A.11000110
- B.11000101
- C.10111010
- D.10111011
Question 2 · Multiple Choice
1 marksIn a school database, there are two tables: STUDENT and CLASS.\nSTUDENT table: StudentID (Primary Key), Name, ClassID\nCLASS table: ClassID (Primary Key), ClassTeacher\nWhich of the following database operations will violate referential integrity?
- A.Inserting a new student record into STUDENT with an existing ClassID in the CLASS table.
- B.Updating a student's Name in the STUDENT table.
- C.Deleting a record from the CLASS table where the ClassID is currently assigned to some students in the STUDENT table.
- D.Deleting a record from the STUDENT table.
Question 3 · Multiple Choice
1 marksWhich register stores the memory address of the next instruction to be fetched and executed by the CPU?
- A.Program Counter (PC)
- B.Instruction Register (IR)
- C.Memory Data Register (MDR)
- D.Accumulator (ACC)
Question 4 · Multiple Choice
1 marksWhich of the following statements about compilers and interpreters is correct?
- A.An interpreter translates the entire source code into machine code before execution, creating a standalone executable file.
- B.A compiler translates and executes the source code line by line, which makes debugging easier during program development.
- C.Compiled programs generally run faster than interpreted programs because translation is completed before execution.
- D.Interpreted programs do not require the interpreter to be present on the system during execution.
Question 5 · Multiple Choice
1 marksAn IP address of a host is 192.168.10.45, and its subnet mask is 255.255.255.240. What is the network ID (subnet address) of the network to which this host belongs?
- A.192.168.10.0
- B.192.168.10.32
- C.192.168.10.40
- D.192.168.10.48
Question 6 · Multiple Choice
1 marksIn public key cryptography, if Alice wants to send a confidential message to Bob, which key should Alice use to encrypt the message to ensure that only Bob can read it?
- A.Alice's private key
- B.Alice's public key
- C.Bob's private key
- D.Bob's public key
Question 7 · Multiple Choice
1 marksWhich of the following is an advantage of Radio Frequency Identification (RFID) technology over traditional barcodes?
- A.RFID tags require a direct line of sight between the reader and the tag to be scanned.
- B.Multiple RFID tags can be scanned simultaneously from a distance.
- C.RFID tags are much cheaper to manufacture and implement than barcode stickers.
- D.RFID tags cannot store read/write data and can only be used once.
Question 8 · Multiple Choice
1 marksConsider the following pseudocode:\n\n```\nSet count = 0\nFor i From 1 To 4\n For j From i To 4\n count = count + (i * j)\n Next j\nNext i\n```\n\nWhat is the final value of `count` after executing the pseudocode?
- A.50
- B.65
- C.70
- D.100
Question 9 · Multiple Choice
1 marksA photographer publishes their photo under a 'CC BY-NC-ND' Creative Commons license. Which of the following acts is permitted under this license without obtaining additional permission?
- A.A school teacher prints the photo in a free school newsletter and gives credit to the photographer.
- B.A marketing firm uses the photo in a commercial advertisement with attribution.
- C.A graphic designer modifies the colors of the photo and publishes the edited version on a personal blog.
- D.A local business prints the photo on postcards and sells them to raise funds, attributing the photographer.
Question 10 · Multiple Choice
1 marksThere is a database table `SALES` with the following columns: `SalespersonID`, `SaleAmount`, and `Region`.\nWhich of the following SQL statements finds the `Region` where the total sales amount exceeds 50000?
- A.`SELECT Region FROM SALES WHERE SUM(SaleAmount) > 50000 GROUP BY Region`
- B.`SELECT Region FROM SALES GROUP BY Region HAVING SUM(SaleAmount) > 50000`
- C.`SELECT Region FROM SALES GROUP BY Region WHERE SaleAmount > 50000`
- D.`SELECT Region, SUM(SaleAmount) FROM SALES WHERE SaleAmount > 50000`
Question 11 · Multiple Choice
1 marksIn an 8-bit two's complement representation system, what is the result of adding the binary numbers representing the denary values \(-75\) and \(-85\)?
- A.The result is \(-160\), and no overflow occurs.
- B.The result is \(96\), and an overflow occurs.
- C.The result is \(-96\), and an overflow occurs.
- D.The result is \(-160\), and an overflow occurs.
Question 12 · Multiple Choice
1 marksAn IoT smart thermometer requires memory to store the following three items: (1) The bootloader program (startup code), (2) Real-time temperature logs collected over the last 24 hours, (3) The configured target temperature set by the user (which must persist even if the power is cut off). Which of the following combinations of memory types is the most suitable for storing each of these items respectively?
- A.(1) ROM, (2) RAM, (3) Flash Memory
- B.(1) RAM, (2) Flash Memory, (3) ROM
- C.(1) ROM, (2) Flash Memory, (3) RAM
- D.(1) Flash Memory, (2) ROM, (3) RAM
Question 13 · Multiple Choice
1 marksA computer user notices that when they open too many large applications simultaneously, the hard disk activity light blinks constantly, and the system response becomes extremely slow. This phenomenon is known as 'thrashing'. Which of the following is the primary cause of thrashing?
- A.The operating system is constantly swapping pages between RAM and virtual memory on the disk.
- B.The computer's hard disk has too many fragmented files, requiring the disk head to move constantly.
- C.The CPU cache is too small to store the current instructions, forcing the CPU to read directly from the RAM.
- D.The device drivers of the active applications are conflicting, causing repeated software interrupts.
Question 14 · Multiple Choice
1 marksConsider two database tables: STUDENT (Student_ID, Name, Class, Club_ID) and CLUB (Club_ID, Club_Name, Teacher_In_Charge). 'Student_ID' and 'Club_ID' are the primary keys of STUDENT and CLUB respectively. 'Club_ID' in STUDENT is a foreign key referencing CLUB. Which of the following statements about referential integrity in this database is/are correct? (1) A new student record cannot be inserted with a Club_ID that does not exist in the CLUB table. (2) A club record cannot be deleted from the CLUB table if there are students currently registered with that Club_ID (assuming 'Restrict delete' is enforced). (3) A student's Club_ID can be set to NULL if joining a club is optional.
- A.(1) and (2) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
Question 15 · Multiple Choice
1 marksA database table SALES has records with schema: SALES (Transaction_ID, Product_Category, Amount, Salesperson). The records are: ('T101', 'Electronics', 1500, 'Alice'), ('T102', 'Furniture', 800, 'Bob'), ('T103', 'Electronics', 400, 'Alice'), ('T104', 'Clothing', 200, 'Charlie'), ('T105', 'Furniture', 1200, 'Bob'), ('T106', 'Electronics', 150, 'Charlie'). What is the output of the query: SELECT Salesperson, SUM(Amount) FROM SALES GROUP BY Salesperson HAVING COUNT(Transaction_ID) >= 2 AND AVG(Amount) > 500;
- A.Alice 1900, Bob 2000
- B.Alice 1900, Bob 2000, Charlie 350
- C.Alice 1500, Bob 1200
- D.Bob 2000
Question 16 · Multiple Choice
1 marksWhich of the following statements about MAC (Media Access Control) addresses and IP (Internet Protocol) addresses is correct?
- A.A MAC address operates at the Network layer of the OSI model, while an IP address operates at the Data Link layer.
- B.A router uses MAC addresses to forward packets across different subnets, while a switch uses IP addresses to forward frames within a local area network (LAN).
- C.An IP address is typically assigned by a manufacturer and cannot be changed, whereas a MAC address is assigned by a network administrator or DHCP server.
- D.When a packet is forwarded from one router to another across the Internet, the destination IP address in the packet header remains the same, but the destination MAC address in the frame header changes at each hop.
Question 17 · Multiple Choice
1 marksIn secure online transactions, asymmetric encryption is widely used. Which of the following correctly describes the main purpose of using a digital signature?
- A.To encrypt the transactional data so that eavesdroppers cannot read the details.
- B.To verify the authenticity and integrity of the message, and to ensure non-repudiation.
- C.To store and protect the private key of the sender securely on a certificate authority's server.
- D.To establish a direct physical connection between the sender and the receiver's computer.
Question 18 · Multiple Choice
1 marksA school is developing a customized student portfolio system. Instead of purchasing physical servers, they decide to use a cloud service where they rent virtual machines with a pre-installed operating system and database management system, allowing their IT teachers to focus entirely on writing the system code and deploying the database. Which cloud service model are they using?
- A.Infrastructure as a Service (IaaS)
- B.Platform as a Service (PaaS)
- C.Software as a Service (SaaS)
- D.Network as a Service (NaaS)
Question 19 · Multiple Choice
1 marksConsider the following algorithm: A is an array of integers [3, 8, 2, 7, 5]; N = 5; X = A[0]; Y = A[0]; For i from 1 to N - 1 do: If A[i] > X then X = A[i] Else if A[i] < Y then Y = A[i] End If End For; Print X - Y. What is the printed output of this algorithm?
- A.3
- B.5
- C.6
- D.8
Question 20 · Multiple Choice
1 marksConsider the following Python code to calculate the average of three test scores: score1 = 80; score2 = 90; score3 = 85; average = score1 + score2 + score3 / 3; print('The average is: ' + average). The programmer encounters two errors: (1) The calculated average is mathematically incorrect due to operator precedence, (2) The program crashes with a TypeError during runtime because of an attempt to concatenate a string and a float. Which of the following correctly classifies these two errors?
- A.(1) Logical error, (2) Runtime error
- B.(1) Syntax error, (2) Logical error
- C.(1) Runtime error, (2) Syntax error
- D.(1) Logical error, (2) Syntax error
What is the 8-bit two's complement representation of the decimal number \(-37\)?
- A.11011011
- B.11011010
- C.10100101
- D.11100101
A database designer wants to ensure that a student record in the 'Student' table cannot be deleted if the student has already enrolled in any course in the 'Enrollment' table. Which integrity constraint should be applied?
- A.Entity integrity constraint
- B.Referential integrity constraint with CASCADE rule
- C.Referential integrity constraint with RESTRICT rule
- D.Domain integrity constraint with NOT NULL check
During the Fetch-Decode-Execute cycle, which register is used to store the address of the next instruction to be fetched from memory, and which register holds the instruction currently being decoded?
- A.Program Counter (PC) and Memory Data Register (MDR)
- B.Memory Address Register (MAR) and Instruction Register (IR)
- C.Program Counter (PC) and Instruction Register (IR)
- D.Accumulator (ACC) and Memory Data Register (MDR)
A computer has an IP address of '192.168.10.45' and a subnet mask of '255.255.255.240'. Which of the following is the network address (subnet address) of this host?
- A.192.168.10.0
- B.192.168.10.32
- C.192.168.10.40
- D.192.168.10.48
To achieve both confidentiality and authenticity (non-repudiation) when Alice sends a message to Bob using public key cryptography, which of the following processes should Alice use?
- A.Encrypt the message with Alice's private key, and sign it with Bob's public key.
- B.Encrypt the message with Bob's public key, and sign it with Alice's private key.
- C.Encrypt the message with Alice's public key, and sign it with Bob's private key.
- D.Encrypt the message with Bob's private key, and sign it with Alice's public key.
Consider the following pseudocode which processes an array A of 6 elements: '[3, 8, 2, 7, 5, 10]':
N = 6
FOR i = 0 TO N-2
FOR j = i+1 TO N-1
IF A[i] < A[j] THEN
temp = A[i]
A[i] = A[j]
A[j] = temp
ENDIF
ENDFOR
ENDFOR
What is the content of array A immediately after the outer loop finishes its first iteration (where i = 0)?
- A.[8, 3, 2, 7, 5, 10]
- B.[10, 3, 2, 7, 5, 8]
- C.[10, 8, 7, 5, 3, 2]
- D.[3, 8, 2, 7, 5, 10]
A database table STUDENT has the attributes StudentID, Name, Class, Gender, and Score. Which of the following SQL statements correctly displays the Class and the number of female students for classes with more than 5 female students?
- A.SELECT Class, COUNT(*) FROM STUDENT WHERE Gender = 'F' GROUP BY Class HAVING COUNT(*) > 5;
- B.SELECT Class, COUNT(*) FROM STUDENT GROUP BY Class HAVING Gender = 'F' AND COUNT(*) > 5;
- C.SELECT Class, COUNT(*) FROM STUDENT WHERE Gender = 'F' AND COUNT(*) > 5 GROUP BY Class;
- D.SELECT Class, COUNT(*) FROM STUDENT GROUP BY Class WHERE Gender = 'F' HAVING COUNT(*) > 5;
An illustrator shares their digital artwork under a Creative Commons license. The terms of the license allow others to copy, distribute, and display the work, and also allow others to modify or build upon the work. However, any commercial use is forbidden, and any modified works must be shared under the same license terms. Which of the following Creative Commons licenses did the illustrator apply?
- A.CC BY-ND
- B.CC BY-NC-ND
- C.CC BY-NC-SA
- D.CC BY-SA
Which of the following statements about Virtual Memory is/are correct?
(1) Virtual memory uses a portion of secondary storage (such as a hard disk or SSD) to simulate additional RAM.
(2) Increasing the size of virtual memory can speed up CPU instruction execution as effectively as increasing physical RAM.
(3) A "page fault" occurs when the requested memory page is not currently located in the physical RAM and needs to be fetched from secondary storage.
- A.(1) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
A web form requires users to enter a Hong Kong Identity Card (HKID) number. The system performs several validation checks on the input:
(1) Check if the input is not left blank.
(2) Check if the input format matches one or two uppercase letters, followed by six digits, and a single digit/letter in parentheses.
(3) Calculate and verify the check digit using a weighted formula based on the preceding characters.
Which of the following correctly identifies these validation checks?
- A.(1) Presence check, (2) Range check, (3) Type check
- B.(1) Presence check, (2) Format check, (3) Check digit validation
- C.(1) Type check, (2) Format check, (3) Range check
- D.(1) Range check, (2) Type check, (3) Check digit validation
Question 31 · Multiple Choice
1 marksIf an 8-bit register uses 2's complement representation, what is the 8-bit binary result of the subtraction \(01001100_2 - 10110101_2\), and does overflow occur?
- A.\(10010111_2\), overflow occurs
- B.\(10010111_2\), overflow does not occur
- C.\(11001001_2\), overflow occurs
- D.\(11001001_2\), overflow does not occur
Question 32 · Multiple Choice
1 marksWhich of the following statements about cache memory in a computer system are correct?
(1) It stores frequently used data and instructions to reduce the average time to access memory.
(2) It has a faster access speed than registers.
(3) It resides inside or very close to the CPU chip.
- A.(1) only
- B.(1) and (3) only
- C.(2) and (3) only
- D.(1), (2) and (3)
Question 33 · Multiple Choice
1 marksConsider two database tables: `STUDENT(StudentID, Name, ClassID)` and `CLASS(ClassID, ClassTeacher, RoomNo)`. `StudentID` and `ClassID` are the primary keys of the respective tables. `ClassID` in `STUDENT` is a foreign key referencing `CLASS`. Which of the following operations will be rejected by the DBMS in order to maintain referential integrity?
(1) Inserting a new record into `STUDENT` with a `ClassID` that does not exist in `CLASS`.
(2) Deleting a record from `CLASS` whose `ClassID` is currently assigned to some students in `STUDENT`.
(3) Deleting a record from `STUDENT`.
- A.(1) only
- B.(2) only
- C.(1) and (2) only
- D.(1), (2) and (3)
Question 34 · Multiple Choice
1 marksA subnet of a school network has the IP address `192.168.10.32` with a subnet mask of `255.255.255.240`. Which of the following is/are valid IP address(es) for host computers on this subnet?
(1) `192.168.10.35`
(2) `192.168.10.45`
(3) `192.168.10.47`
- A.(1) only
- B.(1) and (2) only
- C.(2) and (3) only
- D.(1), (2) and (3)
Question 35 · Multiple Choice
1 marksAlice wants to send an encrypted and digitally signed email to Bob. She wants to ensure confidentiality (only Bob can decrypt and read it) and authenticity (Bob can verify the email was sent by Alice). Which keys should Alice use to encrypt the email message and to create the digital signature respectively?
- A.Encrypt message: Bob's private key; Create signature: Alice's public key
- B.Encrypt message: Alice's private key; Create signature: Bob's public key
- C.Encrypt message: Bob's public key; Create signature: Alice's private key
- D.Encrypt message: Alice's public key; Create signature: Bob's private key
Question 36 · Multiple Choice
1 marksConsider the following pseudocode algorithm:
```
A = 45
B = 12
COUNT = 0
While A >= B Do
A = A - B
COUNT = COUNT + 1
EndWhile
```
What are the values of `A` and `COUNT` after the execution of the algorithm?
- A.`A = 21`, `COUNT = 2`
- B.`A = 0`, `COUNT = 3`
- C.`A = 9`, `COUNT = 4`
- D.`A = 9`, `COUNT = 3`
Question 37 · Multiple Choice
1 marksA school registration system requires users to enter a student's date of birth in the format `DD/MM/YYYY`. Which of the following validation checks can be applied to verify the correctness of the input?
(1) Format check to ensure the input contains forward slashes at correct positions.
(2) Range check to ensure the month `MM` is between 1 and 12.
(3) Verification check by double entry of the date of birth.
- A.(1) and (3) only
- B.(2) and (3) only
- C.(1) and (2) only
- D.(1), (2) and (3)
Question 38 · Multiple Choice
1 marksIn an operating system, what is the main purpose of "paging" in virtual memory management?
- A.To compress data stored in the RAM to save system resources
- B.To automatically defragment the storage device to improve direct access speed
- C.To ensure that multiple active processes can write to the exact same physical memory address simultaneously without conflict
- D.To divide physical and virtual memory into fixed-size blocks to allow non-contiguous physical memory allocation to processes
Question 39 · Multiple Choice
1 marksA programmer wants to release their software under a Creative Commons license. They want to allow others to copy, distribute, and display the software, but only if they give the programmer proper credit, do not use it for commercial purposes, and do not make any derivative works (no modifications). Which combination of Creative Commons terms should the programmer choose?
- A.CC BY-NC-SA
- B.CC BY-NC-ND
- C.CC BY-SA-ND
- D.CC BY-NC
Question 40 · Multiple Choice
1 marksConsider a database table `SALES(SalesID, ProductID, Region, Amount)`. Which SQL query can find the regions where the total sales amount exceeds 50,000?
- A.SELECT Region FROM SALES WHERE SUM(Amount) > 50000 GROUP BY Region
- B.SELECT Region FROM SALES GROUP BY Region HAVING SUM(Amount) > 50000
- C.SELECT Region FROM SALES WHERE Amount > 50000 GROUP BY Region
- D.SELECT Region FROM SALES GROUP BY Region WHERE SUM(Amount) > 50000