NoSQL & Modern Databases MCQs for the NSCT
NoSQL databases are non-relational stores built to scale out across many servers, and they come in four main data models: document, key-value, column-family (wide-column) and graph. This is topic 16 of the 17 in the Databases area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Candidates averaged 42.3% accuracy in Databases in 2026, per the HEC NSCT report and APP.
Questions test which model fits a scenario, the CAP and BASE ideas, and simple placement counts such as consistent hashing and quorums. They do not test product version details, so learn the models, not the vendors.
The four models at a glance
| Model | Unit of data | You query by | Good for | Example systems |
|---|---|---|---|---|
| Key-value | Opaque value under a key | Key only | Sessions, carts, caches | Redis, DynamoDB |
| Document | JSON/BSON document | Key or any indexed field | Catalogues, profiles, content | MongoDB, CouchDB |
| Column-family | Sparse row of column families | Row key, key ranges | Huge write rates, time series | Cassandra, HBase |
| Graph | Nodes, edges, properties | Traversals | Social networks, recommendations | Neo4j |
Sadalage and Fowler call the first three aggregate-oriented, because each stores a cluster of related data (an order with its lines) as one unit. Graph databases are not aggregate-oriented.
Document stores
A document store keeps self-describing records, usually JSON. The database understands the fields, so you can filter and index on them. Documents in one collection may have different fields; this is called schemaless, but the schema still exists implicitly in the application code.
{ "_id": 7, "name": "Laptop", "ram_gb": 16, "tags": ["work", "student"] }
The key design choice is embed or reference. Embed small, bounded data that is always read with its parent, such as a user's two addresses. Reference large or unbounded data, such as thousands of comments on a post.
Exam angle: products with different attributes per category point to a document store.
Key-value stores
The simplest model: put(key, value), get(key), delete(key). The store treats the value as an opaque blob, so lookups by key are very fast, but you cannot query inside the value. Keys are spread across nodes by hashing, for example node = hash(key) mod 3.
Exam angle: "read or write the whole object by one ID" means key-value.
Column-family stores
A column-family (wide-column) store organises data into rows found by a row key, with columns grouped into column families. Rows are sparse: a row stores only the columns it has. If four users have 2, 3, 1 and 3 attributes, the store holds 9 cells, while a relational table with 4 columns would hold 16 slots, 7 of them NULL.
Do not confuse this with columnar storage in analytical databases, which stores each column's values together to speed up scans. One is a logical NoSQL model; the other is a physical layout.
Exam angle: time series and very high write rates queried by key and time range point here.
Graph stores
A graph database stores nodes (entities), relationships (edges) and properties on both. Queries traverse edges, so "friends of friends" follows stored links instead of running one self-join per hop as SQL would.
Exam angle: multi-hop relationship queries (paths, recommendations, fraud rings) point to a graph database.
CAP, BASE and scaling
| ACID (relational) | BASE (many NoSQL systems) | |
|---|---|---|
| Consistency | Strong, immediate | Eventual |
| Availability | May block or abort | Basically available |
| State | Changes only via transactions | Soft state while replicas sync |
The CAP theorem says that during a network partition a distributed system must choose between consistency (every read sees the latest write) and availability (every request gets a response). Many textbooks, including Elmasri-Navathe, phrase it as "pick two of three"; the more precise reading is that partitions happen, so the real choice is C or A while one lasts. CAP's C is not ACID's C. The Distributed Databases topic covers replication in more depth.
Sharding splits data across nodes; replication copies the same data. With N replicas, a read quorum R and write quorum W guarantee fresh reads when R + W > N.
Consistent hashing places nodes and keys on a ring; each key goes to the first node clockwise. Adding a node moves only the keys in its new arc. Plain key mod N placement moves most keys: going from 4 to 5 servers remaps 80 of keys 0 to 99.
Common traps
- Reading CAP's "consistency" as ACID consistency.
- Treating a column-family store as the same thing as a columnar warehouse.
- Taking "schemaless" to mean the data has no structure.
- Forgetting the wrap-around on a consistent-hashing ring.
- Using R + W ≥ N instead of R + W > N.
- Assuming NoSQL always beats relational; multi-row ACID work with joins still suits an RDBMS.
Worked examples
1. Understanding. What does "soft state" in BASE mean? Answer: The system's state can change over time even with no new writes, because replicas are still exchanging updates and converging.
2. Application. A ring uses positions 0 to 359. Nodes P, Q and R sit at 90, 200 and 300. Which node owns key 310, and which keys move if node S is added at 250? Answer: Key 310 has no node after it before 359, so it wraps to P at 90. S takes the arc from 201 to 250, so only keys in that range move, from R to S.
3. Analysis. A store runs with N = 4, W = 3 and R = 1. Users sometimes see stale data. Why, and what is the smallest change to R that fixes it? Answer: R + W = 4, which is not greater than 4, so a read can hit the one replica the write skipped. Raising R to 2 gives 5 > 4, so every read overlaps the write set.
Practise
The quiz below has 100 NoSQL & Modern Databases questions you can filter by tier and difficulty.
Practise: 100 questions
FAQs
Is NoSQL better than SQL?
Neither is better in general. NoSQL stores suit huge scale, flexible structure or relationship-heavy data. Relational databases suit multi-row ACID transactions, joins and ad hoc queries. Many systems use both, which is called polyglot persistence.
What is the difference between sharding and replication?
Sharding splits a dataset so each node holds a different part, which spreads storage and write load. Replication keeps copies of the same data on several nodes, which improves availability and read capacity. Real deployments normally combine the two.
Does NoSQL mean "no SQL at all"?
It is usually read as "not only SQL". Many NoSQL systems offer SQL-like query languages, and NewSQL systems keep full SQL and ACID transactions while scaling out across nodes.
Which NoSQL model should I pick for a scenario question?
Look at the access pattern. Whole object by one key: key-value. Varying fields queried by attribute: document. Massive writes read by key and time range: column-family. Multi-hop relationships: graph.
Next step
Continue with Data Warehousing & Data Mining MCQs, go back to the Databases MCQs hub, or try a timed NSCT mock test.