HKDSE · Thinka-original Practice Paper

2021 HKDSE Information and Communication Technology Practice Paper | DSE Mock

Thinka 2021 DSE-Style Mock — Information and Communication Technology

90 marks120 mins2021
An original Thinka practice paper modelled on the structure and difficulty of that year's HKDSE paper. Not affiliated with or reproduced from the HKEAA.

Section A

Answer all 40 multiple-choice questions. All questions carry equal marks.
40 Question · 40 marks
Question 1 · MCQ
1 marks
What is the decimal value represented by the 8-bit binary string after performing the addition \(01011100_2 + 00111010_2\) in an 8-bit signed two's complement system?
  1. A.150
  2. B.-106
  3. C.-105
  4. D.-92
Question 2 · MCQ
1 marks
Consider the following algorithm in pseudocode:\n\n```\nA = 5\nB = 3\nC = 0\nWhile A > 0 do\n If A mod 2 == 1 then\n C = C + B\n B = B * 2\n A = A div 2\n```\n\nWhat is the value of `C` when the algorithm finishes?
  1. A.3
  2. B.9
  3. C.15
  4. D.24
Question 3 · MCQ
1 marks
Which of the following statements about cache memory in a computer system are correct?\n\n(1) Cache memory is faster than RAM but slower than CPU registers.\n(2) Cache memory is non-volatile.\n(3) Cache memory stores frequently used data and instructions to speed up CPU processing.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 4 · MCQ
1 marks
An IP address is `192.168.10.45` with a subnet mask of `255.255.255.240`. Which of the following IP addresses is in the same subnet as this IP address?
  1. A.192.168.10.28
  2. B.192.168.10.31
  3. C.192.168.10.42
  4. D.192.168.10.48
Question 5 · MCQ
1 marks
Consider the following database schema for a school enrollment system:\n\n`STUDENT(StudentID, StudentName, Class)`\n`COURSE(CourseID, CourseName, Teacher)`\n`ENROLLMENT(StudentID, CourseID, EnrollDate, Grade)`\n\nWhich of the following statements is/are correct?\n\n(1) The primary key of `ENROLLMENT` should be the composite key `(StudentID, CourseID)`.\n(2) `StudentID` in `ENROLLMENT` is a foreign key referencing `STUDENT`.\n(3) `StudentID` in `STUDENT` must be unique and cannot contain null values.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 6 · MCQ
1 marks
In a spreadsheet, cell `B2` contains the formula `=$A$1 + B1`. If this formula is copied and pasted into cell `D4`, what will the formula in `D4` be?
  1. A.=$A$1 + B1
  2. B.=$C$3 + D3
  3. C.=$A$1 + D3
  4. D.=$A$1 + C3
Question 7 · MCQ
1 marks
If Alice wants to send a confidential message to Bob using public key cryptography, which key should Alice use to encrypt the message, and which key should Bob use to decrypt it?
  1. A.Alice encrypts with Alice's public key; Bob decrypts with Bob's private key.
  2. B.Alice encrypts with Bob's public key; Bob decrypts with Bob's private key.
  3. C.Alice encrypts with Bob's private key; Bob decrypts with Alice's public key.
  4. D.Alice encrypts with Alice's private key; Bob decrypts with Alice's public key.
Question 8 · MCQ
1 marks
Which of the following are advantages of RFID technology over traditional optical barcodes?\n\n(1) RFID tags can be read without a direct line of sight.\n(2) Multiple RFID tags can be scanned and identified simultaneously.\n(3) RFID tags can store larger amounts of data and many can be read/written multiple times.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 9 · MCQ
1 marks
A student wrote a program to find the average of three positive integers. The program executed without any error messages, but it printed `7` instead of `5` when the inputs were `3`, `5`, and `7`. What type of error is this?
  1. A.Syntax error
  2. B.Runtime error
  3. C.Logical error
  4. D.Compilation error
Question 10 · MCQ
1 marks
An uncompressed stereo (2 channels) audio track is recorded with a sampling rate of \(44.1 \text{ kHz}\) and a bit depth of \(16 \text{ bits}\). What is the file size of a 2-minute recording in megabytes (MB)? (Assume \(1 \text{ MB} = 10^6 \text{ bytes}\))
  1. A.5.3 MB
  2. B.10.6 MB
  3. C.21.2 MB
  4. D.42.3 MB
