0
0
HLDsystem_design~20 mins

When to use SQL vs NoSQL in HLD - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Database Mastery: SQL vs NoSQL
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Choosing the right database for structured data

You have a project that requires storing customer information with fixed fields like name, email, and phone number. Which type of database is best suited for this?

AUse a NoSQL database because it handles fixed fields better.
BUse a SQL database because it is designed for structured data with fixed schemas.
CUse a NoSQL database because it is always faster for any data.
DUse a file system instead of a database for structured data.
Attempts:
2 left
💡 Hint

Think about which database type enforces a fixed structure for data.

🧠 Conceptual
intermediate
2:00remaining
Handling flexible data formats

Your application needs to store user-generated content that can vary in format and fields, such as comments, images, and tags. Which database type fits best?

ASQL database because it handles flexible data well.
BFlat files because they are easier to manage than databases.
CIn-memory cache because it stores data permanently.
DNoSQL database because it supports flexible and changing data structures.
Attempts:
2 left
💡 Hint

Consider which database type allows storing data without a fixed schema.

query_result
advanced
2:00remaining
Querying relational data with SQL

Given a SQL table Orders with columns OrderID, CustomerID, and Amount, what is the result of this query?

SELECT CustomerID, SUM(Amount) AS Total FROM Orders GROUP BY CustomerID;
HLD
SELECT CustomerID, SUM(Amount) AS Total FROM Orders GROUP BY CustomerID;
AA list of customers with the total amount of their orders summed up.
BA list of orders with individual amounts.
CAn error because GROUP BY is missing columns.
DA list of customers with the average amount of their orders.
Attempts:
2 left
💡 Hint

GROUP BY groups rows by customer and SUM adds amounts per group.

🧠 Conceptual
advanced
2:00remaining
Scaling databases for high traffic

Your app expects millions of users and needs to scale horizontally across many servers. Which database type is generally easier to scale horizontally?

AFlat files because they can be copied to many servers easily.
BSQL databases because they are designed for horizontal scaling by default.
CNoSQL databases because they are built to scale horizontally across many servers.
DIn-memory databases because they store data on disk.
Attempts:
2 left
💡 Hint

Think about which database type is designed for easy distribution across servers.

🧠 Conceptual
expert
2:00remaining
Choosing database type for complex transactions

You need to build a banking system that requires complex transactions with strict consistency and rollback capabilities. Which database type is most suitable?

ASQL database because it supports ACID transactions ensuring consistency.
BNoSQL database because it handles large volumes of data quickly.
CFlat files because they are simple to manage for transactions.
DIn-memory cache because it is fast for transactions.
Attempts:
2 left
💡 Hint

Consider which database type guarantees transaction safety and consistency.