Docsity

AQA A-LEVEL COMPUTER SCIENCE PAPER 1, Exams of Computer Science

Toggle sidebar
bg1
AQA A-LEVEL COMPUTER SCIENCE PAPER 1
COMPREHENSIVE PRACTICE EXAMINATION
Topics: Fundamentals, Data Structures, Algorithms, Theory,
Systems
Total Questions: 150
Time: 2 hours 30 minutes
SECTION 1: PROGRAMMING FUNDAMENTALS &
PARADIGMS (25 Questions)
1. What is the output of the following Python code?
x = 10
y = 3
print(x // y)
A) 3.333
B) 3
C) 4
D) 3.0
Answer: B
Explanation: The // operator performs integer division (floor division), returning the largest
integer less than or equal to the result.
2. Which programming paradigm emphasizes procedures and functions?
A) Object-Oriented
B) Declarative
C) Procedural
D) Functional
Answer: C
Explanation: Procedural programming organizes code into procedures or functions that perform
operations on data.
3. What is encapsulation in OOP?
A) Hiding implementation details
B) Creating multiple instances
C) Inheriting properties
D) Overloading methods
Answer: A
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download AQA A-LEVEL COMPUTER SCIENCE PAPER 1 and more Exams Computer Science in PDF only on Docsity!

AQA A-LEVEL COMPUTER SCIENCE PAPER 1

COMPREHENSIVE PRACTICE EXAMINATION

Topics: Fundamentals, Data Structures, Algorithms, Theory,

Systems

Total Questions: 150

Time: 2 hours 30 minutes

SECTION 1: PROGRAMMING FUNDAMENTALS &

PARADIGMS (25 Questions)

  1. What is the output of the following Python code? x = 10 y = 3 print(x // y) A) 3. B) 3 C) 4 D) 3.

Answer: B Explanation: The // operator performs integer division (floor division), returning the largest integer less than or equal to the result.

  1. Which programming paradigm emphasizes procedures and functions? A) Object-Oriented B) Declarative C) Procedural D) Functional

Answer: C Explanation: Procedural programming organizes code into procedures or functions that perform operations on data.

  1. What is encapsulation in OOP? A) Hiding implementation details B) Creating multiple instances C) Inheriting properties D) Overloading methods

Answer: A

Explanation: Encapsulation bundles data and methods together while restricting access to some components.

  1. Which data type is immutable in Python? A) List B) Dictionary C) Tuple D) Set

Answer: C Explanation: Tuples are immutable - once created, their elements cannot be changed.

  1. What does this algorithm calculate? function calculate(n): if n <= 1: return n else: return calculate(n-1) + calculate(n-2) A) Factorial B) Fibonacci C) Power of 2 D) Sum of digits

Answer: B Explanation: This is the recursive Fibonacci sequence: F(n) = F(n-1) + F(n-2).

  1. Which is NOT a primitive data type? A) Integer B) String C) Boolean D) Array

Answer: D Explanation: Array is a composite data structure, not a primitive type.

  1. What will this code output? for i in range(5, 0, -1): print(i, end=" ") A) 5 4 3 2 1 B) 0 1 2 3 4 5 C) 5 4 3 2 1 0 D) 1 2 3 4 5

Answer: A

Answer: A Explanation: Array indexing is constant time due to direct memory addressing.

  1. Which is a dynamically typed language? A) Java B) C++ C) Python D) C#

Answer: C Explanation: Python determines variable types at runtime, making it dynamically typed.

  1. What does the 'break' statement do? A) Skips current iteration B) Exits the loop entirely C) Continues to next iteration D) Restarts the loop

Answer: B Explanation: 'break' immediately terminates the innermost loop.

  1. What is method overriding? A) Same method name, different parameters B) Child class redefining parent method C) Multiple methods with same name D) Static method definition

Answer: B Explanation: Overriding allows a subclass to provide a specific implementation of a method already defined in its parent class.

  1. Which is NOT a valid variable name in Python? A) _variable B) 2nd_value C) variable_name D) VariableName

Answer: B Explanation: Variable names cannot start with a digit.

  1. What will this return? def func(x=5): return x * 2

print(func()) A) 10 B) 5 C) Error D) None

Answer: A Explanation: Default parameter x=5 is used when no argument is provided, so 5*2=10.

  1. What is recursion? A) Function calling another function B) Function calling itself C) Infinite loop D) Parallel execution

Answer: B Explanation: Recursion occurs when a function calls itself to solve smaller instances.

  1. Which data structure is LIFO? A) Queue B) Stack C) Array D) Linked List