Question 11 · MCQ
1 marks
An 8-bit register represents signed integers using two's complement representation. What is the decimal value represented by the binary string \(11001011_2\)?
  1. A.-53
  2. B.-52
  3. C.-75
  4. D.203
Question 12 · MCQ
1 marks
Which of the following statements about CPU cache memory is/are correct? (1) It is faster than DRAM but slower than CPU registers. (2) It uses SRAM. (3) It stores the most frequently used data and instructions to reduce the average cost of access from the main memory.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 13 · MCQ
1 marks
A computer has an IP address of \(192.168.10.45\) and a subnet mask of \(255.255.255.224\). Which of the following IP addresses is on the same local subnet as this computer?
  1. A.\(192.168.10.30\)
  2. B.\(192.168.10.50\)
  3. C.\(192.168.10.65\)
  4. D.\(192.168.10.128\)
Question 14 · MCQ
1 marks
Consider the following pseudocode segment: `X = 7`, `Y = 3`, `result = 0`. `while X > 0 do:` `if X % 2 != 0 then result = result + Y`, `X = X div 2`, `Y = Y * 2`. What is the value of `result` after execution? (Note: `div` represents integer division and `%` represents the modulo operator.)
  1. A.9
  2. B.15
  3. C.21
  4. D.24
Question 15 · MCQ
1 marks
In a spreadsheet, cell B2 contains the formula `=$A2 + B$1`. If cell B2 is copied and pasted into cell D4, what formula will be displayed in cell D4?
  1. A.`=$A4 + D$1`
  2. B.`=$C4 + D$1`
  3. C.`=$A4 + B$1`
  4. D.`=$A2 + D$3`
Question 16 · MCQ
1 marks
Consider two relational database tables: `STUDENT` (`StudentID`, `Name`, `ClassID`) where `StudentID` is the primary key and `ClassID` is a foreign key referencing the `CLASS` table, and `CLASS` (`ClassID`, `ClassName`, `Teacher`) where `ClassID` is the primary key. Which of the following operations violates referential integrity?
  1. A.Inserting a new record into `STUDENT` with a `ClassID` that does not exist in the `CLASS` table.
  2. B.Deleting a record from `STUDENT`.
  3. C.Inserting a new record into `CLASS` with a new `ClassID`.
  4. D.Updating the `Teacher` field of an existing record in the `CLASS` table.
Question 17 · MCQ
1 marks
Alice wants to send an encrypted message to Bob to ensure confidentiality, and she also wants to attach a digital signature to guarantee the authenticity of the message. To achieve both confidentiality and authenticity, Alice should encrypt the message and create the digital signature using which keys?
  1. A.Encrypt the message with Bob's public key, and sign with Alice's private key.
  2. B.Encrypt the message with Alice's public key, and sign with Bob's private key.
  3. C.Encrypt the message with Bob's private key, and sign with Alice's public key.
  4. D.Encrypt the message with Alice's private key, and sign with Bob's public key.
Question 18 · MCQ
1 marks
A program accepts an integer input \(N\) representing a student's mark (\(0 \le N \le 100\)). It outputs "Pass" if \(N \ge 50\) and "Fail" otherwise. A programmer wants to perform Boundary Value Analysis (BVA) to design test cases. Which of the following sets of values for \(N\) represents the best boundary test cases?
  1. A.\(-1, 0, 49, 50, 100, 101\)
  2. B.\(0, 50, 100\)
  3. C.\(-10, 50, 150\)
  4. D.\(0, 1, 49, 50, 51, 99, 100\)
Question 19 · MCQ
1 marks
Which of the following is an example of a data verification method rather than a data validation method?
  1. A.Double entry
  2. B.Range check
  3. C.Format check
  4. D.Check digit
Question 20 · MCQ
1 marks
Which of the following are advantages of Radio Frequency Identification (RFID) technology over Barcode technology? (1) RFID tags can be read without a direct line of sight. (2) Multiple RFID tags can be scanned simultaneously. (3) RFID tags can store read-write data, whereas traditional barcodes are read-only.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 21 · MCQ
1 marks
In an 8-bit two's complement binary system, what is the representation of the decimal value \(-43\)?
  1. A.11010101
  2. B.10101011
  3. C.11010100
  4. D.00101011
Question 22 · MCQ
1 marks
Which of the following statements about cache memory in a computer system is/are correct?
(1) Cache memory is faster than RAM because it is located closer to or inside the CPU.
(2) Cache memory has a larger capacity than RAM to store more executing program instructions.
(3) Cache memory is non-volatile, retaining data even when the computer is powered off.
  1. A.(1) only
  2. B.(2) only
  3. C.(1) and (3) only
  4. D.(2) and (3) only
