Cambridge practical and extended reasoning

Start questions

AI-assisted English content review; independent teacher approval pending.

Practice scope and review

Original, AI-authored English practice with worked guidance. Selected topics only; independent teacher review is pending. This is not a complete syllabus, official past-paper collection or predicted exam score. Check your own exam-board specification: these concepts are not certified against a particular board or exam year.

160 original questions across 22 selected topic areas. No account or payment required to practise.

Cambridge International AS & A Level Computer Science (9618), examination year 2027: AI-assisted conceptual alignment to official sources, not teacher or exam-board certification. Syllabus mapping and remaining coverage.

5 questions in this topic

Exact English revisions checked in an AI-assisted academic review; independent teacher approval is still pending.

All topics

Original multi-stage supplied-data practice. Partial written support only, not complete syllabus coverage, official results or practical certification.

5 of 5 questions shown

Loading saved responses

Question 1Hide question5 indicative marks

Supplied fictional sensor inputs are [0, 10, 100]. A draft mean_valid uses '0 < value < 100' and divides total by count with no empty check. Contract: accept integer readings from 0 to 100 inclusive (reject booleans), ignore all other entries, and return None if none qualify. Trace the corrected total/count after every input and give the return. Supply runnable Python 3 code and tests for boundaries, normal, abnormal, empty and all-invalid inputs; explain which tests expose each draft fault and what an honest execution-evidence record would contain. This is conceptual practice, not candidate Paper 4 execution. Give a connected worked response with calculations, justified conclusions and limitations. All datasets are original fictional practice, not official experiment results. Written/supplied-data work only; any actual laboratory or field activity requires teacher approval, risk assessment and supervision. No human trials. Primary reading: https://www.cambridgeinternational.org/Images/721397-2027-2029-syllabus.pdf

Cambridge 2027: Partial conceptual match

Runnable console model, trace and test evidence: selected written evidence only. Published Python block executed by regression test with additional independent oracle cases and a boundary-mutant check; learner execution explicitly unproven. Science practical-N and computing rN rows are internal identifiers, not official numbered leaf syllabus codes. Aggregate rows are only partially supported. Actual apparatus use, candidate coding execution and practical attainment are not demonstrated here. Independent teacher review remains required.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. For 0 the total remains zero but count increases to one; 10 gives total 10/count 2; 100 gives total 110/count 3. The draft would accept only 10 and return 10, so a normal middle-value test alone misses its boundary fault. Empty and all-invalid cases expose its unguarded division.
  2. import unittest
    
    def mean_valid(values):
        total = 0
        count = 0
        for value in values:
            if type(value) is int and 0 <= value <= 100:
                total += value
                count += 1
        return total / count if count else None
    
    class MeanTests(unittest.TestCase):
        def test_normal(self):
            self.assertEqual(mean_valid([20, 40]), 30)
        def test_boundaries(self):
            self.assertEqual(mean_valid([0, 100]), 50)
            self.assertAlmostEqual(mean_valid([0, 10, 100]), 110 / 3)
        def test_abnormal(self):
            self.assertIsNone(mean_valid([-1, 101, True, 3.5, '5', None]))
        def test_empty(self):
            self.assertIsNone(mean_valid([]))
    
    if __name__ == '__main__':
        unittest.main()
  3. A plausible alternative is a filtered list plus sum/len with the same explicit type and empty rules, trading extra storage for brevity. Capture the exact code revision, environment, test inputs, expected/actual returns and pass/fail output, then document any correction and regression rerun. Do not fabricate a screenshot or say a learner ran this because the author tested it. A small passing suite does not prove correctness for arbitrary iterables or establish practical assessment competence.

Self-marking points

Tick what your working earned. The count is your own self-assessment.

Self-assessed: not counted yet. This question is worth 5 marks.

Examiner tip

Indicative original worked practice, independent teacher approval pending. Explain assumptions and alternatives; do not equate a correct written answer with observed practical performance.

