Challenge - 5 Problems
NoSQL Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate1:30remaining
What is the output of this MongoDB query?
Consider a MongoDB collection named
books with documents containing title and year. What does this query return?db.books.find({ year: { $gt: 2000 } }, { title: 1, _id: 0 })Intro to Computing
db.books.find({ year: { $gt: 2000 } }, { title: 1, _id: 0 })Attempts:
2 left
💡 Hint
Look at the filter and projection parts of the query separately.
✗ Incorrect
The filter
{ year: { $gt: 2000 } } selects books with year greater than 2000. The projection { title: 1, _id: 0 } includes only the title field and excludes the _id field from the output.🧠 Conceptual
intermediate1:00remaining
Which NoSQL model is best for storing hierarchical data?
You want to store data that naturally forms a tree structure, like categories and subcategories. Which NoSQL database model fits this use case best?
Attempts:
2 left
💡 Hint
Think about which model can store nested objects easily.
✗ Incorrect
Document stores allow nested documents, making them ideal for hierarchical data like trees.
📋 Factual
advanced1:30remaining
Identify the syntax error in this Cassandra CQL query
Which option contains a syntax error when creating a table in Cassandra?
Intro to Computing
CREATE TABLE users (id UUID PRIMARY KEY, name text, age int);Attempts:
2 left
💡 Hint
Check the parentheses and keyword placement.
✗ Incorrect
Option B is missing parentheses around the column definitions, which is required syntax in CQL.
❓ optimization
advanced2:00remaining
How to optimize a graph database query for shortest path?
You have a graph database with millions of nodes. You want to find the shortest path between two nodes efficiently. Which approach improves query performance?
Attempts:
2 left
💡 Hint
Indexes help databases find data faster.
✗ Incorrect
Indexes on node properties help the database quickly locate start and end nodes, improving shortest path query speed.
🔍 Analysis
expert2:00remaining
Why does this Redis command fail with an error?
You run this Redis command:
But it returns an error. What is the cause?
HSET user:100 name "Alice" age 30But it returns an error. What is the cause?
Attempts:
2 left
💡 Hint
Check how field-value pairs are passed in HSET.
✗ Incorrect
HSET expects pairs of field and value. The command is correct as shown, so the error must be due to missing quotes or incorrect pairing in the actual command usage.