Pergunta de entrevista da empresa Workable

Had a simple test with a struct and class. Asked about the difference of the two data structures and memory management.

Resposta da entrevista

Sigiloso

25 de mar. de 2024

Structs are value types whereas Classes are reference types. When you copy a struct, you end up with two unique copies of the data. When you copy a class, you end up with two references to one instance of the data.