All jobs / Backend developer / Backend Languages

Backend developer interview question · 0–1 years

What is the most common cause of a NullReferenceException in a new codebase?

The strongest answer

A reference that was never assigned or came back null from a lookup and was used without a check — nullable reference types and a null check at the boundary are what prevent it

Why it works

Right, and enabling nullable reference types moves most of these to compile time.

What a good answer covers

Answers that fall short

Who gets asked this

More Backend Languages questions