📚 Common Mistakes in IB CCEA Computer Science: Exam Question Analysis | IB CCEA 计算机:易错题精讲
Exam questions in CCEA Computer Science often test not only knowledge recall but also the ability to apply concepts under time pressure. Many candidates lose marks on seemingly straightforward topics because they overlook subtle details or misinterpret the wording. This guide analyses common pitfalls across key syllabus areas and demonstrates how to avoid them systematically.
CCEA 计算机科学的考试题目不仅考查知识记忆,也考验在时间压力下应用概念的能力。不少考生在看似直接的题目上失分,因为他们忽略了细微之处或误解题意。本指南分析核心大纲领域中常见的陷阱,并系统演示如何避免这些错误。
1. Pointer Confusion in Linked Lists | 链表中的指针混淆
A frequent mistake is leaving dangling pointers or failing to update the next reference properly when inserting or deleting nodes. For example, when inserting node B between A and C, many students write A.next = B; B.next = C; correctly, but forget that the order matters if they first lose reference to C. In deletion, not setting current.next = current.next.next before removing the target node can break the list.
常见的错误是在插入或删除节点时留下悬空指针,或未能正确更新 next 引用。例如,在 A 和 C 之间插入节点 B 时,很多学生能正确写出 A.next = B; B.next = C;,但如果它们先丢失了指向 C 的引用,顺序就会出错。在删除操作中,若未先执行 current.next = current.next.next 就移除目标节点,链表会断裂。
- Key exam tip: Always draw the before and after state of the linked list. Trace references step by step and check that no node becomes unreachable.
- 关键考试技巧:始终画出链表操作前和操作后的状态。逐步追踪引用,确认没有任何节点变得不可达。
2. Recursion Without a Proper Base Case | 递归缺少正确基案
In recursive function design, a missing or insufficient base case leads to infinite recursion – a stack overflow in practice. Candidates might write a recursive factorial that handles n == 0 but forget negative input. Another typical error is placing the base case after the recursive call, which causes unnecessary recursion before stopping.
在设计递归函数时,遗漏或不充分的基案会导致无穷递归——实践中表现为栈溢出。考生可能会写出处理 n == 0 的阶乘递归,但忘记负输入的情形。另一个典型错误是基案放在递归调用之后,导致在停止前进行了不必要的递归。
factorial(n): if n ≤ 1: return 1 else: return n × factorial(n-1)
阶乘(n):若 n ≤ 1:返回 1 否则:返回 n × 阶乘(n-1)
Ensure your base condition covers all trivial cases and is checked before any recursive invocation. Also, be mindful of redundant recursive calls that duplicate work, such as in the naive Fibonacci implementation.
确保基案覆盖所有平凡情况,并在任何递归调用之前检查。同时注意避免冗余的递归调用,如简单斐波那契实现中重复计算的问题。
3. SQL JOIN Conditions and Cartesian Products | SQL 连接条件与笛卡尔积
Students often write SELECT * FROM Student, Enrolment WHERE ... but omit a proper join condition between the tables, resulting in a Cartesian product. Even when a condition is present, they might use student_id = student_id without table prefixes, causing ambiguity if column names are identical. Additionally, misusing LEFT JOIN vs INNER JOIN can change the result set unexpectedly when dealing with optional relationships.
学生经常写下 SELECT * FROM Student, Enrolment WHERE ...,但缺少表之间的正确连接条件,导致笛卡尔积。即使存在条件,也可能写成 student_id = student_id 而没有表前缀,在列名相同时引发歧义。此外,在处理可选关系时,混淆 LEFT JOIN 与 INNER JOIN 会意外改变结果集。
Correct pattern: SELECT ... FROM Student s INNER JOIN Enrolment e ON s.id = e.student_id. Always alias tables and qualify column names. For CCEA practical papers, carefully read whether the question expects all left-side records or only matching ones.
正确模式:SELECT ... FROM Student s INNER JOIN Enrolment e ON s.id = e.student_id。始终为表取别名并限定列名。在 CCEA 实践试卷中,仔细阅读题目是要求所有左侧记录还是仅匹配的记录。
4. Misinterpreting TCP/IP and OSI Layers | 对 TCP/IP 与 OSI 层次的误解
A crossover topic that causes confusion is mapping TCP/IP model layers onto the OSI model. Candidates frequently place encryption (SSL/TLS) at the network layer, whereas it actually operates at the Transport layer in TCP/IP (or Session layer in OSI). Also, stating that a router works at the Data Link layer is a common slip – routers forward packets at the Network layer (IP), while switches operate at Data Link (MAC).
一个容易混淆的交叉主题是将 TCP/IP 模型层次映射到 OSI 模型。考生常把加密(SSL/TLS)置于网络层,实际上它在 TCP/IP 中的传输层(或 OSI 中的会话层)工作。另外,声称路由器工作在数据链路层是常见的口误——路由器在网络层(IP)转发数据包,而交换机在数据链路层(MAC)工作。
- Quick check: Application – HTTP, FTP; Transport – TCP, UDP; Internet – IP; Network Access – Ethernet. Firewalls may span layers; know which type of firewall is being described.
- 快速核对:应用层 – HTTP、FTP;传输层 – TCP、UDP;互联网层 – IP;网络接入层 – 以太网。防火墙可能跨越多层;了解题目描述的是哪一类防火墙。
5. Inheritance and Polymorphism in OOP | 面向对象中的继承与多态
In object-oriented design questions, a typical mistake is confusing “is-a” and “has-a” relationships. Inheriting from a class when composition is more appropriate leads to rigid structures. When implementing method overriding, forgetting to use the same method signature – including parameter types and return type – results in method overloading instead of overriding, which breaks polymorphic behaviour.
在面向对象设计题中,典型的错误是混淆 “is-a” 与 “has-a” 关系。当组合更合适时却使用继承,会导致结构僵硬。在实现方法重写时,忘记使用相同的方法签名——包括参数类型和返回类型——会导致方法重载而非重写,从而破坏多态行为。
Example: Base class Shape with draw(); subclass Circle must implement void draw() exactly. If the subclass writes void draw(String colour), it is a different method and will not be called dynamically via a Shape reference.
示例:基类 Shape 具有 draw() 方法;子类 Circle 必须完全一致地实现 void draw()。如果子类写出 void draw(String colour),这是另一个方法,通过 Shape 引用调用时不会产生动态绑定。
6. Logic Gate Simplification Errors | 逻辑门化简错误
While deriving Boolean expressions from a truth table, many candidates attempt to simplify too early without using Karnaugh maps or De Morgan’s laws correctly. A common slip is mistaking A'B' + A'B + AB as being simplifiable to A' + AB ignoring the possibility of further reduction to A' + B. Moreover, drawing circuits directly from an unsimplified expression costs time and may be marked down if an equivalent simpler circuit is expected.
在从真值表推导布尔表达式时,许多考生过早尝试化简,却没有正确使用卡诺图或德摩根定律。一个常见失误是将 A'B' + A'B + AB 误化简为 A' + AB,而忽略了进一步化简为 A' + B 的可能性。此外,根据未化简的表达式直接绘制电路会耗费时间,若期望的是等价更简电路,还可能被扣分。
A’B’ + A’B + AB = A'(B’ + B) + AB = A’ + AB = A’ + B
Always apply Boolean algebra rules stepwise: identity, complement, idempotent, and absorption. When designing logic circuits from worded problems, double-check conditions for output 1 vs 0 to avoid inverted logic.
始终逐步应用布尔代数规则:恒等、互补、幂等和吸收。在根据文字题设计逻辑电路时,要反复核对输出 1 与 0 的条件,以免逻辑反向。
7. Two’s Complement Overflow and Range | 二进制补码溢出与范围
In binary arithmetic, forgetting that the most significant bit (MSB) represents a negative weight in two’s complement can produce incorrect decimal conversions. When adding two numbers, an overflow occurs if the carry into the MSB differs from the carry out of the MSB. Candidates often detect overflow by checking if the sign of the result is unexpected, but forget that overflow cannot occur when adding operands with different signs.
在二进制算术中,忘记补码中最高有效位 (MSB) 代表负权重,会导致错误的十进制转换。当两个数相加时,若向 MSB 的进位与 MSB 的进位出不同,则发生溢出。考生常通过检查结果的符号是否异常来检测溢出,但忘记当操作数符号不同时不可能发生溢出。
Example: 4-bit two’s complement: 5 (0101) + 4 (0100) = 9, but result is 1001 which is -7 in two’s complement – overflow because a positive sum fitted a negative representation. Correct range for 4-bit is -8 to +7.
示例:4 位补码:5 (0101) + 4 (0100) = 9,但结果为 1001(补码中为 -7)——由于正数之和用负数表示,发生溢出。4 位正确范围是 -8 到 +7。
8. Time Complexity Misestimation | 时间复杂度误判
Pseudocode questions often require deriving Big-O notation. Many students mistake a nested loop always as O(n²); however, if the inner loop runs a constant number of times or is independent of the outer loop size, complexity may be O(n). Another pitfall is ignoring hidden constants: O(2n + log n) should be simplified to O(n). Recursive algorithms merit careful analysis – a recursion tree often reveals O(2ⁿ) complexity for naive binary recursion.
伪代码题常要求推导大 O 表示法。许多学生误认为嵌套循环总是 O(n²);但如果内循环运行的次数是常数,或与外部循环大小无关,复杂度可能是 O(n)。另一个陷阱是忽略隐藏常数:O(2n + log n) 应化简为 O(n)。递归算法需要仔细分析——递归树常揭示简单二分递归的复杂度为 O(2ⁿ)。
T(n) = 2T(n/2) + n → O(n log n) by Master Theorem
T(n) = 2T(n/2) + n → 根据主定理为 O(n log n)
Always state the worst-case complexity unless asked otherwise, and justify your answer by describing the dominant term.
除非另有要求,始终说明最坏情况复杂度,并陈述主要项来证明你的答案。
9. Poor Variable Scope and Local vs Global | 变量作用域与局部/全局混淆
Questions that give a pseudocode function with both global and local variables test understanding of scope. A common mistake is assuming that assigning a new value to a parameter inside a function will change the global variable passed by value – in many pseudocode conventions, arguments are passed by value unless specified as by reference. Similarly, not declaring a variable locally may inadvertently modify a global, producing side effects.
给出一个函数伪代码、同时包含全局和局部变量,这类题目考查作用域的理解。一个常见错误是认为在函数内部给参数赋新值会改变通过值传递的全局变量——在许多伪代码约定中,除非指定为 by reference,实参按值传递。同样,未声明局部变量可能无意中修改全局变量,产生副作用。
- Golden rule: Trace scope line by line. Note which variables are parameters, local, and global. Use a stack table to keep track of values after each function call.
- 黄金法则:逐行追踪作用域。注意哪些变量是参数、局部变量和全局变量。使用栈表记录每次函数调用后的值。
10. Database Normalisation Oversimplification | 数据库规范化过度简化
Candidates recognise that repeated groups violate 1NF and that partial key dependencies violate 2NF, but they often struggle to identify transitive dependencies for 3NF. A table in 2NF can still suffer from update anomalies if a non-key attribute depends on another non-key attribute. For instance, Order(OrderID, CustomerID, CustomerName) – CustomerName depends on CustomerID, not directly on OrderID, so it must be moved to a separate Customer table to reach 3NF.
考生能识别重复组违反第一范式 (1NF),部分键依赖违反第二范式 (2NF),但通常难以识别第三范式 (3NF) 的传递依赖。一个 2NF 的表,若非键属性依赖于另一非键属性,仍可能存在更新异常。例如,Order(OrderID, CustomerID, CustomerName)——CustomerName 依赖于 CustomerID,而非直接依赖于 OrderID,因此必须将其移到一个单独的 Customer 表中以达到 3NF。
Always state which normal form a table currently violates and provide a decomposition that removes the problematic dependency while preserving data.
始终说明当前表违反了哪种范式,并提供分解方案,去除有问题的依赖关系,同时保持数据不丢失。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导