CHSE Odisha Elective Computer Science common mistakes
CHSE Odisha Elective Computer Science · Understand the traps and how to avoid them.
Converting 1101011.101 to hexadecimal by grouping four bits from the left end of the whole string and ignoring the radix point, producing groups such as 1101 011.1 01 instead of padding each side of the point separately.
Binary-to-hex grouping is taught as 'take four bits', but candidates apply it left-to-right as with decimal long division and forget that fractional bits must be grouped rightward from the point and padded with trailing zeros.
What to do instead
Split the string at the radix point. Pad the integer part on the left with leading zeros until its length is a multiple of 4; pad the fraction on the right with trailing zeros. Convert each 4-bit group to one hex digit and keep the point in place; verify by converting back. For 1101011.101: 0110 1011 . 1010 = 6B.A.
Simplifying (A·B)′ as A′·B′ or (A+B)′ as A′+B′, that is, distributing the overbar without changing the operator.
The notation looks like ordinary algebra, where a minus sign distributes over a product; candidates memorize 'negate each variable' and omit the operator swap.
What to do instead
Write De Morgan's laws as two explicit transformations: (A·B)′ = A′+B′ and (A+B)′ = A′·B′. Check every simplification with a two-variable truth table or with the NAND/NOR identities. When a long bar covers an expression, break the bar from the outermost operator inward, changing · to + and + to · at each step.
Writing scanf("%d", n); or if (x = 5) when a comparison was intended, then wondering why the program crashes or always takes the branch.
scanf needs the address of the variable, not its value, and C treats assignment as an expression with a value; beginners copy the printf argument style and read = as equality.
What to do instead
Treat every scanf conversion as requiring an address: scanf("%d", &n); for character arrays use the array name without & only with %s. For tests use ==; compile with warnings enabled and read them, and put the constant on the left (5 == x) so an accidental = becomes a compile error.
Declaring char name[5] = "Rina"; and then calling strlen or printing with %s, or looping for (i=0; i<=n; i++) over an n-element array.
The string literal needs a terminating null byte, so a five-character name needs six bytes; and beginners count from 1, making <= look correct.
What to do instead
Reserve one extra byte for '\0': char name[6] = "Rina"; or declare char name[] and let the compiler size it. Loop with i < n, not i <= n. When reading with fgets, remove the trailing newline before measuring length, and always confirm that the buffer has room for the terminator.
Describing a stack as first-in-first-out and a queue as last-in-first-out, or writing pop() on an empty stack without an underflow test.
The words are memorized as labels without a physical model; under exam pressure the terms swap, and the underflow condition top == -1 is treated as an afterthought.
What to do instead
Anchor each structure to a real action: a stack of plates (push/pop at one end, LIFO) and a ticket queue (enqueue at rear, dequeue at front, FIFO). Before every operation state the invariant: empty stack top == -1, full stack top == MAX-1; empty queue front == -1 or front == rear with a count, full circular queue front == (rear+1) % MAX. Trace a five-operation sequence on paper.
Deleting the first node by writing free(head); without saving head->next, or inserting at the front without updating head, so the rest of the list is lost.
The pointer diagram is treated as a picture to memorize rather than an order of operations; candidates free or overwrite the only link to the next node before copying it.
What to do instead
Use the save-then-relink order. For deletion at the front: temp = head; head = head->next; free(temp). For insertion at the front: newNode->next = head; head = newNode. Draw three boxes and label the order; check the empty-list case separately. If a function changes head, return the new head or pass a double pointer.
Filtering grouped results with WHERE COUNT(*) > 1, or testing a missing value with salary = NULL.
WHERE and HAVING look like interchangeable filters, and NULL is treated as an ordinary value; SQL's three-valued logic makes = NULL always unknown.
What to do instead
Remember the evaluation order: FROM → WHERE (rows) → GROUP BY → HAVING (groups) → SELECT → ORDER BY. Put row conditions such as salary > 5000 in WHERE; put group conditions such as COUNT() > 1 in HAVING. Test missing values with IS NULL or IS NOT NULL, and use COUNT(column) versus COUNT() deliberately.
Calling a MAC address routable across the Internet, giving an IP address as 48 bits, or treating a port number as a host identifier.
MAC, IP and port are all 'addresses', so their layer, length and scope blur; candidates memorize numbers without the layer model.
What to do instead
Build a three-row table: MAC = 48-bit, burned into the NIC, link layer, local link only; IPv4 = 32-bit, logical, network layer, routed end to end; port = 16-bit, identifies a process, transport layer. State the layer and scope whenever you name an address. For subnetting, write the mask in binary and separate network and host bits before calculating.
Writing <img href="pic.jpg"> instead of src, leaving tags such as <p> unclosed, or using <table> to lay out the whole page.
Anchor and image attributes are both links in the candidate's mind, and older presentational HTML is still memorized as 'the way to design'.
Saying RAM is non-volatile and ROM is volatile, or treating 1 KB as 1000 bytes and 1 MB as 1,000,000 bytes.
Everyday SI prefixes conflict with binary address arithmetic, and the terms volatile/non-volatile are memorized as a pair without a meaning.
What to do instead
Tie volatility to power: RAM loses contents on power-off (volatile), ROM retains it (non-volatile). Use binary units: 1 KB = 2^10 = 1024 bytes, 1 MB = 2^20 bytes, 1 GB = 2^30 bytes. Place storage in a speed/cost hierarchy: registers, cache, RAM, SSD/HDD, tape; state which are primary and which secondary.