Question 2Fictional import contract: an ID must be exactly three ASCII digits (leading zeros allowed), a reading must be an integer 0..100, and duplicate IDs are rejected within the batch. Records are ('007',0), ('008',100), ('007',50), ('009',101), ('01A',25). Work through acceptance in order, identify checks and design boundary tests. The source document says 50 for ID 008. Explain why a valid imported 100 is still wrong, and compare visual/double-entry verification with a checksum. No real personal data are used. Give a connected worked response with calculations, justified conclusions and limitations. All datasets are original fictional practice, not official experiment results. Written/supplied-data work only; any actual laboratory or field activity requires teacher approval, risk assessment and supervision. No human trials. Primary reading: https://www.cambridgeinternational.org/Images/721397-2027-2029-syllabus.pdf5 indicative marks

Fictional import contract: an ID must be exactly three ASCII digits (leading zeros allowed), a reading must be an integer 0..100, and duplicate IDs are rejected within the batch. Records are ('007',0), ('008',100), ('007',50), ('009',101), ('01A',25). Work through acceptance in order, identify checks and design boundary tests. The source document says 50 for ID 008. Explain why a valid imported 100 is still wrong, and compare visual/double-entry verification with a checksum. No real personal data are used. Give a connected worked response with calculations, justified conclusions and limitations. All datasets are original fictional practice, not official experiment results. Written/supplied-data work only; any actual laboratory or field activity requires teacher approval, risk assessment and supervision. No human trials. Primary reading: https://www.cambridgeinternational.org/Images/721397-2027-2029-syllabus.pdf

Cambridge 2027: Partial conceptual match

Validation, verification and a false reassurance: selected written evidence only. Ordered acceptance, preserved leading zeros, accepted aggregate and boundary outcomes independently checked; validity separated from truth. Science practical-N and computing rN rows are internal identifiers, not official numbered leaf syllabus codes. Aggregate rows are only partially supported. Actual apparatus use, candidate coding execution and practical attainment are not demonstrated here. Independent teacher review remains required.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. Treat IDs as strings so '007' retains its zeros. Require length three and each character between '0' and '9', rather than a broad Unicode digit predicate that accepts characters outside this contract. Maintain a set of accepted IDs; this batch gives two acceptances followed by three documented rejections. Mean accepted reading is (0 + 100)/2 = 50.
  2. Test readings -1, 0, 1, 99, 100, 101, an empty value, a string and a Boolean; test IDs '07', '007', '0007', '01A' and a repeated valid ID. State expected rejection reasons before running tests so a crash is not mistaken for controlled validation.
  3. The imported 100 passes range validation but disagrees with source 50. A source comparison or independent re-entry can detect transcription error; two identical entries do not guarantee the source itself is accurate. A transfer checksum compares encoded data integrity and admits collisions, so it is no substitute for source verification. Keep rejected records and correction provenance instead of silently changing them. Aggregate plausibility and passing test cases remain limited written evidence.

Self-marking points

Tick what your working earned. The count is your own self-assessment.

Self-assessed: not counted yet. This question is worth 5 marks.

Examiner tip

Indicative original worked practice, independent teacher approval pending. Explain assumptions and alternatives; do not equate a correct written answer with observed practical performance.

Question 3Simulate only a fictional temperature controller, initially OFF. For each valid reading, turn ON at temperature <=18, turn OFF at >=22, otherwise retain state. Missing input forces OFF and raises a fault; the next valid input clears the fault and applies the rule to that OFF state. Readings / degrees C are 17, 19, 21, 22, missing, 20, 18. Trace state/fault after each, describe state transitions, compare with one threshold at 20, and propose boundary, persistence and missing-data tests. Explain monitoring versus control and why this is not deployable heater safety logic. Give a connected worked response with calculations, justified conclusions and limitations. All datasets are original fictional practice, not official experiment results. Written/supplied-data work only; any actual laboratory or field activity requires teacher approval, risk assessment and supervision. No human trials. Primary reading: https://www.cambridgeinternational.org/Images/721397-2027-2029-syllabus.pdf5 indicative marks

Simulate only a fictional temperature controller, initially OFF. For each valid reading, turn ON at temperature <=18, turn OFF at >=22, otherwise retain state. Missing input forces OFF and raises a fault; the next valid input clears the fault and applies the rule to that OFF state. Readings / degrees C are 17, 19, 21, 22, missing, 20, 18. Trace state/fault after each, describe state transitions, compare with one threshold at 20, and propose boundary, persistence and missing-data tests. Explain monitoring versus control and why this is not deployable heater safety logic. Give a connected worked response with calculations, justified conclusions and limitations. All datasets are original fictional practice, not official experiment results. Written/supplied-data work only; any actual laboratory or field activity requires teacher approval, risk assessment and supervision. No human trials. Primary reading: https://www.cambridgeinternational.org/Images/721397-2027-2029-syllabus.pdf

