🌍 Game Development · flashcards
Game Development C# Programming Language Flashcards
59 question-and-answer cards covering C# Programming Language as it is examined in Game Development. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the C# Programming Language deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is encapsulation in C# and how is it achieved?
Encapsulation is bundling data and methods into a single unit (class) while hiding internal state from outside access. It is achieved using access modifiers (e.g., `private` fields) and exposing controlled access through properties and public methods.
List the access modifiers in C# and describe their visibility.
`public` (accessible everywhere), `private` (only within the same class), `protected` (within the class and derived classes), `internal` (within the same assembly), `protected internal` (assembly OR derived classes), and `private protected` (same assembly AND derived classes).
What is an interface in C# and how does it differ from an abstract class?
An interface defines a contract of members (methods, properties, events) without implementation (though default implementations are allowed since C# 8). A class can implement multiple interfaces but inherit only one class. Abstract classes can hold state (fields) and constructors; interfaces traditionally cannot.
What is a namespace in C# and what is its purpose?
A namespace is a container that organizes related types (classes, interfaces, etc.) into a logical group and prevents naming collisions. It is declared with the `namespace` keyword, and types are referenced by fully qualified names like `System.Collections.Generic.List`.
What does the `using` directive do in C#, and what is a `using` alias?
The `using` directive imports a namespace so its types can be referenced without full qualification (e.g., `using System;`). A `using` alias (e.g., `using Dict = System.Collections.Generic.Dictionary<int,string>;`) creates a shorthand name for a type or namespace.
What is a delegate in C# and what does it represent?
A delegate is a type-safe object that holds a reference to one or more methods with a matching signature (return type and parameters). It enables methods to be passed as parameters and is the foundation for callbacks and events.
What are the built-in generic delegate types `Func`, `Action`, and `Predicate` in C#?
`Func<T,...,TResult>` references methods that return a value. `Action<T,...>` references methods that return void. `Predicate<T>` references a method taking one argument and returning a `bool`. They eliminate the need for custom delegate declarations.
What is an event in C# and how does it relate to delegates?
An event is a special member built on a delegate that provides a publish-subscribe mechanism. Subscribers attach handlers with `+=` and detach with `-=`. The `event` keyword restricts external code so it can only add/remove handlers, not invoke or overwrite the delegate.
What is a lambda expression in C# and what is its syntax?
A lambda expression is an anonymous function using the `=>` (lambda) operator, e.g., `x => x * x` or `(a, b) => a + b`. It provides concise inline implementation for delegates and is heavily used in LINQ.
What are generics in C# and what problem do they solve?
Generics allow classes, methods, interfaces, and delegates to operate on a type parameter specified by the caller (e.g., `List<T>`). They provide type safety, eliminate casting, avoid boxing, and enable code reuse without sacrificing performance.
What are generic constraints in C# and give examples?
Constraints (using `where`) restrict the types usable as a generic parameter. Examples: `where T : class` (reference type), `where T : struct` (value type), `where T : new()` (parameterless constructor), and `where T : IComparable` (implements an interface/base class).
Compare `List<T>`, `Dictionary<TKey,TValue>`, and `HashSet<T>` in C#.
`List<T>` is a dynamically-sized ordered collection with index access. `Dictionary<TKey,TValue>` stores unique key/value pairs with fast $O(1)$ average lookup by key. `HashSet<T>` stores unique unordered elements with fast membership testing.
What is the difference between an array and a `List<T>` in C#?
An array has a fixed size set at creation and stores elements contiguously. A `List<T>` is a dynamic collection that automatically resizes as elements are added or removed, offering methods like `Add`, `Remove`, and `Insert`.
What is exception handling in C# and what are the `try`, `catch`, and `finally` blocks?
Exception handling manages runtime errors gracefully. `try` encloses code that may throw an exception, `catch` handles specific exception types, and `finally` runs code that must always execute (e.g., cleanup) regardless of whether an exception occurred.
What is LINQ in C# and what are the two syntax forms?
LINQ (Language Integrated Query) provides a unified way to query collections, databases, XML, and more directly in C#. It has two forms: query syntax (SQL-like, e.g., `from x in list where x > 5 select x`) and method syntax (fluent, e.g., `list.Where(x => x > 5)`).
What is deferred execution in LINQ and how do methods like `ToList()` affect it?
Deferred (lazy) execution means a LINQ query is not evaluated when defined but only when iterated (e.g., in a `foreach`). Calling methods like `ToList()`, `ToArray()`, or `Count()` forces immediate execution and materializes the results.
What are the `async` and `await` keywords in C# used for?
`async` marks a method as asynchronous, allowing it to use `await`. `await` suspends the method's execution until an awaited `Task` completes, without blocking the calling thread. This enables responsive, non-blocking I/O and concurrency. Async methods typically return `Task`, `Task<T>`, or `ValueTask`.
What is the difference between `Task` and `Task<T>` in C# asynchronous programming?
`Task` represents an asynchronous operation that does not return a value (like an async void-equivalent). `Task<T>` represents an asynchronous operation that returns a result of type `T`, retrievable via `await` or the `.Result` property.
What is ADO.NET in C# and what are its core objects?
ADO.NET is the .NET data access technology for connecting to databases. Core objects include `Connection` (opens a link to the data source), `Command` (executes SQL), `DataReader` (fast, forward-only read), `DataAdapter` (fills datasets), and `DataSet`/`DataTable` (in-memory disconnected data).
What is the difference between connected and disconnected architecture in ADO.NET?
Connected architecture keeps an open connection while reading data using a `DataReader` (fast, forward-only, read-only). Disconnected architecture uses a `DataAdapter` to fill a `DataSet`/`DataTable` in memory, then closes the connection, allowing offline manipulation and later updates.
Why should parameterized queries be used in ADO.NET instead of string concatenation?
Parameterized queries (using `SqlParameter` and placeholders like `@name`) prevent SQL injection attacks by separating SQL code from data, and they improve performance through query plan reuse. String concatenation of user input is insecure.
What is boxing and unboxing in C#?
Boxing is converting a value type to a reference type (`object`), wrapping the value on the heap. Unboxing extracts the value type back from the object, requiring an explicit cast. Both incur performance overhead, which generics help avoid.
What is the difference between `string` and `StringBuilder` in C#?
`string` is immutable: every modification creates a new object, which is inefficient for repeated concatenation. `StringBuilder` is mutable and modifies its internal buffer in place, making it much more efficient for building strings in loops.
What is the `IEnumerable<T>` interface and why is it important in C#?
`IEnumerable<T>` is the fundamental interface for iteration; it exposes an enumerator via `GetEnumerator()`, enabling `foreach` and LINQ. Any collection implementing it can be queried and iterated lazily, forming the basis of C#'s collection and query model.
What this deck covers
The C# Programming Language deck follows the Game Development C# Programming Language syllabus — 6 chapters and 21 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 9.8 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 257 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
C# Programming Language flashcards FAQ
How many C# Programming Language flashcards are in this Game Development deck?
59 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Game Development flashcards free?
Yes. The preview here is free to read with no signup, and the full 59-card deck is free inside the Examius app.
What do the C# Programming Language cards cover?
They follow the Game Development C# Programming Language syllabus — 6 chapters and 21 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.