Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

NULLs in Risk Aggregations

EasySQL & Data Manipulation00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to your interview.

The question is on your right: NULLs in Risk Aggregations. Take a moment with it first.

Talk your thinking through with me if you like - when you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes). Discussion and graded submissions share your five interviewer interactions, so spend them well.

You need to log in / sign up to chat or submit.

Problem

Context

In risk and control reporting, missing values are common in fields such as exposure, loss amount, or review scores. If you misunderstand how PostgreSQL aggregates treat NULL, you can produce misleading totals, averages, or counts in Barclays reporting and MI.

Core question

Explain how NULL values are handled by common SQL aggregate functions in PostgreSQL, especially COUNT, SUM, AVG, MIN, and MAX. You should also explain the difference between COUNT(*) and COUNT(column), when COALESCE() should be used, and how GROUP BY results can be affected when some rows contain NULL values.

Scope guidance

The interviewer is looking for a practical explanation rather than formal theory. You should describe the default behavior, point out common mistakes, and give short SQL examples that show how to avoid incorrect risk metrics.