Question 23 · MCQ
1 marks
Consider the following algorithm written in pseudocode:
```
X = 14
Y = 4
result = 0
while X >= Y do
X = X - Y
result = result + 1
endwhile
```
What are the values of `X` and `result` after the execution of the algorithm?
  1. A.X = 0, result = 3
  2. B.X = 2, result = 3
  3. C.X = 2, result = 4
  4. D.X = 14, result = 3
Question 24 · MCQ
1 marks
A company wants to assign IP addresses to its host computers. Which of the following IP addresses can be assigned to a host computer on a private local area network (LAN)?
  1. A.127.0.0.1
  2. B.192.168.1.0
  3. C.172.16.10.25
  4. D.224.0.0.1
Question 25 · MCQ
1 marks
A spreadsheet contains the following data:
- Cell A1: 10, Cell B1: 2
- Cell A2: 20, Cell B2: 4
- Cell A3: 30, Cell B3: 5

The formula `=$A1+B$1` is entered in cell C1 and then copied to cell D3. What is the value displayed in cell D3?
  1. A.32
  2. B.35
  3. C.42
  4. D.15
Question 26 · MCQ
1 marks
An audio file is recorded with a sampling rate of 44.1 kHz, 16-bit resolution, and in stereo (2 channels). What is the estimated file size, in megabytes (MB), of a 5-minute uncompressed recording?
  1. A.\(\frac{44100 \times 16 \times 2 \times 300}{8 \times 1024 \times 1024}\)
  2. B.\(\frac{44100 \times 16 \times 300}{8 \times 1024 \times 1024}\)
  3. C.\(\frac{44100 \times 16 \times 2 \times 5}{8 \times 1024 \times 1024}\)
  4. D.\(\frac{44100 \times 16 \times 2 \times 300}{1024 \times 1024}\)
Question 27 · MCQ
1 marks
During the fetch stage of the machine cycle, which register stores the address of the next instruction to be executed?
  1. A.Program Counter (PC)
  2. B.Instruction Register (IR)
  3. C.Memory Address Register (MAR)
  4. D.Accumulator (ACC)
Question 28 · MCQ
1 marks
An array of 1,000 elements is sorted in ascending order. If we use the binary search algorithm to search for a specific target value in this array, what is the maximum number of comparisons needed?
  1. A.10
  2. B.500
  3. C.1,000
  4. D.1,024
Question 29 · MCQ
1 marks
When a smartphone connects to a public Wi-Fi network, which protocol is responsible for automatically assigning a temporary IP address, subnet mask, and default gateway to the device?
  1. A.DNS
  2. B.DHCP
  3. C.HTTP
  4. D.ARP
Question 30 · MCQ
1 marks
To ensure the accuracy of data entry in a database, a developer implements two measures:
(1) Entering the password twice during registration to ensure they match.
(2) Checking if the entered age is a positive integer between 0 and 150.

Which types of data checks are (1) and (2) respectively?
  1. A.(1) Data validation; (2) Data validation
  2. B.(1) Data validation; (2) Data verification
  3. C.(1) Data verification; (2) Data validation
  4. D.(1) Data verification; (2) Data verification
Question 31 · MCQ
1 marks
An 8-bit register stores integers in 2's complement representation. What is the result in decimal when the bitwise XOR operation is performed between the representation of -18 and 35, and then interpreted as a signed 8-bit integer?
  1. A.-51
  2. B.-53
  3. C.51
  4. D.-17
Question 32 · MCQ
1 marks
Consider the following pseudo-code:

`X = 0`
`For I from 1 to 4:`
` For J from I to 4:`
` If (I + J) is even then:`
` X = X + I`
` Else:`
` X = X + J`

What is the value of `X` after executing the algorithm?
  1. A.20
  2. B.24
  3. C.26
  4. D.30
Question 33 · MCQ
1 marks
A computer system is upgraded by increasing its data bus width from 32-bit to 64-bit, while the clock frequency is reduced from \(3.2 \text{ GHz}\) to \(2.0 \text{ GHz}\). Assuming that the CPU can fetch one word per bus cycle and all other factors remain constant, what is the ratio of the theoretical maximum data transfer rate of the new system's data bus to that of the old system?
  1. A.0.625
  2. B.0.8
  3. C.1.25
  4. D.1.6
