跳到主要内容

← 国际文凭组织 · IB Diploma · 计算机科学 · HL

复习题

PDF ↓

原始教学材料。在使用其进行评估前,请检查课程覆盖缺口及贵校现行考试大纲。

原始开放焦点复习;完整规格覆盖仍不完整。

1 · 计算系统、网络与需求

authentication · authorization

ib_computer_science_hl:computing_systems:open:1 · 2 分

以下哪个问题涉及授权?

  • 你是谁?
  • 该用户是否有权限编辑此记录?
  • 登录界面的颜色是什么?
答案与解析

该用户是否有权限编辑此记录?

  • Separate authentication from authorization. Authentication checks identity; authorization determines permitted actions. A threat model connects a valuable asset, a possible attack and an appropriate control.

ib_computer_science_hl:computing_systems:open:2 · 4 分

一个 40 兆位文件以 5 兆位每秒的速度传输。求理想传输时间。

答案与解析

8 s

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

带宽并非实际的端到端吞吐量。加密本身并不能确保正确的授权或消除所有安全风险。

2 · 网络:延迟、吞吐量与分层交付

throughput · latency

ib_computer_science_hl:networks:open:1 · 2 分

为什么完成时间会超过文件大小除以链路速率的结果?

  • 开销、排队及其他延迟
  • 比特没有大小
  • 所有网络都能瞬时传输
答案与解析

开销、排队及其他延迟

  • Transmission time depends on data size and rate. Total delay may also include propagation, processing and queueing. Encryption protects content under its assumptions but does not remove congestion or every metadata exposure.

ib_computer_science_hl:networks:open:2 · 4 分

一个12兆比特的文件通过一条3兆比特/秒的链路传输。计算理想传输时间。

答案与解析

4 s

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

一个兆字节包含八个兆比特(不考虑开销)。标称速率更快的链路并不保证低延迟或安全的端点。

3 · 关系数据库:键与关系

primary key · foreign key

ib_computer_science_hl:databases:open:1 · 2 分

哪种设计有助于避免客户地址更新时的数据冗余?

  • 将客户与订单分离并通过键关联
  • 在无规则的情况下于每个订单中重复记录地址
  • 使用姓名作为保证唯一的标识符
答案与解析

将客户与订单分离并通过键关联

  • A join combines rows according to a specified condition. The result count depends on relationship cardinality and filters. A foreign key constraint enforces a relationship rule; it does not automatically encrypt personal data.

ib_computer_science_hl:databases:open:2 · 4 分

三位顾客分别有1、3和2笔订单。客户-订单内连接返回多少行?

答案与解析

6 行

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

主键不必是人名。连接不是简单的表拼接。对于不可信输入应使用参数化查询,而不是通过原始字符串构建SQL语句。

4 · 数据模型与负责任的机器学习

primary key · data leakage

ib_computer_science_hl:computing_data:open:1 · 2 分

为什么要将测试数据与训练数据分开?

  • 为了评估对未见案例的泛化能力
  • 为了确保因果关系
  • 为了使所有预测都正确
答案与解析

为了评估对未见案例的泛化能力

  • A primary key uniquely identifies a record; a foreign key relates records. In prediction, leakage can expose information unavailable at the real decision time. Accuracy alone may hide an unbalanced target distribution.

ib_computer_science_hl:computing_data:open:2 · 4 分

某模型在80次预测中正确了72次。求准确率百分比。

答案与解析

90 %

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

高准确率并非公平性或因果理解的确凿证据。数据库主键不能仅凭哪个字段看起来重要就随意指定。

5 · 算法、执行轨迹与正确性证据

algorithm · boundary test

ib_computer_science_hl:computing_algorithms:open:1 · 2 分

在对列表应用普通二分搜索之前,必须满足什么条件?

  • 列表按照比较规则有序排列
  • 每个值都互不相同
  • 列表恰好包含十项
答案与解析

列表按照比较规则有序排列

  • State input conditions and expected outputs. Use boundary cases, empty collections where allowed, duplicates and invalid values. Distinguish a wrong algorithm from a wrong implementation or an incomplete requirement.

ib_computer_science_hl:computing_algorithms:open:2 · 4 分

线性搜索遍历了全部 14 个未匹配的项目。发生了多少次项目比较?

答案与解析

14 次比较

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

成功的样本测试不能证明对所有有效输入的正确性。在没有课程来源的情况下,不要将剑桥特定的伪代码语法引入IB课程。

6 · 对象:状态、行为与接口

encapsulation · instance

ib_computer_science_hl:oop:open:1 · 2 分

什么应该能防止无效的状态变更?

  • 一个检查并维持不变量的操作
  • 使每个字段均可公开写入
  • 假设用户不会犯错
答案与解析

一个检查并维持不变量的操作

  • A method call acts on a particular instance. State changes should satisfy preconditions and postconditions. Polymorphism lets code use a common interface with different implementations when the contract is respected.

ib_computer_science_hl:oop:open:2 · 4 分

一个实例起始值为 12 单位,增加了 8 并减少了 3。求其最终值。

答案与解析

17 单位

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

类不等于其某个实例。继承并不自动优于组合。仅仅隐藏字段并不能证明所有操作都能维持有效状态。

7 · 抽象数据类型:操作契约

stack · queue

ib_computer_science_hl:adt:open:1 · 2 分

哪种结构模拟普通的到达顺序排队系统?

  • 队列
  • 栈
  • 无契约的无序选择
答案与解析

队列

  • Choose the structure for the required access pattern. Complexity depends on implementation and assumptions: removing the first item from a shifting array differs from advancing a head pointer in a queue.

ib_computer_science_hl:adt:open:2 · 4 分

一个队列为空,接收了 7 个项目并移除了 4 个项目。求剩余数量。

答案与解析

3 个项目

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

ADT不是特定的内存布局。除非其契约定义了优先队列,否则队列不会按优先级排序。

8 · 计算机案例研究:评估一项拟议的系统

throughput · acceptance test

ib_computer_science_hl:computing_case_evidence:open:1 · 2 分

以下哪项陈述最能支持技术建议?

  • 与场景需求及可测量验收测试相关的机制
  • 缺乏场景证据的流行架构名称
  • 声称能证明所有性能属性的吞吐量测量值
答案与解析

与场景需求及可测量验收测试相关的机制

  • A recommendation should connect a requirement to a mechanism and an observable test. For example, a concurrency problem requires a strategy that prevents conflicting updates, plus tests demonstrating the invariant. A claim about faster response requires comparable workload measurements rather than only a complexity label. Evaluate alternatives under the same stated conditions.

ib_computer_science_hl:computing_case_evidence:open:2 · 4 分

一个虚构系统在30秒内成功处理了210个请求。计算吞吐量。

答案与解析

7次/秒

  • Appropriate relation; consistent substitution; correct result; meaningful unit and interpretation.

吞吐量并非响应时间。一项强建议指出其预期适用的条件以及可能证伪它的证据。当前官方计算机科学案例研究要求必须与适用的评估版本进行核对。

登录或创建账户

IGCSE, A-Level & AP