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
Copy the value, or copy the arrow?
The same code, twenty years apart
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() { … }}public record Pt(int X, int Y);
Records (C# 9) generate the constructor, properties, value equality, hashing, ToString and with-expressions in one line.
- Hejlsberg, A., Torgersen, M., Wiltamuth, S., & Golde, P. (2010). The C# programming language (4th ed.). Addison-Wesley.
- Microsoft. The history of C#. Microsoft Learn.