Question 34 · MCQ
1 marks
An organization is assigned the IP address range 192.168.10.0/24. If they need to divide this network into exactly 4 subnets of equal size, which of the following represents the valid subnet mask and the maximum number of usable host IP addresses in each subnet?
  1. A.Subnet Mask: 255.255.255.192, Usable Hosts: 62
  2. B.Subnet Mask: 255.255.255.192, Usable Hosts: 64
  3. C.Subnet Mask: 255.255.255.224, Usable Hosts: 30
  4. D.Subnet Mask: 255.255.255.224, Usable Hosts: 32
Question 35 · MCQ
1 marks
In a spreadsheet, cell A1 contains the formula `=$B1+C$2`. If we copy this formula and paste it into cell D3, what is the formula in D3?
  1. A.=$B3+F$2
  2. B.=$E3+F$2
  3. C.=$B3+C$2
  4. D.=$E1+C$2
Question 36 · MCQ
1 marks
Alice wants to send a confidential and digitally signed document to Bob using asymmetric key cryptography. Which keys should Alice use to sign the document and encrypt the document respectively?
  1. A.Alice's private key for signing, Bob's public key for encryption
  2. B.Alice's public key for signing, Bob's private key for encryption
  3. C.Bob's private key for signing, Alice's public key for encryption
  4. D.Bob's public key for signing, Alice's private key for encryption
Question 37 · MCQ
1 marks
Which of the following statements about disk defragmentation is/are correct?

(1) It reduces the physical distance the read/write head of a Solid State Drive (SSD) needs to move, thereby extending its lifespan.
(2) It reorganizes fragmented files into contiguous sectors to improve file access speed on Hard Disk Drives (HDDs).
(3) It increases the total unused storage capacity of the disk by compressing system files.
  1. A.(1) only
  2. B.(2) only
  3. C.(1) and (3) only
  4. D.(2) and (3) only
Question 38 · MCQ
1 marks
In a relational database, there are two tables: `STUDENT` and `CLASS`. The primary key of `CLASS` is `ClassID`. The `STUDENT` table has a foreign key `ClassID` that references the `CLASS` table. Which of the following operations would violate referential integrity?

(1) Inserting a new record into `STUDENT` with a `ClassID` that does not exist in `CLASS`.
(2) Deleting a record from `CLASS` when there are student records referencing that `ClassID`.
(3) Updating a student's `ClassID` to `NULL`, assuming nullable constraints allow it.
  1. A.(1) only
  2. B.(1) and (2) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 39 · MCQ
1 marks
Which of the following tasks should be processed using server-side scripting rather than client-side scripting?

(1) Validating that an email input field contains an '@' symbol before submission.
(2) Verifying user credentials against a secure database for user authentication.
(3) Connecting to a payment gateway API securely to process a credit card transaction.
  1. A.(1) only
  2. B.(1) and (2) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)
Question 40 · MCQ
1 marks
Which of the following are advantages of compiled programs over interpreted programs?

(1) They generally execute faster because the source code has been translated into machine code beforehand.
(2) They are easier to debug during runtime as errors are caught and shown line by line.
(3) The source code does not need to be distributed to end-users, protecting intellectual property.
  1. A.(1) and (2) only
  2. B.(1) and (3) only
  3. C.(2) and (3) only
  4. D.(1), (2) and (3)

Section B

Answer all 5 structured conventional questions.
5 Question · 50 marks
Question 1 · Structured
10 marks
(a) Character representation:

(i) Explain what "parity bit" is and how odd parity is used to detect transmission errors. (2 marks)

(ii) If the character 'A' is represented by ASCII code 65 (denary), write down its 8-bit representation using odd parity as the most significant bit (MSB). (2 marks)

(b) Sound representation:

A continuous sound wave is digitized.

(i) If the sampling rate is 16 kHz and each sample is stored in 12-bit format. Calculate the data size, in kilobytes (KB), of a 10-second mono sound recording without compression. (Show calculation steps, \(1 \text{ KB} = 1024 \text{ bytes}\)). (3 marks)

(ii) State two methods to reduce the file size of the recorded sound, other than applying file compression, and describe the trade-off of each method on sound quality. (3 marks)
Question 2 · Structured
10 marks
Consider the following pseudocode algorithm designed to process an array of integers representing student test marks to find the length of the longest consecutive sequence of passing marks (>= 50).

