First 50 of 190 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Programming, object modelling and software development
In object-oriented programming, encapsulation primarily means:
- Bundling data with the methods that operate on it and controlling external access Correct answer.
- Making every attribute public with no restrictions
- Forbidding the use of methods entirely
- Compiling only to machine code without objects
Explanation
Encapsulation groups state and behaviour in a class and uses visibility to protect invariants - a core OOP idea tested in Saxon programming tasks.
Question 2Programming, object modelling and software development
Inheritance in OOP allows a subclass to:
- Convert itself into a primitive integer type
- Reuse and extend structure and behaviour defined in a superclass Correct answer.
- Delete the superclass from memory at compile time only
- Avoid having any attributes or methods
Explanation
Inheritance lets a subclass specialize a superclass while reusing shared fields and methods (is-a relationship).
Question 3Programming, object modelling and software development
Polymorphism (in the OOP sense most relevant to Abitur tasks) means:
- Programs may not use functions
- Only one class may exist in a project
- The same interface or method name can operate on objects of different related types Correct answer.
- Every variable must have a unique unrelated type forever
Explanation
Polymorphic calls dispatch to the appropriate overriding method based on the runtime type, enabling flexible designs.
Question 4Programming, object modelling and software development
A constructor in Java/Python-style OOP is primarily used to:
- Initialize a newly created object's state Correct answer.
- Destroy the operating system kernel
- Sort global arrays only
- Replace the need for any attributes
Explanation
Constructors (or __init__) run when an instance is created to set up initial attribute values and invariants.
Question 5Programming, object modelling and software development
An instance method differs from a class/static method in that it:
- Must not have a name
- Is identical to a SQL JOIN
- Operates on a specific object instance and can use its instance state Correct answer.
- Can never read any data
Explanation
Instance methods receive an implicit object (self/this) and may access that object's attributes; static methods belong to the class.
Question 6Programming, object modelling and software development
Overriding a method means:
- Deleting all methods from the superclass at runtime
- Renaming the subclass only
- Converting methods into global variables
- A subclass provides its own implementation of a method inherited from a superclass Correct answer.
Explanation
Overriding replaces inherited behaviour for the subclass while keeping the same method signature (subject to language rules).
Question 7Programming, object modelling and software development
Which principle prefers depending on abstractions (interfaces) rather than concrete classes?
- Dependency inversion / programming to an interface Correct answer.
- Always hard-coding every concrete class name with no abstraction
- Forbidding inheritance and interfaces
- Storing all data only in CPU registers
Explanation
Designing to interfaces reduces coupling so implementations can vary - a software-engineering idea aligned with modularization Lernziele.
Question 8Programming, object modelling and software development
A parameter passed by value means:
- The callee always modifies the caller's variable name binding in every language
- No data is transferred
- Only files can be parameters
- The callee receives a copy of the value (or reference value), so rebinding the parameter does not rebind the caller's variable Correct answer.
Explanation
In Java/Python, object references are passed by value: the callee cannot rebind the caller's variable, though mutable objects' contents may still change.
Question 9Programming, object modelling and software development
Which software quality criterion emphasizes self-explanatory names and clear structure?
- Understandability / readability Correct answer.
- Maximizing nested spaghetti control flow
- Hiding all names behind single-letter globals only
- Removing all comments and structure deliberately
Explanation
Saxon Handreichung lists Verständlichkeit and Lesbarkeit (clear names, comments, structure) among program quality criteria derived from software-quality thinking.
Question 10Programming, object modelling and software development
Association vs aggregation vs composition in UML modelling mainly differs by:
- Whether integers can be added
- The CPU clock speed required
- Whether SQL is used
- The strength/lifetime coupling between related objects Correct answer.
Explanation
Association is a general link; aggregation is a whole-part with weaker lifetime coupling; composition implies strong ownership/lifetime dependency.
Question 11Programming, object modelling and software development
A recursive function must typically include:
- A base case that stops recursion and a recursive case that progresses toward it Correct answer.
- Only infinite self-calls with no termination condition
- No parameters ever
- A mandatory SQL transaction
Explanation
Correct recursion needs a reachable base case; each recursive call should reduce the problem size toward that base.
Question 12Programming, object modelling and software development
Which control-flow structure repeats a block while a condition remains true, testing before each iteration?
- A class declaration
- while loop Correct answer.
- if-else without repetition
- A single assignment statement
Explanation
A while loop checks its condition before (or as) each iteration and continues while the condition holds.
Question 13Algorithms, recursion and complexity
In computer science, an algorithm is best defined as:
- A finite, precise sequence of unambiguous steps that solves a class of problems Correct answer.
- Any set of English sentences describing a computer
- A physical CPU instruction only
- A database table schema
Explanation
An algorithm is a finite, unambiguous, effective procedure that transforms inputs into outputs for a defined problem class - the foundation of algorithmic problem solving in the Saxon Informatik Lehrplan.
Question 14Algorithms, recursion and complexity
Which sorting algorithm repeatedly compares adjacent elements and swaps them if they are out of order?
- Hashing
- Bubblesort Correct answer.
- Binary search
- Depth-first search
Explanation
Bubblesort repeatedly passes through a list, swapping adjacent out-of-order pairs so that extreme values 'bubble' toward one end until the list is sorted.
Question 15Algorithms, recursion and complexity
What is the typical worst-case time complexity of Bubblesort on n elements?
- O(1)
- O(n!)
- O(n²) Correct answer.
- O(log n)
Explanation
In the worst case Bubblesort performs nested comparisons across the list, giving quadratic O(n²) growth in n.
Question 16Algorithms, recursion and complexity
Binary search on a sequence requires which precondition?
- The sequence must contain only unique values and be unsorted
- The sequence length must be a power of two
- No precondition is required
- The sequence must already be sorted in a consistent order Correct answer.
Explanation
Binary search repeatedly discards half the search interval by comparing with the middle element, which is correct only when the sequence is sorted.
Question 17Algorithms, recursion and complexity
What is the time complexity of binary search on a sorted list of n elements?
- O(log n) Correct answer.
- O(n²)
- O(n!)
- O(2^n)
Explanation
Each step halves the remaining interval, so the number of comparisons grows logarithmically with n: O(log n).
Question 18Algorithms, recursion and complexity
Which abstract data type follows the LIFO (Last-In, First-Out) principle?
- Unordered bag only
- Stack (Stapel) Correct answer.
- Queue (Schlange)
- Set with no order
Explanation
A stack removes the most recently pushed element first (LIFO), matching the Saxon Lehrplan emphasis on LIFO/FIFO principles.
Question 19Algorithms, recursion and complexity
Which abstract data type follows the FIFO (First-In, First-Out) principle?
- Binary search tree root only
- Hash table collision chain only
- Queue (Schlange) Correct answer.
- Stack (Stapel)
Explanation
A queue enqueues at the rear and dequeues from the front, so the earliest inserted element leaves first (FIFO).
Question 20Algorithms, recursion and complexity
In a singly linked list, each node typically stores:
- Only an index into a fixed array with no references
- Only a previous-node reference with no data
- A complete copy of every other list node
- A data value and a reference to the next node Correct answer.
Explanation
A singly linked list node holds its payload plus a pointer/reference to the successor, enabling dynamic insertion without shifting an array.
Question 21Algorithms, recursion and complexity
Which traversal of a binary tree visits left subtree, then root, then right subtree?
- In-order (Inorder) Correct answer.
- Pre-order only
- Level-order only
- Post-order only
Explanation
In-order traversal processes left, then root, then right. For a binary search tree this yields keys in sorted order.
Question 22Algorithms, recursion and complexity
Which traversal visits the root before its left and right subtrees?
- Reverse in-order only
- Pre-order (Preorder) Correct answer.
- In-order only
- Post-order only
Explanation
Pre-order visits the root first, then recursively the left and right subtrees - useful for copying a tree's structure.
Question 23Algorithms, recursion and complexity
In a binary search tree (BST), for every node which property holds?
- Keys may appear in any order with no relation to position
- Every node must have exactly two children
- All keys in the left subtree are less than the node's key, and all keys in the right subtree are greater Correct answer.
- Left keys are always greater than the node's key
Explanation
BST search structure places smaller keys left and larger keys right (ties handled by a chosen convention), enabling logarithmic search when the tree is balanced.
Question 24Algorithms, recursion and complexity
Inserting keys 5, then 3, then 7 into an empty BST yields which root?
- 3
- 7
- An empty tree with no root
- 5 Correct answer.
Explanation
The first inserted key becomes the root; later keys 3 and 7 attach as left and right children of 5.
Question 25Algorithms, recursion and complexity
Which sorting algorithm divides the list, sorts the halves recursively, then merges them?
- Mergesort Correct answer.
- Bubblesort
- Linear search
- Selection of a single median only
Explanation
Mergesort is a divide-and-conquer sort: split, recursively sort, then merge sorted runs in linear time, giving O(n log n) comparisons.
Question 26Algorithms, recursion and complexity
What is the typical time complexity of Mergesort for n elements?
- O(log log n)
- O(n log n) Correct answer.
- O(n²) always in every implementation
- O(1)
Explanation
Mergesort's recursion tree has about log n levels, each doing O(n) merge work, so overall O(n log n).
Question 27Algorithms, recursion and complexity
Quicksort's average-case time complexity for n elements is:
- O(1)
- O(n!)
- O(n log n) Correct answer.
- O(n²) only, never better
Explanation
With reasonably balanced pivots, Quicksort partitions into subproblems whose depths sum like O(n log n) on average.
Question 28Algorithms, recursion and complexity
When does classic Quicksort degrade to O(n²) worst case?
- Only when n is a prime number
- Never, under any pivot rule
- Only when the array contains strings
- When pivots repeatedly produce highly unbalanced partitions (e.g. already sorted input with a naive first/last pivot) Correct answer.
Explanation
If every pivot is an extreme element, one partition is empty and the other has n−1 elements, yielding quadratic total work.
Question 29Algorithms, recursion and complexity
Selection sort finds the minimum of the unsorted suffix and swaps it into position. Its typical time complexity is:
- O(n²) Correct answer.
- O(log n)
- O(n log n) with no nested scans
- O(1)
Explanation
Each of n positions may scan up to O(n) remaining elements, giving O(n²) comparisons regardless of input order.
Question 30Algorithms, recursion and complexity
Which statement about Insertion sort is correct?
- It is identical to binary search
- It builds a sorted prefix by inserting each next element into its proper place among already sorted elements Correct answer.
- It always requires Ω(n²) comparisons even on already sorted input
- It cannot sort integers
Explanation
Insertion sort grows a sorted prefix: each new key is inserted into the correct position among previous keys, often with shifting.
Question 31Algorithms, recursion and complexity
A complete binary tree of height h (root height 0) has at most how many nodes?
- 2h
- h²
- 2^(h+1) − 1 Correct answer.
- h
Explanation
Level i can hold up to 2^i nodes; summing i=0..h yields 2^(h+1)−1 nodes in a perfect tree of height h.
Question 32Algorithms, recursion and complexity
Which data structure is most natural for implementing an undo history of successive editor actions?
- Queue only
- Unordered set only
- A single integer counter only
- Stack Correct answer.
Explanation
Undo reverses the most recent action first, matching LIFO stack semantics (push actions, pop to undo).
Question 33Algorithms, recursion and complexity
Breadth-first search (BFS) on a graph typically uses which auxiliary structure?
- A queue Correct answer.
- A stack only
- A min-heap of random keys only
- No auxiliary structure ever
Explanation
BFS explores level by level: nodes are enqueued when discovered and dequeued in FIFO order.
Question 34Algorithms, recursion and complexity
Depth-first search (DFS) explores a graph by:
- Only visiting nodes with even degree
- Going as deep as possible along a path before backtracking Correct answer.
- Always expanding the shallowest unexplored node first
- Sorting all edges by weight then scanning once
Explanation
DFS plunges along a path to a dead end, then backtracks - implemented with a stack or recursion.
Question 35Algorithms, recursion and complexity
What does a hash table primarily provide under good hashing and load?
- Average-case O(1) insert/lookup/delete for keys Correct answer.
- Guaranteed O(log n) comparisons like a balanced BST always
- Sorted iteration without extra structures
- Only sequential scan of all keys
Explanation
Hashing maps keys to buckets; with a good hash function and moderate load factor, expected operations are O(1).
Question 36Algorithms, recursion and complexity
A post-order traversal of a binary tree visits nodes in which relative order?
- Right, root, left only as the sole definition
- Left subtree, right subtree, then root Correct answer.
- Root, left, right
- Left, root, right
Explanation
Post-order processes children before the parent - useful for deleting a tree or evaluating expression trees.
Question 37Algorithms, recursion and complexity
Which recurrence roughly describes Mergesort's divide-and-conquer cost T(n)?
- T(n) = O(1) for all n>1
- T(n) = T(n²) + n
- T(n) = 2 T(n/2) + O(n) Correct answer.
- T(n) = T(n−1) + O(1) only
Explanation
Mergesort splits into two halves (2 T(n/2)) and merges in linear time O(n), which solves to O(n log n).
Question 38Digital representation and data structures
How many bits are in one byte?
- 8 Correct answer.
- 4
- 16
- 1024
Explanation
By definition, one byte equals 8 bits. This is a foundational unit used in performing calculations with bits and bytes, a GACE Data objective.
Question 39Digital representation and data structures
An encoding scheme uses 8 bits to represent each character. How many distinct characters can it represent?
- 256 Correct answer.
- 8
- 128
- 16
Explanation
With n bits, you can represent 2 to the power n distinct values. For 8 bits, 2^8 = 256 distinct characters. Determining how many values a given number of bits can encode is a GACE Data objective.
Question 40Digital representation and data structures
Which statement correctly distinguishes lossy from lossless data compression?
- Lossless compression preserves all original data exactly, while lossy compression discards some data to achieve smaller file sizes Correct answer.
- Lossy compression always preserves every bit of the original data
- Lossless compression always produces smaller files than lossy compression
- There is no difference between lossy and lossless compression
Explanation
Lossless compression (for example, ZIP or PNG) lets the exact original data be reconstructed, while lossy compression (for example, JPEG or MP3) permanently discards some data to shrink files further. Describing lossy and lossless compression is a GACE Data objective.
Question 41Digital representation and data structures
A teacher explains the difference between encoding and encryption. Which statement is correct?
- Encoding transforms data into another format for usability and is easily reversible without a secret, while encryption secures data so it can be read only with a key Correct answer.
- Encoding and encryption are identical processes with the same purpose
- Encryption is used only to compress files, never to secure them
- Encoding requires a secret key to reverse, while encryption never does
Explanation
Encoding changes data into another format (such as ASCII or Base64) for storage or transmission and is reversible by anyone who knows the scheme, whereas encryption deliberately protects data so only a holder of the correct key can read it. Distinguishing encoding from encryption is a GACE Data objective.
Question 42Digital representation and data structures
Ordering common units of digital storage from smallest to largest, which sequence is correct?
- Kilobyte, megabyte, gigabyte, terabyte Correct answer.
- Gigabyte, megabyte, kilobyte, terabyte
- Terabyte, gigabyte, megabyte, kilobyte
- Megabyte, kilobyte, gigabyte, terabyte
Explanation
Each unit is roughly a thousand times larger than the previous: kilobyte, megabyte, gigabyte, then terabyte, from smallest to largest. Identifying measures of file size such as byte, kilo, mega, giga, tera, and peta is a GACE Data objective.
Question 43Digital representation and data structures
Approximately how many bytes are needed to store a plain-text document containing 2,000 characters, assuming one byte per character?
- About 2,000 bytes (roughly 2 kilobytes) Correct answer.
- About 16 bytes
- About 2 million bytes
- About 8 bytes
Explanation
If each character takes one byte, a 2,000-character document requires about 2,000 bytes, which is roughly 2 kilobytes. Determining the number of bits and bytes required to store a given amount of data is a GACE Data objective.
Question 44Digital representation and data structures
Why are binary numbers fundamental to the operation of computer systems?
- Digital hardware represents data using two-state electronic components, such as on/off or high/low voltage, which map naturally to the digits 0 and 1 Correct answer.
- Binary is the only number system that can represent fractions
- Binary uses ten digits, making it efficient for humans
- Binary cannot be converted to any other number base
Explanation
Computers are built from electronic components that have two stable states, commonly represented as 0 and 1, so binary is the natural language of digital hardware. Explaining why binary numbers are fundamental to computer systems is a GACE Data objective.
Question 45Digital representation and data structures
A run-length encoding scheme compresses the string AAAAA by storing it as 5A. This is an example of which kind of compression?
- Lossless compression, because the original string can be fully reconstructed Correct answer.
- Lossy compression, because data is permanently discarded
- Encryption, because the data is now secret
- Encoding into hexadecimal
Explanation
Run-length encoding records a count and the repeated symbol (5A for AAAAA) and allows the exact original string to be rebuilt, so it is lossless compression. Describing lossy and lossless compression is a GACE Data objective.
Question 46Digital representation and data structures
A given encoding scheme assigns A = 00, B = 01, C = 10, and D = 11. What string does the encoded sequence 011011 represent?
- BCD Correct answer.
- ABC
- DDB
- BDD
Explanation
Split the fixed-length sequence into two-bit groups from left to right: 01, 10, 11. These map to B, C, and D respectively, giving BCD. Decoding data given an encoding scheme is a GACE Data objective.
Question 47Entity modelling, relational algebra and SQL
In the relational model, a relation/table is best described as:
- An unsorted collection of arbitrary files only
- A CPU register file
- A set of tuples (rows) over a fixed set of attributes (columns) Correct answer.
- A single nested HTML page
Explanation
Relational tables have a schema of attributes; each row is a tuple of values for those attributes.
Question 48Entity modelling, relational algebra and SQL
A primary key uniquely identifies:
- Only columns, never rows
- The database server's IP address only
- Every SQL keyword
- Each row in a table Correct answer.
Explanation
The primary key's values uniquely identify tuples and must not be NULL (in standard relational practice).
Question 49Entity modelling, relational algebra and SQL
First Normal Form (1NF) requires that:
- All data is stored as free text only
- Attribute values are atomic (no repeating groups / nested tables in a cell) Correct answer.
- Every table has at least 100 columns
- No primary key exists
Explanation
1NF eliminates multi-valued/repeating groups so each intersection of row and column holds a single atomic value.
Question 50Entity modelling, relational algebra and SQL
An INNER JOIN between tables A and B returns:
- Only column names without data
- Only rows where the join condition matches in both tables Correct answer.
- All rows of A even without matches in B
- A Cartesian product with no condition ever
Explanation
INNER JOIN keeps combinations satisfying the ON/WHERE join predicate; unmatched rows from either side are dropped.