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
What is a class in object-oriented programming?
- A blueprint that defines attributes and methods for creating objects Correct answer.
- A single specific instance of data with no reusability
- A type of loop structure
- A network communication protocol
Explanation
A class defines the structure (attributes) and behavior (methods) shared by all objects created from it, serving as a reusable blueprint.
Question 2Programming, object modelling and software development
What is an object, as distinct from a class, in object-oriented programming?
- A specific instance of a class, with its own concrete attribute values Correct answer.
- The same thing as a class, with no distinction
- A type of network cable
- A purely mathematical function with no data
Explanation
An object is a concrete instance created from a class, holding its own specific attribute values while sharing the class's defined structure and methods.
Question 3Programming, object modelling and software development
What does 'encapsulation' (Kapselung) mean in object-oriented design?
- Bundling data and methods together while restricting direct external access to internal state Correct answer.
- Making all attributes public and directly modifiable from anywhere
- Deleting all class methods after use
- A synonym for a network firewall
Explanation
Encapsulation bundles an object's data and behavior together, typically restricting direct external access to internal attributes via private fields and public methods (getters/setters).
Question 4Programming, object modelling and software development
What is inheritance (Vererbung) in object-oriented programming?
- A mechanism where a subclass acquires attributes and methods from a parent (super)class Correct answer.
- A process where all classes must be identical to each other
- A synonym for encryption
- A method for deleting unused variables
Explanation
Inheritance allows a subclass to reuse and extend the attributes and methods of a parent class, supporting code reuse and hierarchical modeling.
Question 5Programming, object modelling and software development
What does a UML class diagram typically show?
- A class's name, attributes, methods, and relationships (e.g. inheritance, association) to other classes Correct answer.
- Only the source code's exact line numbers
- The physical wiring of a computer network
- The color scheme of a software application's interface
Explanation
A UML class diagram visually represents a class's name, attributes, methods, and its structural relationships (association, inheritance, etc.) to other classes.
Question 6Programming, object modelling and software development
What is a class attribute (Attribut) in object-oriented programming?
- A piece of data (property) associated with a class or its objects Correct answer.
- A function that performs an action on an object
- A synonym for the class name itself
- A type of network cable
Explanation
An attribute represents a data property belonging to a class or its instances, such as a 'name' or 'age' field.
Question 7Programming, object modelling and software development
What is a 'method' in object-oriented programming?
- A function defined within a class that operates on its data or performs an action Correct answer.
- A synonym for a data attribute
- A type of database table
- A physical computer component
Explanation
A method is a function defined inside a class that typically operates on the object's attributes or performs some behavior associated with the class.
Question 8Programming, object modelling and software development
What is polymorphism in object-oriented programming?
- The ability for different classes to be treated through a common interface, with each implementing behavior differently Correct answer.
- A requirement that all classes must have identical method implementations
- A synonym for a network protocol
- A method exclusively used for file compression
Explanation
Polymorphism allows objects of different classes to be accessed through a shared interface (e.g. a common parent class or method signature), while each class provides its own specific implementation of the behavior.
Question 9Programming, object modelling and software development
What is a 'Konstruktor' (constructor) in object-oriented programming?
- A special method used to initialize a new object's attributes when it is created Correct answer.
- A method that permanently deletes an object
- A synonym for a class's parent class
- A method that only works with network connections
Explanation
A constructor is a special method automatically invoked when a new object is instantiated, typically used to set initial values for the object's attributes.
Question 10Programming, object modelling and software development
What is 'Datenkapselung' combined with 'Geheimnisprinzip' (information hiding) meant to achieve in class design?
- Protecting an object's internal state from unintended external modification while exposing a controlled interface Correct answer.
- Making all data globally accessible with no restrictions
- Deleting all private fields from every class
- Encrypting all class names
Explanation
Encapsulation combined with information hiding protects internal object state from direct, unintended external modification, exposing only a controlled public interface (methods).
Question 11Programming, object modelling and software development
What is 'Abstraktion' (abstraction) as a core computer science modeling principle?
- Focusing on essential features of a problem or system while hiding unnecessary implementation details Correct answer.
- Making a program run as slowly as possible intentionally
- Encrypting all variable names in source code
- Removing all comments from a program permanently
Explanation
Abstraction involves representing the essential features of a problem or system while deliberately hiding or simplifying less relevant implementation details, a foundational computer science principle.
Question 12Programming, object modelling and software development
What role does a 'Schnittstelle' (interface) play in object-oriented software design?
- It defines a contract of methods a class must implement, without specifying how they are implemented Correct answer.
- It stores the actual data values of an object
- It is a synonym for a network router
- It physically connects two computers via a cable
Explanation
An interface defines a set of method signatures that implementing classes must provide, establishing a contract for behavior without dictating the specific implementation.
Question 13Algorithms, recursion and complexity
What is the time complexity of linear search in the worst case, for an array of n elements?
- O(n) Correct answer.
- O(1)
- O(log n)
- O(n^2)
Explanation
Linear search checks each element sequentially, so in the worst case (element at the end, or absent), it takes O(n) time.
Question 14Algorithms, recursion and complexity
What precondition must a data set meet for binary search to be applied correctly?
- The data set must be sorted Correct answer.
- The data set must be a linked list, never an array
- The data set must contain only even numbers
- The data set must have fewer than 10 elements
Explanation
Binary search relies on the data being sorted, allowing it to repeatedly eliminate half of the remaining elements based on comparison with the middle element.
Question 15Algorithms, recursion and complexity
What is the time complexity of binary search on a sorted array of n elements?
- O(log n) Correct answer.
- O(n)
- O(n^2)
- O(1) always, regardless of n
Explanation
Binary search repeatedly halves the search space, giving it a time complexity of O(log n).
Question 16Algorithms, recursion and complexity
What is 'Bubble Sort's basic sorting mechanism?
- Repeatedly comparing and swapping adjacent elements until the list is fully sorted Correct answer.
- Randomly shuffling elements until they happen to be sorted
- Always sorting in exactly one comparison, regardless of list size
- Splitting the list into two halves recursively
Explanation
Bubble Sort repeatedly steps through the list, compares adjacent elements, and swaps them if out of order, continuing until no swaps are needed.
Question 17Algorithms, recursion and complexity
What is the average/worst-case time complexity of Bubble Sort?
- O(n^2) Correct answer.
- O(n log n)
- O(log n)
- O(1)
Explanation
Bubble Sort's nested comparison structure gives it O(n^2) time complexity in the average and worst cases.
Question 18Algorithms, recursion and complexity
What sorting strategy does Merge Sort primarily use?
- Divide and conquer: recursively splitting the list, sorting the halves, then merging them back together Correct answer.
- Only swapping adjacent elements repeatedly
- Selecting the minimum element and moving it to the front repeatedly, with no recursion
- Randomly guessing an order until correct
Explanation
Merge Sort recursively divides the list into halves, sorts each half, and then merges the sorted halves back together - a classic divide-and-conquer algorithm.
Question 19Algorithms, recursion and complexity
What is the typical time complexity of Merge Sort?
- O(n log n) Correct answer.
- O(n^2)
- O(n)
- O(1)
Explanation
Merge Sort's divide-and-conquer structure gives it a time complexity of O(n log n) in all cases (best, average, worst).
Question 20Algorithms, recursion and complexity
What is recursion in algorithm design?
- A function that calls itself, typically with a base case to stop the repeated calls Correct answer.
- A function that can never call itself under any circumstances
- A synonym for a simple for-loop with no function calls
- A method exclusively used in network programming
Explanation
Recursion occurs when a function calls itself to solve smaller instances of the same problem, requiring a defined base case to terminate the recursive calls.
Question 21Algorithms, recursion and complexity
Why is a base case essential in a recursive function?
- Without it, the function would call itself indefinitely, causing infinite recursion (and typically a stack overflow) Correct answer.
- A base case has no real functional purpose in recursion
- It is only needed for iterative loops, not recursive functions
- It determines the function's variable naming convention
Explanation
A base case provides the stopping condition for recursion; without it, the function would recurse indefinitely, eventually causing a stack overflow error.
Question 22Algorithms, recursion and complexity
What does 'algorithmic complexity' (algorithmische Komplexität) generally measure?
- How the running time or memory usage of an algorithm scales with input size Correct answer.
- The number of lines of source code in a program
- The programming language used to implement the algorithm
- The color scheme of the algorithm's output
Explanation
Algorithmic complexity (e.g. Big-O notation) describes how an algorithm's resource usage, such as time or memory, grows as the size of its input increases.
Question 23Algorithms, recursion and complexity
What does a pseudocode representation of an algorithm typically provide?
- A structured, language-independent description of an algorithm's logic, without strict programming syntax Correct answer.
- The exact byte-level machine code
- A graphical illustration with no logical structure
- A synonym for a finished, compiled program
Explanation
Pseudocode presents an algorithm's logical steps in a structured, readable way that is independent of any specific programming language's exact syntax.
Question 24Algorithms, recursion and complexity
What is a 'Selection Sort' algorithm's basic strategy?
- Repeatedly finding the minimum (or maximum) element from the unsorted portion and moving it to the sorted portion Correct answer.
- Recursively splitting the list in half and merging
- Randomly shuffling elements until sorted
- Comparing only the first and last elements of the list
Explanation
Selection Sort repeatedly scans the unsorted portion of the list to find the minimum element and swaps it into its correct position at the front of the sorted portion.
Question 25Algorithms, recursion and complexity
What is the time complexity of Selection Sort in the average/worst case?
- O(n^2) Correct answer.
- O(n log n)
- O(n)
- O(1)
Explanation
Selection Sort's nested loop structure (finding the minimum for each position) gives it O(n^2) time complexity.
Question 26Algorithms, recursion and complexity
What does 'O(1)' (constant time) complexity mean for an algorithm's operation?
- The operation takes the same amount of time regardless of input size Correct answer.
- The operation always takes exactly 1 second to complete
- The operation's time grows linearly with input size
- The operation is impossible to perform in practice
Explanation
O(1) complexity means the operation's execution time does not depend on the size of the input - it remains constant regardless of how large the input grows.
Question 27Algorithms, recursion and complexity
What does 'Modularisierung' (modularization) mean in software design?
- Breaking a program into smaller, independent, reusable components (modules or functions) Correct answer.
- Writing the entire program as a single unbroken block of code
- Deleting all functions from a program
- Encrypting the entire codebase
Explanation
Modularization involves dividing a program into smaller, self-contained, reusable units (functions, classes, or modules), improving maintainability and clarity.
Question 28Algorithms, recursion and complexity
What is a 'Schleife' (loop) used for in an algorithm?
- Repeating a block of instructions multiple times, often until a condition is met Correct answer.
- Permanently halting all program execution
- Encrypting a variable's value
- Only used for network communication, never local computation
Explanation
A loop repeats a block of code multiple times, commonly controlled by a counter or a condition, and is a fundamental control structure in algorithm design.
Question 29Algorithms, recursion and complexity
What does an 'if-else' conditional structure allow a program to do?
- Execute different blocks of code depending on whether a specified condition is true or false Correct answer.
- Always execute every block of code regardless of any condition
- Only execute code once per program run, with no repetition ever
- Encrypt data conditionally with no other effect
Explanation
An if-else structure allows a program to branch, executing one block of code if a condition is true and a different block if it is false.
Question 30Algorithms, recursion and complexity
What is a common way to represent an algorithm's control flow visually, alongside pseudocode?
- A flowchart (Programmablaufplan/Struktogramm), showing sequence, decisions, and loops graphically Correct answer.
- A musical score
- A chemical structural formula
- A blueprint for a building's electrical wiring
Explanation
Flowcharts (or Struktogramme/Nassi-Shneiderman diagrams) visually represent an algorithm's sequence of steps, decision points, and loops as a graphical alternative or complement to pseudocode.
Question 31Algorithms, recursion and complexity
What is a 'Rekursionsschritt' (recursive step) in a recursive algorithm?
- The part of the function that reduces the problem to a smaller instance and calls itself again Correct answer.
- The part of the function that always halts the program immediately
- A step that is only used once and never repeated
- A step used exclusively for network encryption
Explanation
The recursive step is the part of a recursive function that reduces the problem toward the base case, calling the function again with a smaller or simpler input.
Question 32Algorithms, recursion and complexity
What is a classic example of a recursively defined function commonly used to teach recursion?
- The factorial function, n! = n x (n-1)! Correct answer.
- A function that always returns exactly zero
- A function that sorts a list without any loops or recursion
- A function that only works on network sockets
Explanation
The factorial function is a classic teaching example of recursion, defined as n! = n x (n-1)! with the base case 0! = 1.
Question 33Algorithms, recursion and complexity
What potential issue can arise from deep, unbounded recursion in a program?
- A stack overflow, due to exceeding the call stack's memory limit Correct answer.
- The program will always run faster than an equivalent loop
- The computer's hardware will be permanently damaged
- The program will automatically encrypt its own memory
Explanation
Excessive or unbounded recursion can exceed the call stack's available memory, causing a stack overflow error and program crash.
Question 34Algorithms, recursion and complexity
What is the purpose of a 'Testfall' (test case) when verifying an algorithm's correctness?
- Providing specific input with a known expected output to check whether the algorithm behaves correctly Correct answer.
- Permanently deleting the algorithm's source code
- Encrypting the algorithm so it cannot be read
- Randomly guessing whether the algorithm works with no structured input
Explanation
A test case provides a specific input along with its expected correct output, allowing a systematic check of whether an algorithm or program behaves as intended.
Question 35Algorithms, recursion and complexity
What is a 'Zwei-Wege-Verschmelzung' (two-way merge) step in Merge Sort?
- Combining two already-sorted sublists into a single sorted list by repeatedly comparing their front elements Correct answer.
- Randomly combining two unsorted sublists with no comparisons
- Deleting one of the two sublists entirely
- Encrypting both sublists before combining them
Explanation
The merge step in Merge Sort combines two already-sorted sublists into one sorted list by repeatedly comparing the smallest remaining elements of each sublist and appending the smaller one.
Question 36Algorithms, recursion and complexity
What does 'Terminierung' (termination) of an algorithm mean?
- The algorithm is guaranteed to eventually stop running after a finite number of steps, for any valid input Correct answer.
- The algorithm crashes immediately upon starting
- The algorithm always produces an error message
- The algorithm runs forever by design, with no stopping condition
Explanation
Termination means an algorithm is guaranteed to complete execution in a finite number of steps for any valid input, a fundamental correctness property distinct from producing the correct output.
Question 37Algorithms, recursion and complexity
What is a 'Rückgabewert' (return value) of a function/method?
- The value that a function sends back to the code that called it after completing execution Correct answer.
- A value that is permanently discarded and never usable
- A synonym for a function's name
- A value that only exists in network protocols
Explanation
A return value is the output a function or method sends back to its caller upon completing execution, which can then be used or stored by the calling code.
Question 38Algorithms, recursion and complexity
What is the relationship between a 'Teilproblem' (subproblem) and the divide-and-conquer algorithmic strategy?
- Divide-and-conquer breaks a problem into smaller subproblems, solves each, and combines their solutions Correct answer.
- A subproblem is always identical in size to the original problem, with no reduction
- Divide-and-conquer never involves any subproblems, only a single monolithic step
- Subproblems are only relevant to network protocols, not algorithm design
Explanation
Divide-and-conquer algorithms (like Merge Sort) work by breaking the original problem into smaller subproblems, solving each (often recursively), and then combining the partial solutions into the final result.
Question 39Algorithms, recursion and complexity
What is the significance of a 'Schleifeninvariante' (loop invariant) in verifying an algorithm's correctness?
- A condition that remains true before and after each iteration of a loop, helping prove the algorithm works correctly Correct answer.
- A variable that changes value randomly on each loop iteration with no pattern
- A synonym for the total number of loop iterations
- A value used only to encrypt loop counters
Explanation
A loop invariant is a logical condition that holds true at the start and end of every loop iteration, a key tool for formally reasoning about and proving an algorithm's correctness.
Question 40Digital representation and data structures
What is a linked list (verkettete Liste) data structure?
- A sequence of nodes where each node stores data and a reference (pointer) to the next node Correct answer.
- A fixed-size, contiguous block of memory with no node references
- A type of encryption algorithm
- A network topology diagram
Explanation
A linked list consists of nodes, each holding data and a reference to the next node, allowing flexible, non-contiguous memory allocation and easy insertion/deletion.
Question 41Digital representation and data structures
What is a binary tree (Binärbaum) data structure?
- A hierarchical structure where each node has at most two children (commonly called left and right) Correct answer.
- A structure where each node has exactly ten children
- A one-dimensional list with no hierarchy
- A network protocol for routing data
Explanation
A binary tree is a hierarchical data structure where each node has at most two child nodes, typically referred to as the left and right child.
Question 42Digital representation and data structures
What is a binary search tree (BST)?
- A binary tree in which, for every node, left-subtree values are smaller and right-subtree values are larger than the node's own value Correct answer.
- A binary tree with completely random, unordered node placement
- A tree with no left or right distinction at all
- A structure exclusively used for storing images
Explanation
A binary search tree maintains an ordering invariant: for each node, all values in its left subtree are smaller, and all values in its right subtree are larger, enabling efficient search.
Question 43Digital representation and data structures
What is a stack (Stapelspeicher) data structure's key access principle?
- LIFO (Last In, First Out) - the most recently added element is removed first Correct answer.
- FIFO (First In, First Out) - the oldest element is removed first
- Random access to any element regardless of order
- Elements are always sorted alphabetically
Explanation
A stack follows the LIFO principle: the last element pushed onto the stack is the first one popped off.
Question 44Digital representation and data structures
What is a queue (Warteschlange) data structure's key access principle?
- FIFO (First In, First Out) - the oldest element is removed first Correct answer.
- LIFO (Last In, First Out) - the newest element is removed first
- Elements are removed in random order
- Elements can never be removed once added
Explanation
A queue follows FIFO: elements are removed in the same order they were added, with the oldest element served first.
Question 45Digital representation and data structures
What is the difference between a one-dimensional array and a two-dimensional array?
- A one-dimensional array stores a single indexed list of elements; a two-dimensional array stores elements in rows and columns (a grid) Correct answer.
- They are exactly identical concepts with no distinction
- A two-dimensional array can only store text, never numbers
- A one-dimensional array can only have exactly one element
Explanation
A one-dimensional array is a simple indexed list, while a two-dimensional array organizes elements into rows and columns, accessed with two indices (e.g. array[row][column]).
Question 46Digital representation and data structures
What is a 'Traversierung' (traversal) of a tree data structure?
- A systematic process of visiting every node in the tree in some defined order Correct answer.
- Deleting every node in the tree permanently
- Converting the tree into a network diagram
- Encrypting the tree's stored data
Explanation
Tree traversal is the systematic process of visiting each node in the tree exactly once, following a defined order such as preorder, inorder, or postorder.
Question 47Digital representation and data structures
In an 'Inorder' traversal of a binary search tree, in what order are nodes visited?
- Left subtree, then the node itself, then right subtree - producing values in ascending sorted order for a BST Correct answer.
- Only the root node, ignoring all children
- Right subtree, then left subtree, with the node visited last
- Nodes are visited in a completely random order
Explanation
Inorder traversal visits the left subtree, then the current node, then the right subtree; for a binary search tree, this produces the values in ascending sorted order.
Question 48Digital representation and data structures
What is a hash table (Hash-Tabelle) primarily used for?
- Efficiently storing and retrieving data using a key mapped to an index via a hash function Correct answer.
- Only visually displaying a network diagram
- Encrypting data with a private key exclusively
- Compiling source code into machine language
Explanation
A hash table uses a hash function to map keys to array indices, enabling efficient (typically average O(1)) insertion, lookup, and deletion of data.
Question 49Digital representation and data structures
What is a 'Kollision' (collision) in the context of a hash table?
- When two different keys hash to the same index, requiring a resolution strategy Correct answer.
- When two hash tables merge into a single unified structure
- When a network cable physically breaks
- A synonym for a syntax error in code
Explanation
A hash collision occurs when two distinct keys produce the same hash index, requiring a collision-resolution strategy such as chaining or open addressing.
Question 50Digital representation and data structures
What is 'chaining' as a hash collision resolution strategy?
- Storing multiple colliding entries in a linked list (or similar structure) at the same hash index Correct answer.
- Deleting one of the colliding entries permanently with no recovery
- Automatically encrypting the colliding entries
- Physically relocating the entire hash table to another computer
Explanation
Chaining resolves collisions by storing all entries that hash to the same index in a linked list (or similar sub-structure) at that index.