A Level Computer Science flashcards
Architecture, data structures, algorithms, networks, databases and theory of computation. 80 cards across 7 topics, each with its answer.
Computer Systems and Architecture
- 1
What are the two main components inside the CPU in the Von Neumann architecture?
Answer: The control unit and the arithmetic logic unit (ALU).
- 2
State the three stages of the fetch-decode-execute cycle.
Answer: Fetch, decode, execute.
- 3
What does the Program Counter (PC) store?
Answer: The memory address of the next instruction to be fetched.
- 4
What does the Memory Address Register (MAR) store?
Answer: The address in memory currently being accessed, ready to read from or write to.
- 5
What does the Memory Data Register (MDR) store?
Answer: The data or instruction just read from memory, or about to be written to it.
- 6
What is the role of the Current Instruction Register (CIR)?
Answer: It holds the instruction currently being decoded and executed by the control unit.
- 7
What does the Accumulator do in the Little Man Computer (LMC)?
Answer: It stores the result of the current calculation or the value most recently loaded.
- 8
In LMC assembly language, what does the instruction BRZ do?
Answer: Branches to the given address if the value in the accumulator is zero.
- 9
In LMC assembly language, what does the instruction BRP do?
Answer: Branches to the given address if the value in the accumulator is zero or positive.
- 10
What is pipelining in a CPU?
Answer: Overlapping the fetch, decode and execute stages of consecutive instructions so more instructions are completed per second.
Worked example: While instruction 1 is executing, instruction 2 can be decoded and instruction 3 fetched at the same time.
- 11
What is the purpose of cache memory?
Answer: To hold copies of frequently used instructions and data close to the CPU, since it is much faster to access than main memory (RAM).
Software Development and Systems Software
- 1
What is the difference between systems software and applications software?
Answer: Systems software manages the computer itself, such as the operating system; applications software lets the user carry out tasks, such as a word processor.
- 2
Name three functions of an operating system.
Answer: Memory management, process scheduling and managing peripherals (it also handles file management and provides a user interface).
- 3
What is utility software?
Answer: Software that helps maintain and optimise a computer system, for example disk defragmenters, anti-virus software and file compression tools.
- 4
What is the Waterfall model of software development?
Answer: A linear, sequential model where each stage (requirements, design, implementation, testing, maintenance) must be completed before the next one begins.
- 5
What is Agile software development?
Answer: An iterative approach that develops software in short cycles called sprints, delivering working increments and adapting to changing requirements.
- 6
Define encapsulation in object-oriented programming.
Answer: Bundling an object's data and the methods that operate on it together, hiding the internal details from code outside the object.
- 7
Define inheritance in object-oriented programming.
Answer: A mechanism where a subclass automatically gains the attributes and methods of a parent (super) class.
- 8
Define polymorphism in object-oriented programming.
Answer: The ability of different classes to respond to the same method call in their own way, for example by overriding a parent class's method.
- 9
What is a class in object-oriented programming?
Answer: A blueprint or template that defines the attributes and methods an object of that type will have.
- 10
What is the difference between an object and a class?
Answer: A class is the template; an object is a specific instance created from that class, with its own values for the class's attributes.
- 11
Name four programming paradigms studied at A Level.
Answer: Procedural, object-oriented, functional and declarative (logic) programming.
Data Representation and Boolean Algebra
- 1
Convert the binary number 10110 to denary.
Answer: 22
Worked example: Bit values 16, 8, 4, 2, 1: 16+0+4+2+0 = 22.
- 2
Convert the denary number 45 to 8-bit binary.
Answer: 00101101
Worked example: 45 = 32+8+4+1, so the bits at those place values are set: 00101101.
- 3
Convert the binary number 11110000 to hexadecimal.
Answer: F0
Worked example: Split into nibbles: 1111 = F, 0000 = 0.
- 4
Convert the hexadecimal value 2C to denary.
Answer: 44
Worked example: 2 x 16 = 32, plus C (12) x 1 = 12, giving 44.
- 5
Represent -5 as an 8-bit two's complement binary number.
Answer: 11111011
Worked example: 5 = 00000101. Invert the bits to get 11111010, then add 1 to get 11111011.
- 6
What range of values can an 8-bit two's complement number represent?
Answer: From -128 to +127.
- 7
In floating point representation, what do the mantissa and the exponent each represent?
Answer: The mantissa holds the significant digits of the number; the exponent shows how many places to shift the binary point.
- 8
Why was Unicode introduced alongside ASCII?
Answer: ASCII cannot represent every character used worldwide; Unicode uses more bits per character so it can represent characters from many more languages and symbol sets.
- 9
State De Morgan's law for NOT (A AND B).
Answer: NOT (A AND B) = (NOT A) OR (NOT B).
- 10
What is a Karnaugh map used for?
Answer: Simplifying a Boolean expression by grouping adjacent 1s in a grid of a truth table's outputs, to find the simplest equivalent logic circuit.
- 11
How many inputs does a half adder have, and what does it output?
Answer: Two inputs; it outputs a sum bit and a carry bit.
- 12
What is the key difference between a half adder and a full adder?
Answer: A full adder has an extra carry-in input, so full adders can be chained together to add multi-bit binary numbers; a half adder cannot.
Databases and Networks
- 1
What is a primary key in a relational database?
Answer: A field, or combination of fields, that uniquely identifies each record in a table.
- 2
What is a foreign key?
Answer: A field in one table that refers to the primary key of another table, used to link the two tables together.
- 3
Why is database normalisation carried out?
Answer: To reduce data redundancy and avoid update, insertion and deletion anomalies by organising data into well-structured tables.
- 4
What does a table need to satisfy First Normal Form (1NF)?
Answer: It must have no repeating groups, and every cell must hold a single, atomic value.
- 5
What does Second Normal Form (2NF) require, beyond 1NF?
Answer: The table is in 1NF and every non-key attribute depends on the whole primary key, not just part of it.
- 6
What does Third Normal Form (3NF) require, beyond 2NF?
Answer: The table is in 2NF and has no non-key attribute that depends on another non-key attribute (no transitive dependency).
- 7
Write the SQL to select the Name column from a table called Students where Age is greater than 16.
Answer: SELECT Name FROM Students WHERE Age > 16;
- 8
What does an SQL JOIN clause do?
Answer: It combines rows from two or more tables based on a related column between them.
- 9
What does ACID stand for in the context of database transactions?
Answer: Atomicity, Consistency, Isolation, Durability.
- 10
What are the separate roles of TCP and IP in the TCP/IP protocol suite?
Answer: TCP breaks data into packets, ensures reliable delivery and reassembles them; IP handles addressing and routing packets across networks.
- 11
What is the purpose of DNS (Domain Name System)?
Answer: It translates human-readable domain names, such as www.example.com, into the IP addresses computers use to locate each other.
Algorithms and Data Structures
- 1
What does Big O notation describe?
Answer: How the time or memory an algorithm needs grows as the size of its input increases, usually focusing on the worst case.
- 2
State the time complexity of a linear search in the worst case.
Answer: O(n)
- 3
State the time complexity of a binary search in the worst case.
Answer: O(log n)
- 4
What condition must a list meet before a binary search can be used on it?
Answer: The list must already be sorted.
- 5
State the time complexity of bubble sort in the average and worst case.
Answer: O(n^2)
- 6
State the average-case time complexity of merge sort.
Answer: O(n log n)
- 7
What sorting technique does merge sort use?
Answer: Divide and conquer: it repeatedly splits the list in half until each part has one item, then merges the parts back together in order.
- 8
Which data structure works on a Last In First Out (LIFO) basis?
Answer: A stack.
- 9
Which data structure works on a First In First Out (FIFO) basis?
Answer: A queue.
- 10
What is a linked list?
Answer: A data structure of nodes, each storing a value and a pointer to the next node, allowing efficient insertion and deletion without shifting other items.
- 11
What is the key difference between breadth-first and depth-first graph traversal?
Answer: Breadth-first visits all of a node's neighbours before going deeper, using a queue; depth-first follows one path as far as possible before backtracking, using a stack.
- 12
What problem does Dijkstra's algorithm solve?
Answer: Finding the shortest path from a starting node to every other node in a weighted graph.
- 13
Why must every recursive function have a base case?
Answer: Without one the function would keep calling itself indefinitely, eventually causing a stack overflow.
Theory of Computation
- 1
What is a finite state machine (FSM)?
Answer: An abstract model of computation with a finite number of states, transitions between states triggered by inputs, and one or more accepting states.
- 2
What is the difference between a deterministic and a non-deterministic finite state machine?
Answer: A deterministic FSM has exactly one transition for each input in every state; a non-deterministic FSM can have none, one or more possible transitions for the same input.
- 3
What three components make up the model of a Turing machine?
Answer: An infinite tape divided into cells, a read-write head that moves along the tape, and a finite set of states with transition rules.
- 4
What is the Church-Turing thesis?
Answer: The idea that anything which can be computed by an algorithm can be computed by a Turing machine.
- 5
What is the halting problem?
Answer: The problem of deciding, for an arbitrary program and input, whether that program will finish running or continue forever; it has been proven impossible to solve in general.
- 6
What does it mean for a problem to be decidable?
Answer: There exists an algorithm that always halts and gives a correct yes or no answer for every possible input.
- 7
What is meant by an intractable problem?
Answer: A problem that is solvable but for which no known algorithm can solve every instance in polynomial time, making it impractical for large inputs.
- 8
What does the complexity class P contain?
Answer: Decision problems that can be solved by an algorithm in polynomial time.
- 9
What does the complexity class NP contain?
Answer: Decision problems for which a proposed solution can be verified in polynomial time, even if finding that solution may take much longer.
- 10
What is a regular expression used for?
Answer: Describing a pattern of characters that a string can be matched against, for example to define which strings a language accepts.
- 11
What is a regular language?
Answer: A language that can be recognised by a finite state machine, equivalently one that can be described by a regular expression.
Legal, Moral, Cultural and Environmental Impact
- 1
What does the Computer Misuse Act 1990 make illegal?
Answer: Unauthorised access to computer material, unauthorised access with intent to commit further offences, and unauthorised modification of computer material.
- 2
What is the main purpose of the Data Protection Act / UK GDPR?
Answer: To control how organisations collect, store and use people's personal data, and to give individuals rights over their own information.
- 3
What does copyright law protect in relation to software?
Answer: The original code, design and other creative elements of software from being copied, distributed or sold without the owner's permission.
- 4
What is open source software?
Answer: Software whose source code is made publicly available, so anyone may view, use, modify and redistribute it, usually under a licence.
- 5
Give one environmental impact of large-scale computing.
Answer: The high energy consumption of data centres, and the electronic waste created when hardware is replaced.
- 6
What is meant by the digital divide?
Answer: The gap between people who have ready access to computers and the internet and those who do not, which can limit opportunity and access to services.
- 7
Give one way automation and AI can raise an ethical concern.
Answer: Job losses as tasks previously done by people are automated, or bias in decisions made by an AI system trained on unrepresentative data.
- 8
What is digital forensics?
Answer: The recovery and investigation of material found on digital devices, often used as evidence in criminal or civil cases.
- 9
Why might a company choose a proprietary licence over an open source one for its software?
Answer: To keep control of its source code and charge for the software, protecting its commercial advantage.
- 10
Give one cultural issue that can arise from software developed in one country being used worldwide.
Answer: The software may assume cultural norms, language or symbols, such as date formats or reading direction, that do not match every user's culture.
- 11
What is the difference between a legal obligation and a moral obligation for an organisation?
Answer: A legal obligation is a duty enforced by law; a moral obligation is what is considered right or fair, even where no law requires it.