C# 12 · .NET 8 · 15 QUESTIONS · ABOUT 10 MINUTES

Struct or class? It changes everything.

C# reads cleanly, but whether something is copied or shared, run now or later, decides what your code prints. Fifteen snippets, each explained, with your result broken down by topic. No sign-up, nothing saved.

Start the C# test
struct P { public int X; } var a = new P { X = 1 };var b = a; b.X = 2;Console.Write(a.X);
output1
QUESTION 1 / 15 · TYPES & VALUESEasy

What does this print?

struct P { public int X; }var a = new P { X = 1 };var b = a;b.X = 2;Console.Write(a.X);

What this C# test measures, in short

This test checks whether you can predict what real C# does: when a value is copied versus shared, how strings and equality behave, which method a call reaches, when LINQ actually runs, and how async, nullable types and the ?? operator work.

Snippets assume C# 12 on .NET 8 with top-level statements. The questions are our own and not standardised against a population, so treat the result as a knowledge check, not a certification.

By What's Your IQ · Reviewed 4 Oct 2026
Format
15 predict-the-output questions, 4 options each
Topics
Types and values, strings and equality, classes, LINQ, async and nullability
Version
C# 12, .NET 8
Language
Designed at Microsoft by Anders Hejlsberg; released 2002
QUESTIONS 1 AND 2, SIDE BY SIDE

Copy the value, or copy the arrow?

STACK
aP { X = 1 }
HEAP
(nothing)
a is a struct, so the whole value lives in a's stack slot. Nothing goes on the heap.
C# 2 → C# 12

The same code, twenty years apart

OLD STYLE
public class Pt { public int X { get; private set; } public int Y { get; private set; } public Pt(int x, int y) { X = x; Y = y; } public override bool Equals(object o) { … } public override int GetHashCode() { … }}
MODERN
public record Pt(int X, int Y);

Records (C# 9) generate the constructor, properties, value equality, hashing, ToString and with-expressions in one line.

One designer, two languagesAnders Hejlsberg also created TypeScriptBefore Microsoft he wrote Turbo Pascal and led Delphi. Ideas like async/await travelled from C# into TypeScript and beyond.1
2002C# 1.0 with .NET. Garbage-collected like Java, but with structs, properties and events built in.1
2007 · C# 3LINQ. Lambdas and query syntax made collections queryable like a database.2
2012 · C# 5async/await. Asynchronous code that reads like ordinary code. JavaScript, Python, Rust and others later adopted the same keywords.2
2016 → 2019Open and cross-platform. .NET Core ran on Linux and macOS and was open-sourced; C# 8 added nullable reference types.2
  1. Hejlsberg, A., Torgersen, M., Wiltamuth, S., & Golde, P. (2010). The C# programming language (4th ed.). Addison-Wesley.
  2. Microsoft. The history of C#. Microsoft Learn.

Where to go next

You know the language. How do you reason?

Our full IQ test measures the logic and working memory behind good code: 60 questions across four domains, about 30 minutes.

Take the full IQ test