- .NET and Visual Studio Community editions installed
- Read through the basics C# guides on Microsoft's documentation site
- Forked the practice repository and submitted the exercise solutions
- Download and install Visual Studio Community Edition
- You can follow the official installation guide making sure to select "ASP.NET and web development" and the
.NET desktop developmentworkloads. Make sure to also go toIndividual Components->.NET 10 Runtime(see screenshot) - Verify installation by launching Visual Studio on your Windows machine
Please read fully the following guides, ~25 min
- C# Overview -> this explains file based or project based apps (we will use project based)
- Program structure -> we will use project based apps with a
Program.csthat uses top level statements instead of aMainmethod - Namespaces and using directives
- Top level statements detail
- Type system overview -> C# is a typed language, so we need to learn about types and how to use them
- Built-in types -> continuation from overview
- Generics (lists)
- Classes
- OOP
- OOP - objects
- Exceptions and errors overview
Additional useful reading:
- Differences for python developers -> important bits are: syntax, use of tokens and
;to separate code blocks (similar to JS), generics and nullable types - Differences for javascript developers -> syntax, async/await (will be useful towards end of our lessons)
You should be familiar, by the end of the reading, with the following key concepts:
- how to create a fresh console program in Visual Studio (not file based, but solution based)
- what Program.cs is and why we can avoid a Main function (top level statements)
- defining variables of different types to store strings, integers, booleans, arrays
- syntax for defining functions (must live inside Classes - this is a core difference with Python, Javascript where you can have functions defined freely)
- creating an instance of a class (object) => see fundamentals exercises below
- Arrays in C# are fixed size and need to be resized, which is why we use List generic type which is a convenient wrapper on top of arrays
- defining generics variables (ie. List) which allow us to use dynamic lists
Please refer to the links above as official documentation throughout the 4 days of the course.
The fundamentals/ folder contains a .NET 10 solution with two projects:
Fundamentals— a console app with all the lesson examples (what the course teaches) and your exercises (what you implement).Fundamentals.Tests— an xUnit test project that verifies both the lesson examples and your exercise implementations.
For each theme, lessons live in Fundamentals/Lessons/<Theme>.cs and your exercises live in Fundamentals/Exercises/<Theme>.cs. The two are separated so you always know where the teaching material ends and your work begins.
- Open Visual Studio.
- File → Open → Project/Solution…
- Navigate to the
fundamentals/folder and openFundamentals.slnx. - Wait for Visual Studio to restore NuGet packages (status bar at the bottom will show "Ready" when it's done).
If VS complains about the SDK version, check that you have .NET 10 installed (dotnet --list-sdks in a terminal). global.json is configured to accept any .NET 10 SDK you have.
- In Solution Explorer, right-click the
Fundamentalsproject → Set as Startup Project. - Press F5 (Debug → Start Debugging) or Ctrl+F5 (Debug → Start Without Debugging).
- A console window opens showing each lesson's output, section by section. Read through and match what you see against the matching
Lessons/<Theme>.csfile — the code produces the output you're reading.
The program also has commented-out lines at the end of each theme's section for the exercise calls. As you implement each exercise, uncomment the corresponding line and re-run — you'll see your output alongside the lesson examples.
- Open Test Explorer: menu Test → Test Explorer (or Ctrl + E, T).
- Wait for Visual Studio to discover the tests — the panel will populate with the full list, grouped by namespace:
Fundamentals.Tests.Lessons.*— guards for the teaching examples (these should always pass)Fundamentals.Tests.Exercises.*— validators for your exercises (these will fail until you implement each method)
- Click Run All Tests In View (▶▶ icon at the top of the panel), or right-click any individual test and choose Run.
Baseline at the start: all lesson tests pass, all exercise tests fail (the exercise methods throw NotImplementedException in their scaffolded state).
Work through the themes in order. For each theme:
- Read the lesson file —
Fundamentals/Lessons/<Theme>.cs. Take your time with the inline comments; each example method shows one specific point. Match what you're reading against the narrated output you saw when running the console program. - Open the exercise file —
Fundamentals/Exercises/<Theme>.cs. Read the first exercise's description, example, and hint. - Implement the exercise — replace the
throw new NotImplementedException(...)with your solution. - Run the matching exercise test in Test Explorer. Filter by the exercise name (e.g.
Add_) and hit run. Iterate until the test is green. - Uncomment the matching line in
Program.cs(under the=== <THEME> — your exercises ===header) and run the console program to see your output alongside the lesson examples. - Repeat for each exercise in the file.
Skip the advanced sections (Lessons/<Theme>Advanced.cs and Exercises/<Theme>Advanced.cs) as you go. Come back to them only once you've completed the core exercises for all themes.
Complete each theme fully before moving to the next:
- Numbers — integers, doubles, casting between types. Lesson in
Lessons/Numbers.cs, exercises inExercises/Numbers.cs. - Strings —
charvsstring, quote styles (regular / verbatim / raw), immutability, comparison,Parse/TryParse, format specifiers. Lesson inLessons/Strings.cs, exercises inExercises/Strings.cs. - Arrays — declaration forms, strong typing, default values, indexing and
.Length, out-of-bounds exceptions, iteration (foreachvsfor),Array.Sort/Reverse/IndexOf. Lesson inLessons/Arrays.cs, exercises inExercises/Arrays.cs. - ControlFlow —
if/else ifsyntax differences, the no-braces gotcha,switchstatement (C#'s break flip vs JavaScript), ternary refresher,while+break, classicfor,foreach. Lesson inLessons/ControlFlow.cs, exercises inExercises/ControlFlow.cs. - Lists —
List<T>and a generics primer,.Countvs.Length,Add/Insert/Remove/RemoveAt/Clear, instance methods vsArray's statics, array↔list conversion. Lesson inLessons/Lists.cs, exercises inExercises/Lists.cs. - Structs — defining your own value types, properties with
{ get; set; }, constructors, instance methods, and the big C#-specific point: structs are value types (copied on assignment and on method calls). Lesson inLessons/Structs.cs, exercises inExercises/Structs.cs. - Classes — same syntax as structs (properties, constructor, methods), but classes are reference types — assigning or passing an instance shares the same object. Worked example: a
Courseclass that holds a list ofStudents (from the Structs lesson) withEnroll/Remove/Count. Lesson inLessons/Classes.cs, exercises inExercises/Classes.cs. - Structs vs Classes — synthesis: two types with identical shape (
PointStructandPointClass) run through the same two experiments (assignment, method-passing) to show that one keyword flipped produces opposite outcomes every time. Lesson inLessons/StructsVsClasses.cs(no exercises — compare/contrast only). - Enums — declaring a named, type-safe set of constants, the
switchstatement payoff (enum cases instead of magic strings), underlying int values, andEnum.TryParsefor turning user input into enum values. Lesson inLessons/Enums.cs, exercises inExercises/Enums.cs. - Exceptions —
try/catchfor recovery,throwfor signalling impossible states (ArgumentException,InvalidOperationException), and best practices: catch specific types, never swallowException, preferTryXxxwhen failure is expected. Lesson inLessons/Exceptions.cs, exercises inExercises/Exceptions.cs.
Once the core themes' exercises are green in Test Explorer, tackle the advanced sections:
StringsAdvanced—StringBuilder+ a small CSV-row parser.ArraysAdvanced— multi-dimensional (int[,]) vs jagged (int[][]) arrays + a matrix transpose and a duplicate-detection exercise.ControlFlowAdvanced—switchexpression (C# 8+) and relational patterns (>= 70 => "A") for collapsing else-if chains into one tidy block.
Once all the core fundamentals exercises are green, move on to the Bank capstone in projects/bank/. This is where you put everything together — classes, structs, enums, exceptions, List<T>, properties, encapsulation — into one small object-oriented program.
The solution contains two projects:
Bank— a console app with stubbed-out types (Transaction,Account,Bank,TransactionType). Every method throwsNotImplementedExceptionin its scaffolded state.Bank.Tests— an xUnit test project that specifies the full behaviour. All tests fail at the start. Your job is to make them green.
The full spec (types, rules, method signatures) lives in projects/bank/README.md — read that before you start writing code. It also contains two mini-lessons on decimal (why money is never double) and DateTime formatting (for Statement()), plus stretch extensions once the core tests pass.
- Open Visual Studio.
- File → Open → Project/Solution…
- Navigate to
projects/bank/and openBank.slnx. - Wait for NuGet restore to finish (status bar shows "Ready").
If VS complains about the SDK version, check dotnet --list-sdks in a terminal — global.json is configured to accept any .NET 10 SDK.
- Open Test Explorer: menu Test → Test Explorer (or Ctrl + E, T).
- Click Run All Tests In View (▶▶ icon at the top of the panel).
- Everything is red. That's expected — the stubs throw
NotImplementedExceptioneverywhere. The tests are your specification.
- In Solution Explorer, right-click the
Bankproject → Set as Startup Project. - Press Ctrl+F5 (Start Without Debugging).
At first the demo will crash with NotImplementedException — that's fine. Once you've implemented the core types, it runs end-to-end and you can extend Program.cs to play with your bank.
Work in the order suggested in projects/bank/README.md:
TransactionTests— smallest surface, warm-up.AccountTests— construction,Balance,Deposit,Withdraw.AccountTests—StatementandFindTransactions.BankTests— tying everything together.
For each test:
- Read the test to understand what it expects.
- Open the matching source file (
Transaction.cs,Account.cs, orBank.cs) and implement just enough code to make that one test pass. - Re-run the test in Test Explorer. Green? Move on. Red? Read the failure message — xUnit tells you the expected vs actual value.
- Don't jump ahead. Resist the urge to implement five methods at once. One test green at a time keeps the feedback loop tight and teaches you the TDD cadence we'll lean on for the rest of the course.
When every test in Test Explorer is green, run the console app (Ctrl+F5) to see your bank working end-to-end. Then — if you have time — pick an extension from the "Extensions" section of projects/bank/README.md (Transfers, Overdrafts, Interest, Polymorphic account types). Extensions have no tests provided — you write the code and the tests yourself.