Answer: B Explanation: Stack is Last-In-First-Out (LIFO).

  1. What is an abstract class? A) Class that can't be instantiated B) Class with only methods C) Class without attributes D) Imported class

Answer: A Explanation: Abstract classes cannot be instantiated and often contain abstract methods.

  1. What does 'pass' do in Python? A) Skips code B) Placeholder for empty block C) Passes parameters D) Ends program

Answer: B Explanation: 'pass' is a null operation used as a placeholder.

D) Less memory usage

Answer: B Explanation: Linked lists can grow/shrink dynamically without reallocation.

  1. In a binary tree, what is a leaf node? A) Root node B) Node with no children C) Node with one child D) Largest node

Answer: B Explanation: Leaf nodes have no children.

  1. Which is FIFO? A) Stack B) Queue C) Tree D) Graph

Answer: B Explanation: Queue is First-In-First-Out (FIFO).

  1. What is a hash collision? A) Two keys map to same index B) Hash table is full C) Hash function error D) Key not found

Answer: A Explanation: Collision occurs when different keys produce the same hash value.

  1. What does this graph representation show? A = [[0,1,0],[1,0,1],[0,1,0]] A) Adjacency matrix B) Adjacency list C) Edge list D) Incidence matrix

Answer: A Explanation: This is an adjacency matrix for 3 nodes.

  1. Which tree traversal is root-left-right? A) In-order

B) Pre-order C) Post-order D) Level-order

Answer: B Explanation: Pre-order visits root, then left subtree, then right subtree.

  1. What is the height of a tree with one node? A) 0 B) 1 C) 2 D) Undefined

Answer: A Explanation: Height is number of edges from root to deepest leaf. Single node has height 0.

  1. Which is NOT a graph type? A) Directed B) Weighted C) Circular D) Connected

Answer: C Explanation: Circular is not a standard graph classification.

  1. What is a circular queue? A) Fixed-size, wraps around B) Unlimited size C) Stack-like queue D) Priority queue

Answer: A Explanation: Circular queues reuse empty slots when head advances.

  1. What is a binary search tree property? A) Left child < Parent < Right child B) All nodes have 2 children C) Complete tree D) Balanced tree

Answer: A Explanation: BST maintains ordering: left < parent < right.

  1. Which has O(1) average insert at end?
  1. What is an adjacency list? A) Array of linked lists B) 2D matrix C) Edge count array D) Vertex array

Answer: A Explanation: Each vertex has a list of adjacent vertices.

  1. Red-Black trees ensure: A) Perfect balance B) Approximate balance C) No duplicates D) Sorted order

Answer: B Explanation: They maintain approximate balance for efficient operations.

  1. Graph with no cycles is: A) Tree B) Complete graph C) Dense graph D) Directed graph

Answer: A Explanation: Tree is a connected acyclic graph.

  1. Which has worst-case O(n) search? A) Balanced BST B) Hash table C) Sorted array (binary search) D) Unsorted array (linear)

Answer: D Explanation: Linear search on unsorted array is O(n).

  1. What is a priority queue? A) FIFO with priorities B) LIFO with priorities C) Sorted by priority D) Random access

Answer: C Explanation: Elements are processed by priority, not insertion order.

  1. AVL trees differ from BST by: A) Self-balancing B) No ordering C) More children D) No root

Answer: A Explanation: AVL trees are self-balancing BSTs.

  1. Minimum spanning tree connects: A) All vertices, minimum weight B) Some vertices C) Maximum weight D) No cycles allowed

Answer: A Explanation: MST connects all vertices with minimum total edge weight.

  1. Which is a linear data structure? A) Tree B) Graph C) Array D) Network

Answer: C Explanation: Array stores elements in linear sequence.

  1. B-tree is optimized for: A) Disk storage B) Memory storage C) CPU cache D) Network transfer

Answer: A Explanation: B-trees minimize disk I/O operations.

  1. What is topological sorting for? A) Directed Acyclic Graphs B) Undirected graphs C) Weighted graphs D) Complete graphs

Answer: A

Answer: A Explanation: Trie stores strings with common prefixes.

SECTION 3: ALGORITHMS & COMPLEXITY (30 Questions)

  1. What is Big-O notation? A) Exact runtime B) Worst-case growth rate C) Best-case performance D) Average memory usage

Answer: B Explanation: Big-O describes upper bound of growth as input size increases.

  1. Binary search time complexity? A) O(1) B) O(log n) C) O(n) D) O(n²)

Answer: B Explanation: Each step halves the search space.

  1. Which sort has O(n log n) worst-case? A) Quick sort B) Merge sort C) Bubble sort D) Insertion sort

