Visualizers & labs
Interactive models of what happens under the hood. They also appear inside the lessons they belong to.
Memory: stack & heap
Step through code and watch variables, references and objects. Used in Value types vs reference types.
Stack & heap
References: two variables, one object
Code
1int age = 36;2var ada = new Person("Ada");3var alias = ada;4alias.Name = "Grace";5Rename(ada);6ada = null;7alias = null;89void Rename(Person p)10{11 p.Name = "Linus";12}
Stack
Main()
- intage36
Heap
(empty)
age is an int — a value type. The number 36 is stored directly inside the method's stack frame.Garbage collection
Allocate objects, drop references and see generations at work. Used in Track 5 · Memory & Runtime.
Garbage collector
Allocate objects, drop references, and run collections
Gen 0
2/8 · collected 0×
New objects. Collected often & fast.
Gen 1
collected 0×
Survived one GC. A buffer.
Gen 2
collected 0×
Long-lived. Collected rarely.
- Long-lived objects (config, logger, cache) already sit in older generations.
async / await and threads
Compare blocking and asynchronous request handling on the same thread pool. Used in Track 6 · Async & Concurrency.
Threads: blocking vs async/await
Each request: 1 unit of CPU work, a 4-unit database call, then 1 more unit of CPU
Requests
Thread pool
All requests finished at
t = 12
async: 7
Average response time
9.0
async: 6.5
Thread time wasted blocked
16 units
async: 0
var rows = db.Query(...) or .Result), a thread sits idle while the database works — the striped cells. Other requests queue up even though the CPU has nothing to do. Switch to async / await to compare.The journey of a request
DNS, TLS, load balancers, servers, caches and databases. Used in Track 7 · Backend Fundamentals.
The journey of a request
From pressing Enter to a rendered page
Browser
Your computer
DNS
Name → IP address
Load balancer
203.0.113.10
Web server
ASP.NET Core
Cache
Redis
Database
SQL Server
https), host (shop.example) and path (/products/42). It first checks whether it already has a fresh copy in its own cache — it doesn't.HTTP Playground
Send real-looking HTTP requests to a mock API and read the raw responses. Used in Anatomy of an HTTP request.
HTTP Playground
Send requests to a mock todo API at https://api.example.com — it runs in your browser
Server state: 2 todos — #1 ✓ Learn HTTP, #2 ○ Build an API
JSON Web Tokens
Decode tokens, read claims and see why signatures matter. Used in Track 7 · Auth & security.
JWT decoder
Decode a JSON Web Token and verify its signature (HS256)
Generating a sample token…
admin, but the signature no longer matches. Without the secret, an attacker can't produce a valid one — that's what an API checks on every request.ASP.NET Core middleware
Follow requests through the pipeline, including short-circuits and exceptions. Used in Track 11 · Web with ASP.NET Core.
ASP.NET Core middleware pipeline
Follow a request in through each middleware and the response back out
GET https://shop.example/api/orders Authorization: Bearer eyJhbGci…
- 1Exception handler↓ request
- 2HTTPS redirection
- 3Static files
- 4Routing
- 5Authentication
- 6Authorization
- 7Endpoint
Program.cs
var app = builder.Build();app.UseExceptionHandler("/error");app.UseHttpsRedirection();app.UseStaticFiles();app.UseRouting();app.UseAuthentication();app.UseAuthorization();app.MapGet("/api/orders", GetOrders).RequireAuthorization();app.Run();
Middleware runs in the order it's registered. Each one can act, then call next() — or stop the request right there.
try/catch.LINQ → SQL
See the SQL Entity Framework Core generates — and the N+1 problem. Used in Track 10 · Data & EF Core.
LINQ → SQL
What Entity Framework Core actually sends to the database (SQL Server)
C# (LINQ)
var cheap = await db.Products
.Where(p => p.Price < 20)
.OrderBy(p => p.Name)
.ToListAsync();Generated SQL1 query sent
SELECT [p].[Id], [p].[Name], [p].[Price], [p].[Stock]FROM [Products] AS [p]WHERE [p].[Price] < 20.0ORDER BY [p].[Name]
Rows returned
| Id | Name | Price | Stock |
|---|---|---|---|
| 2 | Mouse | 19.99 | 10 |
| 3 | Notebook | 4.5 | 100 |
| 4 | Pen | 1.2 | 0 |
Where becomes WHERE and OrderBy becomes ORDER BY. The filtering happens in the database — only matching rows travel over the network.SQL sandbox
Write real SQL against a small shop database, and solve the challenges. Used in Track 7 · Databases.
SQL sandbox
A real SQLite database running in your browser — a small online shop
List the names and emails of all customers who live in London.
Hint
Use WHERE city = 'London' — text values go in single quotes.Caching
Hit rates, latency, LRU eviction, TTLs and stale data. Used in Track 7 · Performance & scaling.
Caching
20 products, popular ones requested far more often · database 80 ms · cache 2 ms
Hit rate
0%
Avg response time
0 ms
Database queries
0 / 0
Stale reads
0
Recent requests
- Send some requests…
Cache contents (0/5) — most recently used first
Database: product #1 is at version v1.
Scaling
Add servers, caches and replicas as traffic grows — and watch the bottleneck move. Used in Track 7 · Performance & scaling.
Scaling a web app
Each request needs one database query unless the cache answers it
Users
200 req/s
Load balancer
1 target
Server 1
200 rps
DB primary
200 q/s
Latency (typical)
342 ms
Failed requests
25%
Busiest tier
> 100%
Monthly cost
$240
System design
Sketch architectures for real products and check them against requirements. Used in Track 7 · System design basics.
System design canvas
Build an architecture, then check it against the requirements
Turn long URLs into short links (like bit.ly). 100 million redirects a day, but only 1 million new links. Reads vastly outnumber writes, and redirects must be fast.
Add components with the buttons above. Click a component to select it, then “Connect selected” and click another.
Requirements check: 0/4
- ○ Clients reach the system through a load balancerOne public entry point that can route around failures.
- ○ At least 2 API servers behind the load balancerNo single point of failure, and room to scale out.
- ○ API servers store links in a databaseThe mapping short code → URL must survive restarts.
- ○ A cache sits next to the API for hot linksPopular links get millions of hits; serve them from memory.