Cambridge 2027: Partial conceptual match

Hysteresis trace and control limitations: selected written evidence only. State/fault trace recomputed including equality and missing recovery; history dependence and non-deployment safety boundary explicit. Science practical-N and computing rN rows are internal identifiers, not official numbered leaf syllabus codes. Aggregate rows are only partially supported. Actual apparatus use, candidate coding execution and practical attainment are not demonstrated here. Independent teacher review remains required.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. At 17 turn ON. Readings 19 and 21 lie inside the band so ON persists. At 22 turn OFF. Missing input sets OFF/fault true; 20 clears the fault but remains OFF inside the band. Finally 18 turns ON. The same temperature 20 may give ON or OFF depending on history, so this is not a stateless Boolean comparison.
  2. Describe OFF -> ON at <=18 and ON -> OFF at >=22 with self-loops in the band; missing data takes either state to OFF/fault. Test exactly 18 and 22, just inside/outside each threshold, long repeated in-band sequences, missing while ON, and recovery at 20. Record expected states before simulation and compare each step, not merely the final state.
  3. With one threshold at 20, noisy readings either side can switch repeatedly; separate thresholds reduce that behaviour. Hysteresis alone cannot detect a sensor stuck at 17 or an actuator stuck ON. Independent limits, fault handling and a context-specific risk assessment would be required by qualified engineers before any real control system. No hardware wiring, mains switching or human temperature trial is requested or authorised.

Self-marking points

Tick what your working earned. The count is your own self-assessment.

Self-assessed: not counted yet. This question is worth 5 marks.

Examiner tip

Indicative original worked practice, independent teacher approval pending. Explain assumptions and alternatives; do not equate a correct written answer with observed practical performance.

Question 5An encoder maps a list of strings to consecutive (value,count) runs; equal values separated by another value must remain separate runs. Trace input ['A','A','B','A']. Give Python 3 code that returns [] for empty input without changing the input. State tests that distinguish run-length encoding from frequency counting, and analyse time and auxiliary space, excluding the returned output. Assume string equality comparisons take constant time.5 indicative marks

An encoder maps a list of strings to consecutive (value,count) runs; equal values separated by another value must remain separate runs. Trace input ['A','A','B','A']. Give Python 3 code that returns [] for empty input without changing the input. State tests that distinguish run-length encoding from frequency counting, and analyse time and auxiliary space, excluding the returned output. Assume string equality comparisons take constant time.

Cambridge 2027: Partial conceptual match

cs9618-2027-v2: RLE compression (PDF15), test-data selection (PDF31), and Big O time/space (PDF37). One Python encoder exercises run representation, empty/boundary traces and complexity under constant-time string comparisons. Partial coverage only: not other compression algorithms, the full testing lifecycle, or assessed Paper4 practical competence.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. The first two A values form one run, B ends it, and the last A starts a new run. Counting all A values together would lose ordering and cannot reconstruct the original list.
  2. def encode(values):
        if not values:
            return []
        result = []
        current, count = values[0], 0
        for value in values:
            if value == current:
                count += 1
            else:
                result.append((current, count))
                current, count = value, 1
        result.append((current, count))
        return result
  3. The final append is necessary because no next value arrives to close the last run. Check [] -> [], ['A'] -> [('A',1)], ['A','A'] -> [('A',2)] and the supplied mixed input; compare the input with a saved copy afterwards. Each element is visited once. Only current and count are kept beyond result, giving constant auxiliary space; alternating strings can produce n output pairs. These are test expectations, not a claim of candidate execution evidence.

Self-marking points

Tick what your working earned. The count is your own self-assessment.

Self-assessed: not counted yet. This question is worth 5 marks.

Examiner tip

Support each conclusion with the stated evidence and reasoning. These are indicative self-marking points; other well-supported answers are acceptable. Independent teacher review pending.

All AS & A Level subjects