Sample questions
Question 1Easy
BASE properties are often contrasted with:
- CAP
- ACID
- SQL
- REST
Answer: B. ACID
Explanation
BASE (Basically Available, Soft state, Eventual consistency) is the NoSQL counterpart to ACID.
Step-by-step solution
- BASE vs ACID.
Why the other options are wrong
- A. CAP is a distributed systems theorem, not the contrast for BASE.
- C. SQL is a query language, not the model BASE is set against.
- D. REST is an API style, not the consistency model BASE is set against.
Question 2Easy
In the CAP theorem, what does the 'P' stand for?
- Persistence of data
- Partition tolerance
- Performance tuning
- Parallelism of nodes
Answer: B. Partition tolerance
Explanation
P is the ability to keep working despite network partitions between nodes.
Step-by-step solution
- The CAP theorem names three properties: Consistency, Availability and Partition tolerance.
- The P is for partition tolerance: the system keeps working when the network splits.
- So the answer is option B.
Why the other options are wrong
- A. Durability is not one of the CAP letters.
- C. Performance tuning is not part of the CAP theorem.
- D. Parallelism of nodes is not one of the CAP letters.
Tip: CAP is Consistency, Availability and Partition tolerance; partitions are unavoidable in distributed systems.
Question 3Easy
ACID's letter 'I' stands for:
- Integrity
- Indexing
- Isolation
- Interaction
Answer: C. Isolation
Explanation
ACID: Atomicity, Consistency, Isolation, Durability.
Step-by-step solution
- Expand ACID.
Why the other options are wrong
- A. Integrity is not the I; ACID's C is consistency.
- B. Indexing is not part of ACID.
- D. Interaction is not an ACID property.
Question 4Easy
The 'BASE' acronym used for many NoSQL systems contrasts with:
- CAP
- ACID
- CRUD
- SQL
Answer: B. ACID
Explanation
BASE (Basically Available, Soft state, Eventual consistency) is the relaxed counterpart to ACID.
Step-by-step solution
- BASE stands for Basically Available, Soft state, Eventual consistency.
- ACID ensures Atomicity, Consistency, Isolation, Durability in databases.
- BASE is a relaxed alternative to ACID properties in NoSQL systems.
- ACID guarantees strong consistency and reliability in transactions.
- Therefore, BASE contrasts with ACID in database systems.
Why the other options are wrong
- A. CAP is a theorem about three properties of distributed systems; BASE is the term paired against ACID.
- C. CRUD is the four basic data operations, not a set of transaction guarantees.
- D. SQL is a query language, not a set of consistency guarantees that BASE is set against.
Tip: Remember BASE is used in NoSQL for scalability, while ACID is for SQL databases.
Question 5Medium
Which read concern returns only data acknowledged by a majority and thus safe from rollback?
- majority
- local
- available
- linearizable only for single node
Answer: A. majority
Explanation
majority returns data durable across most members.
Step-by-step solution
- Safe from rollback.
Why the other options are wrong
- B. local may be rolled back.
- C. The available read concern does not guarantee majority-acknowledged data.
- D. linearizable is a different, stronger read concern for single-document reads on the primary; it is not the majority-acknowledged level asked for.
Question 6Medium
A system that rejects some requests during a partition to avoid returning stale data is favouring:
- Availability over consistency (AP)
- Neither C nor A
- Only latency
- Consistency over availability (CP)
Answer: D. Consistency over availability (CP)
Explanation
Refusing requests keeps all answers consistent at the cost of availability.
Step-by-step solution
- Rejecting requests ensures data stays consistent across the system.
- Consistency is prioritized over allowing some unavailable services.
- This matches the CP model where consistency is favoured over availability.
Why the other options are wrong
- A. Favouring availability over consistency is AP, which keeps answering even with stale data.
- B. The system does pick one during a partition; it is not neither, since it chooses consistency here.
- C. Latency is not the trade-off CAP describes; the choice here is consistency versus availability.
Tip: In a partition, choose CP to keep data consistent.
Question 7Medium
In MongoDB, which write concern gives acknowledgement only after a majority of replica set members have the write?
- w: 0, which sends the write without acknowledgement
- w: 'majority'
- w: 1, which waits only for the primary
- j: false, which skips the journal
Answer: B. w: 'majority'
Explanation
Majority write concern waits for most members, protecting against rollback after failover.
Step-by-step solution
- Pick the option that names majority.
Why the other options are wrong
- A. w:0 means no acknowledgement.
- C. w:1 waits only for the primary.
- D. j relates to journaling.
Question 8Medium
What does 'eventual consistency' guarantee?
- Without new writes, replicas eventually converge
- Every read sees the latest write immediately and always
- Writes are never lost even without replication
- All nodes always hold identical data at every instant
Answer: A. Without new writes, replicas eventually converge
Explanation
Replicas may briefly diverge but converge over time.
Step-by-step solution
- Eventual consistency allows replicas to catch up after delays.
- New writes are not needed for convergence.
- Replicas eventually show the same data without new writes.
- This matches option A exactly.
Why the other options are wrong
- B. Reads that always see the latest write is strong consistency, not eventual consistency.
- C. Writes can still be lost without replication or acknowledgement; eventual consistency does not promise that.
- D. Replicas can differ at any moment; identical data at every instant is strong consistency.
Tip: Remember: eventual consistency means data converges later, not immediately.
Question 9Hard
Which statement about the CAP theorem is correct?
- Under a partition, C and A cannot both be kept
- A system can always provide all three guarantees together
- CAP says that network partitions never occur
- CAP applies only to single-node databases
Answer: A. Under a partition, C and A cannot both be kept
Explanation
CAP states that under a partition you must sacrifice either consistency or availability.
Step-by-step solution
- CAP says that when a network partition happens, a system cannot keep both consistency and availability.
- So a system cannot always give all three guarantees together.
- The correct statement is option A.
Why the other options are wrong
- B. CAP says all three cannot always be kept together during a partition.
- C. CAP assumes partitions can happen; it does not say they never occur.
- D. CAP applies to distributed systems with several nodes, not single-node databases.
Tip: CAP is a choice under partition: consistency or availability, not both, while partition tolerance is kept.
Question 10Hard
In a Dynamo-style system with N replicas, read quorum R and write quorum W, strong read-your-write consistency is guaranteed when:
- R + W < N
- R = W = 1
- R + W > N
- R + W = 1
Answer: C. R + W > N
Explanation
If R + W > N, read and write sets overlap in at least one replica holding the latest value.
Step-by-step solution
- A read quorum R and write quorum W overlap when R + W is greater than N.
- Overlap means every read touches at least one replica holding the latest write.
- So strong read-your-write consistency needs R + W > N, which is option C.
Why the other options are wrong
- A. If R + W is less than N, the sets may not overlap, so reads can be stale.
- B. R = W = 1 overlaps only when N is 1.
- D. R + W = 1 is far too small to overlap for N greater than 1.
Tip: Check the overlap with R + W > N; for N = 3, use R = 2 and W = 2.
Practise all 20 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →