0
0
HLDsystem_design~20 mins

Database indexing in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Database Indexing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the purpose of database indexes

Which of the following best explains why database indexes are used?

ATo encrypt data for security purposes
BTo increase the size of the database for better storage
CTo speed up data retrieval by reducing the amount of data scanned
DTo backup the database automatically
Attempts:
2 left
💡 Hint

Think about how indexes help find data faster, like an index in a book.

Architecture
intermediate
2:00remaining
Choosing the right index type for a query

You have a table with millions of rows and a query that filters by a range of dates. Which index type is most suitable?

AFull-text index
BHash index
CBitmap index
DB-tree index
Attempts:
2 left
💡 Hint

Consider which index supports range queries efficiently.

scaling
advanced
2:00remaining
Scaling read performance with indexes

Your application experiences slow read queries on a large table. You add multiple indexes. What is a potential downside of adding many indexes?

AReduced read performance because indexes slow down queries
BIncreased write latency due to index maintenance
CIndexes consume less disk space, causing storage issues
DIndexes automatically delete old data, causing data loss
Attempts:
2 left
💡 Hint

Think about what happens when data is inserted or updated in indexed tables.

tradeoff
advanced
2:00remaining
Tradeoffs between clustered and non-clustered indexes

Which statement correctly describes a key difference between clustered and non-clustered indexes?

AClustered indexes store data rows in the index order; non-clustered indexes store pointers to data rows
BNon-clustered indexes store data rows in the index order; clustered indexes store pointers to data rows
CNon-clustered indexes always use less disk space than clustered indexes
DClustered indexes cannot be created on primary keys; non-clustered indexes can
Attempts:
2 left
💡 Hint

Consider how data is physically stored in clustered indexes.

estimation
expert
2:00remaining
Estimating index size impact on storage

You have a table with 100 million rows and a single-column B-tree index on a 4-byte integer column. Approximately how much disk space will the index consume if each index entry requires 20 bytes?

AAbout 2 GB
BAbout 200 MB
CAbout 20 GB
DAbout 200 GB
Attempts:
2 left
💡 Hint

Multiply the number of rows by the size per index entry and convert bytes to gigabytes.