🌍 Game Development · subject
Game Development Programming for Games Syllabus
The Programming for Games syllabus for Game Development in full: 3 chapters and 10 topics, every one listed below, plus 50 Programming for Games flashcards with answers.
Programming for Games syllabus: all 3 chapters
Expand any chapter to see its topics and sub-topics.
-
Programming Languages
4 topics- C++
- C#
- JavaScript
- Python
-
Game Engine Scripting
3 topics- Unity Scripting with C#
- Unreal Engine Scripting with C++/Blueprints
- Godot Scripting with GDScript
-
Algorithms and Data Structures
3 topics- Pathfinding Algorithms
- Sorting and Searching Algorithms
- Data Structures (Arrays, Lists, Trees, Graphs)
Game Development Programming for Games flashcards — 50 questions with answers
In C++, what is the difference between passing a parameter by value and passing it by reference?
Pass by value copies the argument into a new local variable, so changes inside the function do not affect the original. Pass by reference (using `&`, e.g. `void f(int& x)`) gives the function an alias to the original variable, so modifications affect the caller's value and no copy is made.
What is a pointer in C++, and which operators are used to take an address and to dereference it?
A pointer is a variable that stores the memory address of another object. The address-of operator `&` obtains an object's address (`int* p = &x;`), and the dereference operator `*` accesses the value at that address (`*p`).
In C++, what is RAII (Resource Acquisition Is Initialization)?
RAII is a pattern where resource lifetime is tied to object lifetime: a resource (memory, file, lock) is acquired in a constructor and released in the destructor. When the object goes out of scope, the destructor automatically frees the resource, preventing leaks.
What is the difference between the stack and the heap in C++ memory management?
The stack stores local variables with automatic storage duration; allocation/deallocation is fast and automatic via scope. The heap (free store) is used for dynamic allocation via `new`/`delete` (or smart pointers); it is manually managed, larger, and slower to allocate.
In C++, what do the smart pointers `std::unique_ptr` and `std::shared_ptr` represent?
`std::unique_ptr` models exclusive ownership of a heap object (cannot be copied, only moved). `std::shared_ptr` models shared ownership via reference counting; the object is destroyed when the last `shared_ptr` referring to it is destroyed.
What are the four pillars of Object-Oriented Programming, common to C++, C#, and other OOP languages?
Encapsulation (bundling data with methods and hiding internals), Abstraction (exposing only essential features), Inheritance (deriving new classes from existing ones), and Polymorphism (the same interface behaving differently across types).
In C#, what is the difference between a value type and a reference type?
Value types (structs, enums, primitives like `int`) store their data directly and are copied on assignment, typically living on the stack. Reference types (classes, arrays, strings, delegates) store a reference to data on the managed heap; assignment copies the reference, not the object.
What is garbage collection in C#, and how does it differ from C++ memory management?
In C#, the .NET Garbage Collector automatically reclaims memory of objects no longer reachable, so the programmer generally does not free memory manually. In C++ there is no built-in GC; memory is managed manually with `new`/`delete` or via RAII/smart pointers.
In C#, what is the purpose of the `IEnumerable<T>` interface and the `foreach` loop?
`IEnumerable<T>` represents a sequence that can be iterated. Implementing it (via `GetEnumerator()`) lets a type be used in a `foreach` loop, which sequentially retrieves each element without exposing the underlying collection structure.
What is the difference between `==` and `===` in JavaScript?
`==` is the loose equality operator: it performs type coercion before comparing (e.g. `1 == '1'` is true). `===` is strict equality: it compares both value and type without coercion (`1 === '1'` is false). `===` is generally preferred.
In JavaScript, what is a closure?
A closure is a function together with the lexical environment in which it was declared. It allows an inner function to continue accessing variables from its enclosing (outer) function's scope even after that outer function has returned.
What is the difference between `let`, `const`, and `var` in JavaScript?
`var` is function-scoped and hoisted. `let` is block-scoped and can be reassigned. `const` is block-scoped and cannot be reassigned (though the contents of an object/array it references may still be mutated).
In JavaScript, what is the event loop and why is it important for game/UI loops?
The event loop is the mechanism that lets single-threaded JavaScript handle asynchronous operations: it repeatedly takes callbacks from the task/microtask queues and runs them when the call stack is empty. It enables non-blocking I/O and drives frame-based updates (e.g. via `requestAnimationFrame`).
In Python, what is the difference between a list and a tuple?
A list is mutable and defined with square brackets `[]`, so its elements can be changed, added, or removed. A tuple is immutable and defined with parentheses `()`; once created its contents cannot be modified, which makes tuples hashable and usable as dictionary keys.
What is a Python dictionary, and what is the average time complexity of a key lookup?
A dictionary is a mutable collection of key-value pairs implemented as a hash table. Key lookup, insertion, and deletion run in $O(1)$ average time, degrading to $O(n)$ in the worst case of many hash collisions.
In Python, what is a list comprehension? Give its general syntax.
A list comprehension is a concise way to build a list from an iterable. General form: `[expression for item in iterable if condition]`, e.g. `[x*x for x in range(10) if x % 2 == 0]` produces the squares of even numbers 0-8.
What is the Global Interpreter Lock (GIL) in CPython?
The GIL is a mutex that allows only one thread to execute Python bytecode at a time in the CPython interpreter. It simplifies memory management but prevents true parallel execution of CPU-bound threads; parallelism is instead achieved with multiprocessing.
In Unity, what is a MonoBehaviour and how is a script attached to game objects?
`MonoBehaviour` is the base class every Unity C# script component derives from. A script deriving from it can be attached as a component to a GameObject, giving that object custom behavior and access to Unity's event callbacks.
In Unity scripting, what is the difference between the `Start()`, `Update()`, and `FixedUpdate()` methods?
`Start()` runs once before the first frame, after `Awake()`, for initialization. `Update()` runs once per rendered frame (frame-rate dependent), used for most game logic. `FixedUpdate()` runs on a fixed timestep independent of frame rate and is used for physics calculations.
In Unity, why is `Time.deltaTime` used when moving objects in `Update()`?
`Time.deltaTime` is the time in seconds since the last frame. Multiplying movement or rotation by it makes motion frame-rate independent, so an object moves at a consistent real-world speed regardless of how fast or slow frames are rendered.
Show the other 30 Programming for Games flashcards
In Unity, how do you access another component attached to the same GameObject from a script?
Use `GetComponent<T>()`, e.g. `Rigidbody rb = GetComponent<Rigidbody>();`. It returns a reference to the component of type `T` on the same GameObject (or `null` if none exists), letting you read and modify its properties.
In Unreal Engine, what is the difference between C++ and Blueprints as scripting approaches?
C++ is a text-based, compiled language offering maximum performance and low-level control. Blueprints are a visual node-based scripting system, faster to prototype and accessible to non-programmers. They interoperate: C++ classes and functions can be exposed to Blueprints via macros like `UFUNCTION(BlueprintCallable)`.
In Unreal Engine C++, what is the purpose of the `UPROPERTY()` and `UFUNCTION()` macros?
They expose C++ members to Unreal's reflection system. `UPROPERTY()` exposes a variable to the editor, Blueprints, serialization, and garbage collection. `UFUNCTION()` exposes a function so it can be called from Blueprints, bound to events, or replicated over the network.
In Unreal Engine, what is the class hierarchy relationship between `UObject`, `AActor`, and `APawn`?
`UObject` is the base class for all managed objects. `AActor` derives from `UObject` and represents objects that can be placed/spawned in a level. `APawn` derives from `AActor` and represents an actor that can be possessed and controlled by a player or AI controller.
In Godot, what language is GDScript most similar to, and how are code blocks defined?
GDScript is a high-level, dynamically typed language whose syntax closely resembles Python. Like Python, it uses indentation (whitespace) rather than braces to define code blocks and nesting.
In Godot's GDScript, what do the callbacks `_ready()` and `_process(delta)` do?
`_ready()` is called once when a node and its children enter the scene tree, used for initialization. `_process(delta)` is called every rendered frame, where `delta` is the elapsed time since the last frame; it is used for per-frame game logic.
In Godot, what are signals and how do they support decoupled communication?
Signals are Godot's implementation of the observer pattern: a node emits a signal (e.g. `emit_signal("health_changed")`) when an event occurs, and other nodes connect callback functions to it. This lets objects communicate without holding direct references, reducing coupling.
What problem does a pathfinding algorithm solve, and what is a common graph representation of a game map?
Pathfinding finds a route (ideally the shortest or lowest-cost) between a start and goal position while avoiding obstacles. Game maps are commonly represented as a graph of nodes (grid cells, waypoints, or navmesh polygons) connected by weighted edges.
How does Dijkstra's algorithm work, and what is its typical time complexity with a binary heap?
Dijkstra's algorithm finds shortest paths from a source by repeatedly expanding the unvisited node with the smallest known distance and relaxing its neighbors' distances. With a binary-heap priority queue its complexity is $O((V + E)\log V)$, where $V$ is vertices and $E$ is edges.
What is the A* (A-star) pathfinding algorithm, and what is its evaluation function?
A* is a best-first search that finds the lowest-cost path using the evaluation function $f(n) = g(n) + h(n)$, where $g(n)$ is the actual cost from the start to node $n$ and $h(n)$ is a heuristic estimate of the cost from $n$ to the goal. It expands the node with the lowest $f(n)$.
For A* to be guaranteed to find an optimal (shortest) path, what property must its heuristic satisfy?
The heuristic must be admissible: it must never overestimate the true remaining cost to the goal, i.e. $h(n) \leq h^{*}(n)$ for all nodes. (Consistency/monotonicity is a stronger condition that also guarantees optimality without re-expansions.)
What is the difference between Breadth-First Search (BFS) and Depth-First Search (DFS) for traversing a graph?
BFS explores all neighbors at the current depth before moving deeper, using a queue (FIFO); on unweighted graphs it finds the shortest path in edges. DFS explores as far as possible along each branch before backtracking, using a stack or recursion (LIFO).
On a uniform-cost (unweighted) grid, why does Breadth-First Search always find the shortest path but plain Dijkstra offers no advantage?
BFS explores nodes in order of increasing edge distance, so the first time it reaches the goal it has used the fewest edges — the shortest path. On a uniform-cost grid every edge has equal weight, so Dijkstra's priority ordering reduces to BFS ordering, adding overhead without benefit.
Describe how the Bubble Sort algorithm works and state its worst-case time complexity.
Bubble Sort repeatedly steps through the list, comparing adjacent elements and swapping them if they are out of order, so larger elements 'bubble' to the end each pass. It has worst-case and average time complexity $O(n^{2})$ and best-case $O(n)$ when already sorted (with an early-exit optimization).
How does Merge Sort work, and what are its time and space complexities?
Merge Sort is a divide-and-conquer algorithm: it recursively splits the array into halves, sorts each half, then merges the sorted halves. Its time complexity is $O(n\log n)$ in all cases, and it requires $O(n)$ auxiliary space for merging.
What is the average and worst-case time complexity of Quick Sort, and what causes the worst case?
Quick Sort has average time complexity $O(n\log n)$ and worst case $O(n^{2})$. The worst case occurs when pivot selection is consistently poor (e.g. always the smallest or largest element), producing maximally unbalanced partitions; good pivot strategies make it rare.
How does Binary Search work, what is its time complexity, and what precondition must the data satisfy?
Binary Search repeatedly compares the target to the middle element of a sorted array, discarding the half that cannot contain the target. It runs in $O(\log n)$ time. Its precondition is that the array must already be sorted.
What does it mean for a sorting algorithm to be 'stable', and name one stable and one unstable sort.
A stable sort preserves the relative order of elements that compare equal. Merge Sort and Insertion Sort are stable; Quick Sort and Heap Sort are generally unstable (equal keys may be reordered).
Compare the average-case time complexities of Bubble Sort, Insertion Sort, Merge Sort, and Quick Sort.
Bubble Sort and Insertion Sort are $O(n^{2})$ on average. Merge Sort is $O(n\log n)$ in all cases. Quick Sort is $O(n\log n)$ on average (but $O(n^{2})$ worst case). Merge and Quick Sort scale far better for large inputs.
What is an array, and what is the time complexity of accessing an element by index versus inserting at the front?
An array is a contiguous block of memory storing elements of the same type. Accessing an element by index is $O(1)$ because the address is computed directly. Inserting at the front (or middle) is $O(n)$ because subsequent elements must be shifted.
What is the key structural difference between an array and a singly linked list?
An array stores elements contiguously with $O(1)$ index access but $O(n)$ insertion/deletion in the middle. A linked list stores elements as nodes, each holding data and a pointer to the next node; it allows $O(1)$ insertion/deletion given a node reference but only $O(n)$ sequential access (no direct indexing).
What is a stack, what is its access discipline, and what are its two primary operations?
A stack is a linear data structure with Last-In-First-Out (LIFO) discipline: the most recently added element is removed first. Its primary operations are `push` (add an element to the top) and `pop` (remove the top element), both $O(1)$.
What is a queue, and how does its access discipline differ from a stack's?
A queue is a linear structure with First-In-First-Out (FIFO) discipline: elements are removed in the order they were added. Its operations are `enqueue` (add to the rear) and `dequeue` (remove from the front). This contrasts with a stack's LIFO order.
What is a binary tree, and what specifically defines a Binary Search Tree (BST)?
A binary tree is a hierarchical structure where each node has at most two children (left and right). A Binary Search Tree adds an ordering invariant: for every node, all keys in its left subtree are smaller and all keys in its right subtree are larger, enabling efficient search.
What are the average and worst-case time complexities for search in a Binary Search Tree, and when does the worst case occur?
Search in a BST is $O(\log n)$ on average when the tree is balanced. It degrades to $O(n)$ in the worst case when the tree becomes unbalanced (e.g. inserting sorted data turns it into a linked-list-like chain).
What are the three depth-first tree traversal orders, and what does an in-order traversal of a BST produce?
The three depth-first orders are pre-order (node, left, right), in-order (left, node, right), and post-order (left, right, node). An in-order traversal of a Binary Search Tree visits the keys in sorted ascending order.
What is a graph, and what is the difference between a directed and an undirected graph?
A graph is a set of vertices (nodes) connected by edges. In an undirected graph edges have no direction (the relationship is mutual). In a directed graph (digraph) each edge has a direction, pointing from one vertex to another, representing a one-way relationship.
Compare an adjacency matrix and an adjacency list for representing a graph in terms of space and edge-lookup.
An adjacency matrix uses $O(V^{2})$ space and checks whether an edge exists in $O(1)$; it suits dense graphs. An adjacency list uses $O(V + E)$ space and checks a specific edge in $O(\text{degree})$ time; it is more efficient for sparse graphs, which most game maps are.
What is a hash table, how does it achieve fast lookups, and how are collisions typically handled?
A hash table stores key-value pairs, using a hash function to map each key to an index in an underlying array, giving $O(1)$ average lookup, insertion, and deletion. Collisions (two keys mapping to the same index) are resolved by chaining (storing a linked list per bucket) or open addressing (probing for another slot).
What is Big-O notation, and why is it used to compare algorithms and data structures in game programming?
Big-O notation describes the asymptotic upper bound on an algorithm's running time (or space) as a function of input size $n$, ignoring constants and lower-order terms. It lets programmers compare scalability, e.g. distinguishing an $O(n\log n)$ algorithm from an $O(n^{2})$ one, which matters for performance-critical game loops.
Game Development Programming for Games FAQ
What is in the Game Development Programming for Games syllabus?
Game Development Programming for Games is split into 3 chapters: Programming Languages, Game Engine Scripting and Algorithms and Data Structures. Together they contain 10 topics.
How many chapters are in Game Development Programming for Games?
3 chapters, containing 10 topics. The largest chapter is Programming Languages, with 4 topics.
Are there flashcards for Game Development Programming for Games?
Yes — a 50-card Programming for Games deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.