Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Clustered vs Non-Clustered Indexes

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

Welcome to your interview.

The question is on your right: Clustered vs Non-Clustered Indexes. 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

Indexes affect how PostgreSQL finds rows quickly, especially on large tables used for filtering, sorting, and joins. You should be able to explain not just the definition, but the performance trade-offs and how physical row ordering changes access patterns.

Core question

Explain the difference between a clustered index and a non-clustered index. In your answer, describe how each one stores data, how many can exist on a table, what happens during lookups, and when each is useful.

Scope guidance

Keep your answer focused on database behavior and query performance. A strong answer should compare storage layout, maintenance cost, and read/write trade-offs, and should mention how PostgreSQL handles clustering differently from systems that enforce a clustered primary key.