NSSCAS Computer Science (8231) common mistakes
NSSCAS Computer Science (8231) · Understand the traps and how to avoid them.
Converting a negative denary value to two's complement by inverting the positive binary bits but forgetting to add 1, so -5 is written as 11111010 instead of 11111011 in 8 bits.
The shortcut 'flip the bits' is memorised without the second step, and candidates do not check the result.
What to do instead
Use the full algorithm: write the positive magnitude, invert all bits, add 1, discard any carry beyond the fixed width; verify by adding the result to the positive value to get zero.
For an IPv4 subnet with n host bits, stating 2^n usable hosts instead of 2^n - 2, and ignoring the network and broadcast addresses.
The formula is recalled as a raw power of two, and the reserved addresses are not linked to the subnet.
What to do instead
Identify network and broadcast addresses first; calculate usable hosts as 2^n - 2 for traditional IPv4 subnets, and state the assumption when /31 or /32 is involved.
Reversing the roles of MAR and MDR in the fetch-decode-execute cycle, saying MAR holds the data/instruction and MDR holds the address.
The register names are similar and candidates memorise a sequence without linking each register to its function.
What to do instead
Use the phrase 'MAR addresses, MDR data': PC to MAR, memory read, instruction to MDR, then MDR to CIR; draw the data flow and label each transfer.
Describing an interpreter as translating the whole source program before execution and producing an executable/object file.
Compiler and interpreter descriptions are learned as a list of advantages rather than distinct execution models.
What to do instead
Contrast them explicitly: compiler translates whole program once to object code before running; interpreter translates and executes one statement at a time and stops at the first error.
Claiming that HTTPS/TLS encryption alone proves the website owner is genuine, without mentioning certificate authority validation or server authentication.
Encryption and authentication are conflated because both appear in 'secure' web browsing.
What to do instead
Separate confidentiality, integrity and authentication: explain the certificate chain, CA signature and hostname check that authenticate the server, then note encryption protects the session.
Answering an ethics/legal scenario with a generic 'it is wrong/unethical' and no named legislation, stakeholder, right or ownership issue.
Candidates treat the question as a moral opinion and do not apply the scenario's specific facts.
What to do instead
Use a structured answer: identify the act (e.g. copying, monitoring, data sharing), the affected stakeholder, the relevant legal/ethical principle (copyright, data protection, computer misuse), and a justified consequence.
Implementing a many-to-many relationship in a relational schema by putting a foreign key on one side only, without a junction/link table.
The E-R diagram shows a direct many-to-many line, and candidates copy it into tables without resolving it.
What to do instead
Resolve every many-to-many relationship into two one-to-many relationships via a junction table containing the primary keys of both entities, typically as a composite key.
Applying binary search to an unsorted list or writing pseudocode that does not maintain low/high/mid boundaries correctly, so the search loops or misses the target.
The algorithm is memorised as 'halve the list' without its precondition and boundary invariant.
What to do instead
State the sorted precondition; initialise low=0, high=n-1; loop while low<=high; compute mid; move low=mid+1 or high=mid-1; test empty, one-item and absent-target cases.
Implementing a queue in a fixed-size array by incrementing rear without wrapping or moving front, then reporting 'full' when free cells exist at the start.
The linear array model is reused for a circular queue, and the modulo arithmetic is not traced.
What to do instead
Use rear=(rear+1) mod size and front=(front+1) mod size, track count or leave one slot empty, and trace enqueue/dequeue on a small array until wrap-around occurs.
Writing a test plan with only one normal input and an expected result of 'works', omitting boundary values and erroneous data.
Candidates test that the program runs rather than testing against a specification, and boundary analysis is not applied.
What to do instead
For each input, list normal, boundary/edge and erroneous values with exact expected outputs or errors; include the boundary just inside/outside the valid range and state the action after failure.