Answer: B Explanation: Merge sort is always O(n log n).

  1. What does Dijkstra's algorithm find? A) Shortest paths B) Minimum spanning tree C) Maximum flow D) Connected components

Answer: A Explanation: Dijkstra finds shortest paths from source to all vertices.

  1. Greedy algorithm characteristic? A) Always optimal B) Local optimal choices

C) Exhaustive search D) Backtracking

Answer: B Explanation: Makes locally optimal choice at each step.

  1. What is dynamic programming? A) Breaking into overlapping subproblems B) Random guessing C) Brute force D) Divide and conquer

Answer: A Explanation: Solves problems by combining solutions to overlapping subproblems.

  1. Traveling Salesman Problem complexity? A) O(n!) B) O(2^n) C) O(n²) D) O(n log n)

Answer: A Explanation: TSP has factorial complexity for exact solution.

  1. Which is NOT a sorting algorithm? A) Bubble sort B) Quick sort C) Depth-first sort D) Heap sort

Answer: C Explanation: Depth-first is graph traversal, not sorting.

  1. What is memoization? A) Storing computed results B) Memory allocation C) Garbage collection D) Cache clearing

Answer: A Explanation: Memoization caches function results to avoid recomputation.

  1. Best-case for comparison sorts? A) O(n log n)

A) Decidable B) Undecidable C) P problem D) NP problem

Answer: B Explanation: Turing proved halting problem is undecidable.

  1. Which algorithm uses "partition"? A) Quick sort B) Merge sort C) Bubble sort D) Selection sort

Answer: A Explanation: Quick sort partitions array around pivot.

  1. Backtracking is used for: A) Constraint satisfaction B) Sorting C) Searching D) Hashing

Answer: A Explanation: Backtracking solves CSPs by trying possibilities.

  1. What is heuristic? A) Rule of thumb B) Exact solution C) Random guess D) Proof method

Answer: A Explanation: Heuristic is a practical, not guaranteed optimal, approach.

  1. A* search uses: A) Heuristic + cost B) Random selection C) Exhaustive search D) Greedy only

Answer: A Explanation: f(n) = g(n) + h(n) where g is cost, h is heuristic.

  1. Which is stable sort? A) Merge sort B) Quick sort C) Heap sort D) Selection sort

Answer: A Explanation: Merge sort preserves relative order of equal elements.

  1. Time complexity of matrix multiplication? A) O(n³) B) O(n²) C) O(n log n) D) O(2^n)

Answer: A Explanation: Standard matrix multiplication is O(n³).

  1. What does BFS use? A) Queue B) Stack C) Heap D) Array

Answer: A Explanation: Breadth-First Search uses queue for traversal.

  1. Minimum comparisons to find max in array? A) n- B) n C) n/ D) log n

Answer: A Explanation: Need to compare each element (except first).

  1. Which is NOT a search algorithm? A) Linear B) Binary C) Exponential D) Fibonacci

Answer: D Explanation: Fibonacci is a sequence, not a search algorithm (though Fibonacci search exists).

Explanation: NP = problems where solutions can be verified quickly.

  1. What is approximation algorithm? A) Near-optimal solution B) Exact solution C) Random solution D) No solution

Answer: A Explanation: Provides solution close to optimal for hard problems.

SECTION 4: COMPUTER SYSTEMS & ARCHITECTURE (25 Questions)

  1. What does ALU do? A) Arithmetic/logic operations B) Memory access C) Control flow D) Input/output

Answer: A Explanation: Arithmetic Logic Unit performs calculations.

  1. Which is fastest memory? A) Registers B) Cache C) RAM D) SSD

Answer: A Explanation: Registers are in CPU, fastest but smallest.

  1. Von Neumann architecture has: A) Separate instruction/data memory B) Shared memory C) No memory D) Parallel processing

Answer: B Explanation: Single memory for both instructions and data.

  1. What is pipelining? A) Overlap instruction stages B) Multiple CPUs C) Faster clock

D) More cache

Answer: A Explanation: Multiple instructions in different stages simultaneously.

  1. Two's complement represents: A) Signed integers B) Floating point C) Characters D) Instructions

Answer: A Explanation: Standard method for signed binary integers.

  1. What is virtual memory? A) Disk as RAM extension B) Extra RAM C) CPU cache D) ROM

Answer: A Explanation: Uses disk space to extend apparent RAM.

  1. Which is volatile? A) RAM B) ROM C) SSD D) HDD

Answer: A Explanation: RAM loses data when powered off.

  1. What is cache hit? A) Data found in cache B) Cache miss C) Cache flush D) Cache write

Answer: A Explanation: Requested data is in cache.

  1. RISC vs CISC? A) RISC: simpler instructions B) CISC: simpler instructions