Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started

B-Tree vs BRIN for Ledgers

MediumSQL & Data Manipulation00:00
Practice interviewer
In session
5 left
00:00

Whenever you're ready, walk me through how you'd approach this.

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

Problem

Context

In PostgreSQL, index choice can materially change both query latency and ingestion cost, especially on large append-heavy tables such as card authorisations or ledger events.

Question

You are asked to explain how B-Tree indexes differ from BRIN indexes in PostgreSQL. Compare how they store information, what query patterns they support well, and how they affect query performance on large Revolut-style transaction tables. You should also explain write amplification: why some indexes make inserts and updates more expensive, and why BRIN often has a lower maintenance cost than B-Tree.

Scope guidance

A strong medium-level answer should cover physical behavior at a high level, when each index is a good fit, what happens when data is naturally ordered versus randomly distributed, and the trade-off between fast point lookups and cheaper writes. You do not need to discuss every PostgreSQL index type; focus on B-Tree and BRIN with practical examples.