Answer
Free flashcards · AQA A Level · 7517
Computer Science flashcards
140 cards covering every topic of the 7517 syllabus (2015-onwards). Study one topic or mix them all, turn each card, and mark yourself honestly.
Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.
Choose your cards
Session complete
Worth another look:
All 140 cards
For a quick read-through or printing. Cover the right-hand side to test yourself.
Topic 1: Fundamentals of programming
- What is the difference between a variable and a named constant?
- A variable’s value can change while the program runs. A named constant’s value is fixed; naming it makes code easier to read and to update in one place.
- What are the three basic programming constructs?
- Sequence (steps in order), selection (choosing a path, e.g. IF or CASE) and iteration (repetition: definite, e.g. FOR, or indefinite, e.g. WHILE).
- What is the difference between definite and indefinite iteration?
- Definite: the number of repetitions is known before the loop starts (count-controlled). Indefinite: the loop repeats until a condition is met; the condition may be tested at the start or the end.
- What is the difference between a local and a global variable?
- A local variable exists only inside the subroutine that declares it. A global variable can be accessed anywhere in the program. Local variables avoid unintended side effects.
- What is the difference between passing a parameter by value and by reference?
- By value: a copy is passed, so the original is unchanged. By reference: the memory address is passed, so changes affect the original.
- What is a stack frame?
- The data pushed onto the call stack for each subroutine call: the return address, the parameters and the local variables.
- What is exception handling?
- Code that detects an error at run time (such as a missing file or invalid input), deals with it and lets the program continue or end cleanly instead of crashing.
- What is a recursive subroutine and what must it have?
- A subroutine that calls itself. It needs a base case (stopping condition) that is reached after a finite number of calls; otherwise the stack overflows.
- What is the procedural-oriented paradigm?
- A program is a sequence of instructions grouped into subroutines (procedures and functions), with the problem solved by stepwise refinement into a hierarchy of modules.
- What are a class, an object and instantiation?
- Class: a template defining attributes and methods. Object: an instance of a class. Instantiation: creating an object from a class, using its constructor.
- What is encapsulation?
- Combining an object’s attributes and methods, with the attributes kept private and accessed only through public methods.
- What is inheritance?
- A subclass takes on the attributes and methods of its superclass and can add or override its own: an “is a” relationship.
- What is the difference between aggregation and composition?
- Both are “has a” relationships. Composition: the contained object is destroyed when its container is destroyed. Aggregation: the contained object can exist on its own.
- What is polymorphism and what is overriding?
- Polymorphism: the same method name behaves differently depending on the object’s class. Overriding: a subclass replaces a method it has inherited with its own version.
- What are the three OOP design principles in the AQA specification?
- Encapsulate what varies; favour composition over inheritance; program to interfaces, not implementation.
Topic 2: Fundamentals of data structures
- What is a data structure?
- A way of organising, storing and accessing data so that it can be used efficiently for a given task.
- What is the difference between a static and a dynamic data structure?
- Static: fixed size, set when it is created (e.g. an array). Dynamic: grows and shrinks as the program runs, using memory from the heap (e.g. a linked list).
- What are the advantages and drawbacks of static and dynamic structures?
- Static: no pointers needed and memory is known in advance, but space may be wasted or run out. Dynamic: uses only the memory needed, but pointers take space and memory can run out at run time.
- What does a 1-D array represent, and what does a 2-D array represent?
- A 1-D array is useful for a vector (a single ordered list, one index). A 2-D array is useful for a matrix (rows and columns, two indices).
- What is an n-dimensional array?
- A set of elements of the same data type, indexed by a tuple of n integers (one index per dimension).
- What is the difference between an array’s dimensionality and its size?
- Dimensionality: how many indices locate one element. Size: how many elements it holds in total. A 7 × 3 array is 2-D and holds 21 elements.
- What are a field, a record and a file?
- Field: one item of data about something (e.g. Surname). Record: a set of related fields about one item. File: a collection of records stored in secondary storage.
- What is the difference between a text file and a binary file?
- A text file stores data as characters and can be read in a text editor. A binary file stores data in the same binary form as in memory (e.g. records of integers and reals) and is not human-readable.
- What are the steps to read data from a file in a program?
- Open the file for reading, read records in a loop until the end of file is reached, then close the file.
- What is an abstract data type?
- A data type defined by the values it holds and the operations on it, without saying how it is implemented.
- Name the abstract data types in the AQA A-level specification.
- Queue, stack, graph, tree, hash table, dictionary and vector.
- Why is the idea of an abstract data type useful?
- Programs can use the operations (e.g. push and pop) without depending on the implementation, so the implementation can change without changing the code that uses it.
- How does a queue work?
- First in, first out (FIFO): items are added at the rear (enqueue) and removed from the front (dequeue).
- What is the difference between a linear and a circular queue?
- Linear: front and rear pointers only move forward, so freed space at the start of the array is not reused. Circular: the rear wraps round to the start of the array when it reaches the end, reusing space.
- What is a priority queue?
- A queue in which each item has a priority; items with higher priority are removed first, and items of equal priority leave in FIFO order.
- What should enqueue and dequeue check first?
- Enqueue: test whether the queue is full. Dequeue: test whether the queue is empty.
- How does a stack work?
- Last in, first out (LIFO): items are pushed onto and popped off the top, tracked by a top-of-stack pointer.
- What do the push, pop and peek operations do?
- Push adds an item to the top. Pop removes and returns the top item. Peek returns the top item without removing it.
- What are stack overflow and stack underflow?
- Overflow: pushing onto a stack that is already full. Underflow: popping from an empty stack.
- Give three uses of a stack.
- Storing return addresses and local variables for subroutine calls, evaluating Reverse Polish expressions, and undo operations.
- What are a graph, a weighted graph and a directed graph?
- Graph: vertices (nodes) joined by edges (arcs). Weighted: each edge has a value such as distance. Directed: edges go one way only.
- What is an adjacency matrix?
- A 2-D array where the entry in row i, column j shows whether there is an edge from vertex i to vertex j (or its weight).
- What is an adjacency list?
- For each vertex, a list of the vertices it is joined to (with weights if weighted).
- When is an adjacency matrix better than an adjacency list?
- A matrix suits a dense graph with many edges and gives quick edge look-up. A list suits a sparse graph, as it stores only the edges that exist and uses less memory.
- What is a tree?
- A connected, undirected graph with no cycles.
- What is a rooted tree?
- A tree with one vertex chosen as the root; every edge leads away from the root, giving parent–child relationships.
- What is a binary tree?
- A rooted tree in which each node has at most two children.
- What is a binary search tree used for?
- Storing items in order so they can be searched quickly: every left descendant is smaller than a node and every right descendant larger.
- What is a hash table?
- A data structure in which a hashing algorithm calculates the storage position of each item from its key, so items can be found almost immediately.
- What is a collision in a hash table?
- When two different keys hash to the same position.
- How can collisions be handled?
- Rehashing (e.g. store the item in the next free position, open addressing) or chaining (each position holds a list of the items that hash to it).
- What makes a good hashing algorithm?
- It is quick to calculate, spreads keys evenly over the table, and produces few collisions.
- What is a dictionary data structure?
- A collection of key–value pairs in which each value is looked up by its unique key.
- Give a use of a dictionary.
- Dictionary-based compression, such as counting or storing words and their codes; or storing settings by name.
- What are the main operations on a dictionary?
- Add a key–value pair, retrieve the value for a key, and delete a pair.
- How can a vector be represented?
- As a list of numbers, as a function, or as a geometric point (arrow) in space. A vector over ℝ with n components is written as ℝⁿ.
- What is the result of adding two vectors and scaling a vector?
- Addition gives a translation: add the components, e.g. [1, 2] + [3, 4] = [4, 6]. Scalar multiplication gives a scaling: 2 × [1, 2] = [2, 4].
- How is the dot product of two vectors calculated?
- Multiply matching components and add: [1, 2] · [3, 4] = 1 × 3 + 2 × 4 = 11.
- What can the dot product be used for?
- Finding the angle between two vectors, and calculating a parity bit (the dot product of the bits with a vector of 1s, over modulo 2).
Topic 3: Fundamentals of algorithms
- How does a breadth-first traversal of a graph work?
- Visit all the neighbours of the start vertex first, then their neighbours, and so on, using a queue. Finds the shortest path in an unweighted graph.
- How does a depth-first traversal of a graph work?
- Go as far as possible along one branch before backtracking, using a stack (or recursion). Used for navigating a maze.
- What are the pre-order, in-order and post-order traversals of a binary tree?
- Pre-order: node, left, right (copying a tree). In-order: left, node, right (outputs a binary search tree in order). Post-order: left, right, node (emptying a tree; producing Reverse Polish).
- What is Reverse Polish notation and why is it used?
- Postfix notation: the operator follows its operands, e.g. 3 4 + for 3 + 4. No brackets are needed, and it is easily evaluated with a stack.
- What are the time complexities of linear search, binary search and binary tree search?
- Linear search: O(n). Binary search: O(log n). Binary tree search: O(log n) for a balanced tree.
- How does a merge sort work, and what is its time complexity?
- Split the list into single items, then repeatedly merge pairs of sorted sublists into larger sorted lists. O(n log n).
- What is the time complexity of bubble sort?
- O(n²): each pass compares adjacent pairs, and up to n passes may be needed.
- What does Dijkstra’s algorithm do?
- Finds the shortest path from a start vertex to every other vertex in a weighted graph (with no negative weights), using a priority queue.
Topic 4: Theory of computation
- What is a finite state machine (FSM)?
- A model of computation with a finite set of states, a start state, inputs and transitions between states. An FSM with no output can accept or reject input strings.
- What is a Mealy machine?
- A finite state machine with outputs, where each output is determined by the current state and the input (shown on the transitions).
- What is a regular expression? What do *, + and ? mean?
- A way of describing a set of strings (a regular language). * : zero or more of the previous item. + : one or more. ? : zero or one. | separates alternatives.
- What is a Turing machine?
- A theoretical model of computation: a finite state machine with a read/write head on an infinitely long tape divided into cells, moving one cell left or right per step according to its transition rules.
- What is a universal Turing machine?
- A Turing machine that can simulate any other Turing machine by reading that machine’s description and its input from the tape: the idea behind the stored-program computer.
- What is the Halting problem?
- The problem of deciding, for any program and input, whether the program will eventually stop. It has been proved that no algorithm can solve it: some problems are not computable.
- What is the difference between tractable and intractable problems?
- Tractable: can be solved in polynomial time or better. Intractable: solvable in theory, but no polynomial-time algorithm is known, so heuristic methods are used for large inputs.
- Why is Backus–Naur Form (BNF) needed as well as regular expressions?
- Some languages, such as those with nested structures, cannot be described by regular expressions. BNF can define them, including recursive rules, so it is used to define programming language syntax.
- What is the order of complexity of an algorithm that halves the problem each step?
- Logarithmic, O(log n), as in binary search. Constant O(1) < logarithmic < linear O(n) < polynomial O(n²) < exponential O(2ⁿ).
Topic 5: Fundamentals of data representation
- What is the difference between kibi and kilo prefixes?
- Kibi (Ki) = 2¹⁰ = 1024; mebi (Mi) = 2²⁰; gibi (Gi) = 2³⁰. Kilo (k) = 10³ = 1000; mega = 10⁶; giga = 10⁹.
- How do you represent a negative number in two’s complement?
- Write the positive value in binary, invert all the bits and add 1. The most significant bit has a negative place value (−128 in 8 bits).
- What is the difference between fixed point and floating point binary?
- Fixed point: the binary point is in a set position, giving fixed precision and a limited range. Floating point: a mantissa and an exponent, giving a much greater range for the same bits.
- Why is a floating-point number normalised?
- To give the maximum precision for the number of bits: the mantissa starts 01 for a positive number or 10 for a negative one.
- What is the difference between absolute and relative error?
- Absolute error: the difference between the true value and the stored value. Relative error: the absolute error divided by the true value.
- How do majority voting and check digits detect errors?
- Majority voting: each bit is sent three times and the receiver takes the value that appears most often. Check digit: a digit calculated from the others and added to the end, recalculated to check the number.
- What does Nyquist’s theorem state?
- To reproduce a sound accurately, the sampling rate must be at least twice the highest frequency in the sound.
- What is MIDI and what are its advantages?
- Musical Instrument Digital Interface: music stored as event messages (note on/off, pitch, duration, instrument), not samples. Files are much smaller and easy to edit, but cannot store vocals.
- What is the Vernam cipher, and why is it called perfectly secure?
- Each character is XORed with a character of a random key (one-time pad) at least as long as the message, used only once. The ciphertext gives no information about the plaintext.
- How do run-length encoding and dictionary-based compression work?
- RLE: a run of repeated values is stored as one value and a count. Dictionary-based: repeated patterns are stored once in a dictionary and replaced in the data by their codes. Both are lossless.
Topic 6: Fundamentals of computer systems
- What is the difference between system software and application software?
- System software runs and manages the computer (operating systems, utilities, libraries, translators). Application software performs tasks for the user.
- What is the role of an operating system?
- It hides the complexity of the hardware from the user and manages resources: processor scheduling, memory, input/output devices and files.
- What is the difference between low-level and high-level languages?
- Low-level (machine code, assembly) is close to the processor’s instruction set. High-level languages use English-like statements, are portable between processors and are easier to write and debug.
- What is the difference between a compiler, an interpreter and an assembler?
- Compiler: translates the whole high-level program into object code before it runs. Interpreter: translates and runs one statement at a time. Assembler: translates assembly language into machine code.
- What is bytecode?
- An intermediate code produced by a compiler that is then run by a virtual machine (interpreter) on the target computer, so the same code is platform-independent.
- What are the truth conditions for NAND, NOR and XOR?
- NAND: 1 unless both inputs are 1. NOR: 1 only if both inputs are 0. XOR: 1 if the inputs differ.
- What are the outputs of a half adder?
- Sum = A XOR B; Carry = A AND B.
- What does an edge-triggered D-type flip-flop do?
- It stores one bit: on the rising edge of the clock the output takes the value of the D input and holds it until the next clock edge. Used to build registers and memory.
- State De Morgan’s laws.
- NOT (A AND B) = NOT A OR NOT B NOT (A OR B) = NOT A AND NOT B
Topic 7: Fundamentals of computer organisation and architecture
- What is the stored program concept?
- Machine-code instructions are stored in main memory and are fetched and executed serially by a processor that carries out arithmetic and logical operations.
- What is the difference between Von Neumann and Harvard architecture?
- Von Neumann: instructions and data share one memory and bus. Harvard: separate memories and buses for instructions and data, so both can be fetched at once; used in embedded systems and digital signal processors.
- What do the program counter, MAR, MBR and CIR hold?
- PC: address of the next instruction. MAR: address to be read or written. MBR: data or instruction just read or to be written. CIR: the instruction being decoded and executed.
- What are the steps of the fetch-execute cycle?
- Fetch: copy PC to MAR; read memory into the MBR; increment PC; copy MBR to CIR. Decode: the control unit decodes the opcode. Execute: the instruction is carried out.
- What is the difference between immediate and direct addressing?
- Immediate: the operand is the value to use. Direct: the operand is the memory address holding the value.
- What are the opcode and the operand of an instruction?
- The opcode gives the operation (and addressing mode). The operand is the data or address it acts on.
- Which factors affect processor performance?
- Number of cores, cache memory size, clock speed, word length, and the width of the address and data buses.
- How does an RFID tag work?
- A reader sends radio waves that power a passive tag’s chip (or an active tag has its own battery); the tag transmits its stored data back to the reader by radio.
- How does a solid-state drive store data, compared with a hard disk?
- An SSD stores charge in NAND flash memory cells, with no moving parts, so access is faster. A hard disk uses magnetised regions on spinning platters read by a moving head, which is slower but cheaper per gigabyte.
Topic 8: Consequences of uses of computing
- Why do computers raise new moral, ethical, legal and cultural issues?
- They can collect, store, analyse and share huge amounts of personal data quickly and cheaply, so decisions by software developers can affect very many people.
- Why is it hard for legislation to keep up with computing?
- Technology changes faster than laws are made, and the internet crosses national borders, so it is hard to decide which country’s laws apply and to enforce them.
- What are the arguments about monitoring behaviour online?
- For: helps prevent crime and terrorism. Against: invades privacy, can be misused, and data can be leaked or used without consent.
- How can algorithms embed bias?
- If they are trained on biased data or designed with biased assumptions, automated decisions (e.g. in recruitment or credit) can treat groups unfairly, often without anyone noticing.
- Who is responsible when software causes harm?
- A key ethical question: developers, the organisations that deploy software and users all bear some responsibility, which is why professional codes of conduct and testing matter.
Topic 9: Fundamentals of communication and networking
- What is the difference between serial and parallel transmission?
- Serial: bits sent one after another along a single wire. Parallel: several bits sent at once on separate wires. Serial is used over longer distances because parallel suffers from skew and crosstalk.
- What is the difference between baud rate and bit rate?
- Baud rate: the number of signal changes per second. Bit rate: the number of bits sent per second. Bit rate can exceed baud rate when each signal change encodes more than one bit.
- What are start and stop bits used for?
- In asynchronous serial transmission, a start bit tells the receiver a byte is coming and a stop bit marks its end, so sender and receiver keep in step.
- How does CSMA/CA with RTS/CTS work on WiFi?
- A device listens and transmits only when the channel is free. With RTS/CTS it sends a Request to Send and waits for the access point’s Clear to Send before transmitting.
- What are the four layers of the TCP/IP stack?
- Application (e.g. HTTP), Transport (TCP: splits data into numbered segments and adds port numbers), Network (IP: adds IP addresses and routes packets), Link (adds MAC addresses for the physical network).
- What is a socket?
- The combination of an IP address and a port number, which identifies one end of a connection to a particular process on a host.
- What does network address translation (NAT) do?
- It lets devices with private IP addresses share one public IP address: the router replaces the private address with its public one on outgoing packets and keeps a table to route replies back.
- What does DHCP do?
- Dynamic Host Configuration Protocol automatically gives a device an IP address (and settings such as the gateway) from a pool when it joins a network.
- What is a subnet mask used for?
- ANDing an IP address with the subnet mask gives the network identifier, showing whether another host is on the same subnet or must be reached through a router.
- What is the difference between JSON and XML for data exchange?
- Both are text formats. JSON is shorter, easier for people to read and quicker for computers to parse. XML is more verbose but allows more complex structures and validation.
- What is the difference between symmetric and asymmetric encryption?
- Symmetric: one shared key encrypts and decrypts. Asymmetric: data encrypted with the recipient’s public key can only be decrypted with their private key.
Topic 10: Fundamentals of databases
- What are an entity, an attribute and a relationship?
- Entity: something about which data is stored (e.g. Student). Attribute: a property of an entity (e.g. DateOfBirth). Relationship: a link between entities (one-to-one, one-to-many, many-to-many).
- What are a primary key, a composite key and a foreign key?
- Primary key: uniquely identifies each record. Composite key: a primary key made of two or more attributes. Foreign key: an attribute that is the primary key of another table, linking the two.
- Why are databases normalised?
- To remove data redundancy and so avoid update, insertion and deletion anomalies, keeping data consistent. A database in third normal form has attributes that depend on the key, the whole key and nothing but the key.
- Write an SQL query to list names of students in Year 12, sorted by name.
- SELECT Name FROM Student WHERE Year = 12 ORDER BY Name;
- What do the SQL statements INSERT, UPDATE and DELETE do?
- INSERT INTO adds a new record. UPDATE … SET … WHERE changes values in existing records. DELETE FROM … WHERE removes records.
- What problem arises when two users update the same record at once in a client-server database?
- Lost update: one user’s change overwrites the other’s. It is prevented by record locking, serialisation, timestamp ordering or commitment ordering.
- What is record locking?
- When one transaction is updating a record, the record is locked so no other transaction can change it until the first is finished. It can cause deadlock if two transactions wait for each other.
Topic 11: Big Data
- What is Big Data?
- Data that will not fit on a single server and is too large or complex for a conventional relational database, described by volume, velocity and variety.
- What do volume, velocity and variety mean for Big Data?
- Volume: too much data for one server. Velocity: data arrives, and must be processed, very quickly (often streamed). Variety: many types of data, often unstructured (text, images, video).
- Why is Big Data processed across many machines?
- One machine cannot store or process it fast enough, so the work is split across a cluster of servers working in parallel.
- Why is functional programming suited to distributed processing of Big Data?
- Functions have no side effects and data is immutable, so parts of the work can run in parallel on different machines without interfering with each other.
- What is the fact-based model for representing data?
- Each fact holds one piece of information and is immutable and timestamped; facts are never overwritten, so the history is kept.
- What is a graph schema?
- A way of showing the structure of a dataset as a graph: nodes for entities, edges for the relationships between them, and properties stored on the nodes.
Topic 12: Fundamentals of functional programming
- What is a function in functional programming?
- A rule that maps each value in its domain to a value in its co-domain, written f: A → B. It has no side effects: the same input always gives the same output.
- What does it mean that functions are first-class objects?
- They can be assigned to variables, passed as arguments, and returned as the results of other functions.
- What is a higher-order function?
- A function that takes a function as an argument, returns a function, or both. Examples: map, filter and reduce (fold).
- What do map, filter and reduce (fold) do?
- Map: applies a function to every item of a list, giving a new list. Filter: keeps the items that meet a condition. Reduce/fold: combines the items into one value using a function, e.g. a sum.
- What is partial function application?
- Fixing some of a function’s arguments to produce a new function of the remaining arguments, e.g. add 3 gives a function that adds 3 to its argument.
- What is function composition?
- Combining two functions so that the output of one becomes the input of the other: g ∘ f means apply f, then g.
- What are the head and tail of a list?
- Head: the first element. Tail: the list of everything after the first element. Head of [4, 3, 5] is 4; tail is [3, 5].
Topic 13: Systematic approach to problem solving
- What happens in the analysis stage?
- The problem is defined and the requirements are established with the client and users, often by interview and observation, and agreed as measurable objectives. A data model may be produced.
- What happens in the design stage?
- Plans are made for the solution: data structures, algorithms, modular structure, the user interface, and the testing strategy.
- Why is prototyping and agile development useful?
- Working versions are shown to users early and often, so feedback can be used to refine the requirements and design as development proceeds.
- What are normal, boundary and erroneous test data?
- Normal: typical valid data, should be accepted. Boundary: values on and just beyond the limits. Erroneous: invalid data, should be rejected.
- What happens in the evaluation stage?
- The finished system is judged against the original requirements and objectives, with feedback from users, and possible improvements are identified.
Flashcards by topic
- Topic 1 Fundamentals of programming 15 cards · 2 subtopics
- Topic 2 Fundamentals of data structures 39 cards · 11 subtopics
- Topic 3 Fundamentals of algorithms 8 cards
- Topic 4 Theory of computation 9 cards
- Topic 5 Fundamentals of data representation 10 cards
- Topic 6 Fundamentals of computer systems 9 cards
- Topic 7 Fundamentals of computer organisation and architecture 9 cards
- Topic 8 Consequences of uses of computing 5 cards
- Topic 9 Fundamentals of communication and networking 11 cards
- Topic 10 Fundamentals of databases 7 cards
- Topic 11 Big Data 6 cards
- Topic 12 Fundamentals of functional programming 7 cards
- Topic 13 Systematic approach to problem solving 5 cards
Written for AQA A-level Computer Science (7517), syllabus 7517 (2015-onwards).
Cards by Marlbridge Academic Team; 1 restate definitions from the 7517 revision notes. This deck has not yet been reviewed as a whole by a subject teacher. Report an error.