0
0
Intro to Computingfundamentals~20 mins

NoSQL and alternative models in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
NoSQL Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1: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 })
AAll book titles published after the year 2000, including their _id
BAll books published before the year 2000, including their _id
CAll book titles published after the year 2000, without the _id field
DAll books published after the year 2000, with all fields
Attempts:
2 left
💡 Hint
Look at the filter and projection parts of the query separately.
🧠 Conceptual
intermediate
1: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?
ADocument store (e.g., MongoDB)
BKey-value store (e.g., Redis)
CGraph database (e.g., Neo4j)
DWide-column store (e.g., Cassandra)
Attempts:
2 left
💡 Hint
Think about which model can store nested objects easily.
📋 Factual
advanced
1: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);
ACREATE TABLE users (id UUID, name text, age int PRIMARY KEY);
BCREATE TABLE users id UUID PRIMARY KEY, name text, age int;
CCREATE TABLE users (id UUID PRIMARY KEY, name text, age int);
DCREATE TABLE users (id UUID PRIMARY KEY, name text, age int PRIMARY);
Attempts:
2 left
💡 Hint
Check the parentheses and keyword placement.
optimization
advanced
2: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?
AStore the graph as a document store for faster access
BAvoid using indexes to speed up traversal
CIncrease the number of edges per node to reduce hops
DUse an index on node properties involved in the query
Attempts:
2 left
💡 Hint
Indexes help databases find data faster.
🔍 Analysis
expert
2:00remaining
Why does this Redis command fail with an error?
You run this Redis command:

HSET user:100 name "Alice" age 30

But it returns an error. What is the cause?
AThe command syntax requires field-value pairs, but age and 30 are not paired correctly
BThe key name cannot contain a colon ':'
CRedis does not support hash data types
DThe age value should be a string, not a number
Attempts:
2 left
💡 Hint
Check how field-value pairs are passed in HSET.