1 Input: A, an array of N integers indexed from 1 to N
2 max_len = 0
3 current_len = 0
4 For i from 1 to N:
5 If A[i] >= 50 Then
6 current_len = current_len + 1
7 Else
8 If current_len > max_len Then
9 max_len = current_len
10 EndIf
11 current_len = 0
12 EndIf
13 EndFor
14 If current_len > max_len Then
15 [ Blank X ]
16 EndIf
17 Output max_len

(a)(i) Fill in [ Blank X ] in line 15 so that the algorithm correctly outputs the length of the longest consecutive sequence of passing marks. (1 mark)

(ii) Explain why lines 14-16 are necessary. Give a sample array of size 5 where omitting lines 14-16 would lead to an incorrect output. (2 marks)

(b) Trace the algorithm using the input array \(A = [45, 60, 75, 30, 80, 85, 90, 40]\) of size 8. Provide a trace table showing the values of variables `i`, `A[i]`, `current_len`, and `max_len` at the end of each iteration of the For loop. (4 marks)

(c) A student suggests modifying the algorithm to find the start index of the longest consecutive sequence. Describe the additional variables needed and how they should be updated in the pseudocode. (3 marks)
Question 3 · Structured
10 marks
(a) Explain the main roles of the following registers during the execution of a program instruction:

(i) Program Counter (PC) (2 marks)

(ii) Memory Address Register (MAR) (2 marks)

(iii) Instruction Register (IR) / Current Instruction Register (CIR) (2 marks)

(b) A modern computer system uses multi-level cache (L1, L2, L3) between the CPU and the main memory (RAM).

(i) Explain why cache memory is necessary even though RAM size is increasing significantly. (2 marks)

(ii) Describe how the Principle of Locality (either temporal or spatial) justifies the use of cache memory. (2 marks)
Question 4 · Structured
10 marks
A small company is setting up a local area network (LAN) for its office. The network diagram shows:

- A router connected to the Internet.

- A network switch.

- Ten desktop computers connected to the switch.

- A wireless access point (WAP) connected to the switch.

- A network printer connected to the switch.

(a) IP Addressing and Subnetting:

(i) Explain what "private IP address" means and why it cannot be used directly on the Internet. (2 marks)

(ii) State the role of Network Address Translation (NAT) in this office network. (2 marks)

(iii) The network printer is assigned a static IP address, while the office desktops are assigned dynamic IP addresses. State which protocol is responsible for automatically assigning dynamic IP addresses, and explain why the printer should have a static IP address instead. (2 marks)

(b) Wireless Security and Connection:

(i) The office implements WPA3 for its wireless network instead of WEP. Give two security reasons why WEP should not be used. (2 marks)

(ii) A visitor tries to connect a smartphone to the office Wi-Fi but fails, even though the password entered is correct. Suggest two possible reasons related to network configuration or security settings (e.g., MAC address filtering) that could cause this. (2 marks)
Question 5 · Structured
10 marks
A school uses a spreadsheet to manage student participation in extra-curricular activities.

The spreadsheet contains the following columns:

- Column A: Student ID (e.g., S101)

- Column B: Name

- Column C: Class (e.g., 5A, 5B, 5C)

- Column D: Activity Code (e.g., ACT01, ACT02)

- Column E: Base Fee (in HKD)

- Column F: Subsidy Rate (e.g., 0.2 representing 20%)

- Column G: Subsidized Fee (in HKD)

- Column H: Payment Status (either "Paid" or "Pending")

(a) Formulas:

(i) Write a spreadsheet formula for cell G2 to calculate the subsidized fee of the student in row 2. (The subsidized fee is calculated as: Base Fee * (1 - Subsidy Rate).) (1 mark)

(ii) Cell I2 is used to check if a student is eligible for a special bonus. If a student is in Class "5A" and has a "Paid" status, the formula in I2 should display "Yes", otherwise it should display "No". Write down the formula for I2. (2 marks)

(iii) If the school wishes to calculate the total subsidized fees collected (i.e., only for those with payment status "Paid") across rows 2 to 100, write down a formula using a built-in spreadsheet function to achieve this. (2 marks)

(b) Data Validation and Formatting:

(i) The "Subsidy Rate" in Column F must be a decimal value between 0 and 0.5 (inclusive). Describe how to set up a data validation rule for Column F, including the validation criteria and the benefit of doing so. (3 marks)

(ii) The class teacher wants to quickly identify students who have not paid their fees. Suggest a spreadsheet feature that can automatically highlight cells in Column H with a red fill color if their value is "Pending". (2 marks)