C# Basics

20 cards

1 / 2000

When yes

struct for small immutable data (< 16 bytes). class for everything else

When no

struct for large objects or with mutable state — expensive copies

Interview tip

Frequently asked: string is a reference type but behaves like value (immutable). That's because string is immutable, not because it's a value type.