Professional Documents
Culture Documents
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.