You are on page 1of 8

DDIA - Chapter 6

1. Indexing Basics: What is an index in the context of databases, and why is it important for
efficient data retrieval?

2. Index Types: Can you explain the difference between a hash index and a B-tree index? In
what scenarios would you use each?
3. Storing Indexes: How are indexes typically stored on disk, and what challenges do databases
face in keeping index storage efficient?

4. Log-Structured Storage: Describe log-structured storage and explain how it differs from
page-oriented storage.
5. SSTables and LSM-Trees: What are SSTables and LSM-Trees? How do they improve write
performance in a database?

6. B-Trees and OperaQons: Describe the basic structure of a B-Tree. How are read, write, and
delete operaQons performed on a B-Tree?
7. Costs and Trade-offs: Discuss the trade-offs between different indexing strategies (e.g., full-
text search indexes vs. columnar indexes).

8. Compression and Performance: How does data compression in indexes affect database
performance?
9. Write AmplificaQon: What is write amplificaQon, and why is it a concern in certain types of
storage engines?

10. TransacQon Logs and Recovery: Explain the role of transacQon logs in database recovery
processes.
Scenario Based Ques/ons
1. Efficient Search in a User Database: Imagine you are designing a database for a social
media platform. The database needs to efficiently handle queries for user profiles based on
usernames, which are unique. Which type of index would you choose to optimize this
search, and why? Consider the frequency of read operations compared to write operations.

2. High-Volume Write Scenario: Your company is developing a logging system that will
handle a very high volume of write operations with relatively fewer read operations.
Describe the type of storage engine you would use. Would you prefer LSM-Trees or B-Trees
for this use case? Explain your choice considering write throughput and read performance.
3. Database Recovery after a Crash: You have a database that stores critical financial data.
After an unexpected crash, there is a need to restore the database to its most recent
consistent state. Explain the role of the transaction log in this recovery process and how it
ensures data integrity.

4. Balancing Read and Write Performance in an E-commerce Application: You're tasked


with optimizing a product catalog database for an e-commerce application, which
experiences heavy read and write operations, especially during sales events. What strategies
would you employ to balance read and write performance in the database? Discuss the
implications of your choices on the overall performance of the database.
5. Implementing Full-Text Search: A news website wants to implement a full-text search
feature to allow users to search through a large number of articles. Considering the nature
of full-text search, what indexing strategy would you recommend? Explain how this strategy
would handle updates to the data, such as new articles being added or existing ones being
modified.

You might also like