NoSQL interviews test whether you can choose the right data store for a problem and explain the trade offs honestly. This guide gives you 41 NoSQL interview questions and answers, from basics to scenario questions, for freshers and experienced engineers.
Every answer starts with a short, direct response you can say aloud, followed by a table, a query or a runnable example where it helps. The page treats NoSQL as a set of tools for different jobs, and avoids the claims that NoSQL is always faster, has no transactions or lets you pick any two from CAP.
The guide has six parts: 8 on NoSQL basics, 9 on distributed systems concepts, 9 on key value, document, column and graph stores, 5 on data modelling, 4 on current trends and 6 scenario questions. Use the contents list to jump to your level. If you are preparing for a document database role, read the separate MongoDB page as well.
| Section | Questions |
|---|---|
| NoSQL Basics (Freshers) | Q1 to Q8 |
| Distributed Systems Concepts (Intermediate) | Q9 to Q17 |
| Key Value, Document, Column and Graph Stores in Practice (Intermediate) | Q18 to Q26 |
| Data Modelling in NoSQL (Experienced) | Q27 to Q31 |
| Current Trends (All Levels) | Q32 to Q35 |
| Scenario Questions (Experienced) | Q36 to Q41 |
Start with what NoSQL means, why it exists and how it differs from relational databases. Avoid saying NoSQL is better. The right answer is that it solves different problems.
NoSQL describes databases that do not use the fixed table and join model of relational systems. They were created to handle very large data volumes, high write rates, flexible or changing structures and horizontal scaling across many cheap servers. The name is read today as not only SQL, because many of them also offer SQL like query languages.
There are four classic types: key value stores, document databases, wide column stores and graph databases. Time series and vector databases are now often added as further types. Each is built around a data shape and an access pattern, so the choice should start from how the data is read and written.
| Type | Data shape | Examples | Typical use |
|---|---|---|---|
| Key value | Key points to a value | Redis, DynamoDB | Caching, sessions, counters |
| Document | JSON like documents | MongoDB, Couchbase | Catalogues, profiles, content |
| Wide column | Rows with flexible column families | Cassandra, HBase | Large scale writes, time based data |
| Graph | Nodes and relationships | Neo4j | Recommendations, fraud, networks |
| Time series | Timestamped measurements | InfluxDB, TimescaleDB | Metrics and sensor data |
| Vector | Embeddings for similarity search | Pinecone, pgvector, Elasticsearch | Semantic search for AI |
SQL databases store data in tables with a fixed schema, use joins, and offer strong ACID transactions, and they usually scale up on one larger server or through careful replication. NoSQL databases offer flexible schemas and scale out across many nodes, often with relaxed consistency, though many now offer transactions too.
| Point | SQL (relational) | NoSQL |
|---|---|---|
| Schema | Fixed, defined before use | Flexible or schema on read |
| Relationships | Joins across tables | Embedded data or denormalised copies |
| Scaling | Mostly vertical, with read replicas | Horizontal by design |
| Transactions | Full ACID | Varies, many now support ACID in limited scope |
| Query language | SQL | Varies by product |
Choose NoSQL when the data does not fit tables well, when the structure changes often, when you need very high write throughput or low latency at scale, or when you must spread data across regions. Stay relational when you need complex joins, strict transactions and reporting across many entities.
What the interviewer is listening for: You choose by the access pattern and the consistency need, not by fashion.
Polyglot persistence means using different data stores in one system, each for the job it does best. For example, a relational database for orders and payments, Redis for sessions and caching, Elasticsearch for search and a graph database for recommendations. It adds operational cost, so use it where the benefit is clear.
Schema less means the database does not force a structure on every record, so documents in one collection can differ. The application still expects a shape, so the schema moves from the database into the code. Most products let you add validation rules, and good teams keep a clear data model.
ACID stands for atomicity, consistency, isolation and durability, the guarantees of a classic transaction. BASE stands for basically available, soft state and eventually consistent, a looser model that favours availability and scale. Neither is a product feature to pick alone, since many databases let you choose per operation.
| Property set | Meaning | Typical system |
|---|---|---|
| ACID | All or nothing transactions with strong consistency | Relational databases |
| BASE | Available, flexible state, consistent in time | Many distributed NoSQL stores |
No. Speed depends on the data model, the indexes and the query. A NoSQL store is fast for the access pattern it was designed for, such as a key lookup, and slow or impossible for others, such as ad hoc joins. A well indexed relational database is fast for many workloads.
This is the most tested part of a NoSQL interview. Be precise about the CAP theorem and consistency.
The CAP theorem says that when a network partition occurs, a distributed data store must choose between consistency, meaning every read sees the latest write, and availability, meaning every request gets a response. Partitions cannot be avoided in practice, so the real choice is between consistency and availability during a partition.
Add that many systems let you tune the trade off per request, so labelling a product CP or AP is only a rough guide.
| Choice during a partition | Behaviour | Typical examples |
|---|---|---|
| CP | Rejects some requests to stay consistent | MongoDB with majority writes, HBase |
| AP | Keeps answering, data may be stale | Cassandra, DynamoDB with eventual reads |
What the interviewer is listening for: You say the trade off applies during a partition, not all the time, and you avoid the common phrase pick any two.
Eventual consistency means that if no new writes arrive, all replicas will in time hold the same value. Reads in the meantime may return older data. It gives high availability and low latency, and it suits cases such as social feeds, where a short delay is acceptable. It does not suit account balances.
Strong consistency means every read sees the latest write. Eventual consistency means replicas converge over time. Between them are causal consistency, which preserves cause and effect order, read your writes, where a client sees its own updates, and monotonic reads, where a client never sees older data after newer data.
Replication keeps copies of data on several nodes for availability and read scaling. In primary replica replication, one node takes writes and copies them to others. In a multi leader setup, several nodes accept writes and must resolve conflicts. In a leaderless design, such as Cassandra, any replica can take a write and quorums decide success.
Sharding splits the data across nodes so that each holds a part, which scales storage and write throughput. Replication copies the same data to several nodes, which gives fault tolerance and read scaling. Real systems use both: each shard is replicated. The shard key decides where a record goes, so it must be chosen with care.
| Point | Sharding | Replication |
|---|---|---|
| Purpose | Scale data and writes | Availability and read scale |
| Data on each node | A different part | The same data |
| Main risk | Hot shards, costly resharding | Replication lag, conflicts |
A good shard key has high cardinality, spreads writes evenly and matches the most common query, so most queries hit one shard. A key that increases steadily, such as a timestamp or sequence number, sends all new writes to one shard and creates a hot spot. A hashed key spreads load but loses range queries.
Consistent hashing places both nodes and keys on a ring, and each key belongs to the next node clockwise. When a node joins or leaves, only the keys next to it move, not the whole dataset. Systems such as Cassandra and DynamoDB use it, often with virtual nodes to even out the load.
With N replicas, a write waits for W acknowledgements and a read contacts R replicas. If R plus W is greater than N, every read overlaps with the latest write, so reads are strongly consistent. Lower values give faster but weaker reads. Cassandra lets you set this per query with levels such as ONE and QUORUM.
Only the combinations where R plus W exceeds 3 guarantee that a read sees the latest write.
Common methods are last write wins using timestamps, which is simple but can drop updates, vector clocks that track causal history so a conflict is detected and passed to the application, and conflict free replicated data types that merge automatically. Choose by how costly a lost update is.
For each type, know a typical product, the data model and one command or query. The runnable examples below use a Redis compatible test server, so the outputs are real.
A key value store keeps data as a unique key mapped to a value and is the simplest NoSQL model, with very fast reads and writes. Redis is an in memory key value store with data structures such as strings, hashes, lists, sets and sorted sets. It is used for caching, sessions, counters, queues and leaderboards.
The counter shows that Redis can update a value atomically. Two increments give a value of 2.
Use strings for simple values and counters, hashes for objects with fields, lists for queues, sets for unique items and sorted sets for rankings. Choosing the right type avoids moving data to the application. A leaderboard, for example, is a sorted set with the score as the rank value.
Set a time to live on a key with EXPIRE or with an option on SET, and Redis removes the key after that time. It is how a cache stays fresh and how sessions time out. A memory limit with an eviction policy such as least recently used decides what to drop when memory is full.
A document database stores each record as a self describing document, usually JSON or a binary form of it, that can hold nested objects and arrays. It suits data that is read as a whole, such as product catalogues, user profiles and content. MongoDB is the best known example, and has its own interview page.
Embedding related data in one document removes joins and makes reading one object a single lookup.
A wide column store organises data into tables of rows with a partition key and optional clustering columns, and rows can hold very many columns. In Cassandra, the partition key decides which node stores the row, and clustering columns sort rows inside a partition. You design the table around the query, not around the entities.
Cassandra writes each update to a commit log and an in memory table, called the memtable, and acknowledges the write. It flushes memtables to immutable files on disk, called SSTables, and merges them later by compaction. Writes are sequential, with no read before write, so they are very fast.
A graph database stores nodes and the relationships between them as first class data, so queries that follow many links, such as friends of friends or a path between accounts, stay fast. Use it for recommendations, fraud rings, network analysis and knowledge graphs. Neo4j is the best known, and uses the Cypher language.
DynamoDB is a fully managed key value and document database on AWS with single digit millisecond latency at scale. Each table needs a partition key, and optionally a sort key. Queries are efficient only when they use the key, so you design keys and secondary indexes from the access patterns, often keeping many entity types in one table.
HBase is a wide column store modelled on Google Bigtable that runs on top of HDFS. It gives random, real time read and write access to very large tables, which HDFS alone does not. Rows are sorted by row key, so key design controls both performance and range scans.
A good NoSQL model starts from the queries. Interviewers use these questions to see whether you design that way.
In relational design you normalise the entities first and write queries later, joining as needed. In NoSQL you list the queries first and shape the data to answer them in one read, which often means denormalising and storing copies. You trade extra storage and update effort for fast, predictable reads.
Embed when the child data is read with the parent, is small and bounded, and belongs to one parent, such as the addresses of a user. Reference when the data is large, grows without limit, is shared by many parents or changes independently, such as the orders of a customer.
| Situation | Choice | Reason |
|---|---|---|
| Small, read together, one owner | Embed | One read, no join |
| Large or unbounded growth | Reference | Avoid oversized documents |
| Shared across many parents | Reference | One place to update |
| Needs independent access | Reference | Query it on its own |
Denormalisation stores the same data in more than one place so a query needs no join. The risks are extra storage and a copy going out of date, so you must update every copy, ideally through events or a transaction. Use it for data that is read much more than it is written.
Store an array of references on one or both sides, or create a separate link collection or table, depending on size and how you query. In a graph database it is a native relationship. In a key value or wide column store, maintain a second table keyed the other way for the reverse lookup.
A secondary index lets you query by a field other than the primary key. In a distributed store, each index adds write cost and storage, and some, such as local indexes in Cassandra, must query many nodes. Add an index for an access pattern that matters, and prefer a table designed for that query where possible.
These topics separate candidates who read the news from those who only memorised definitions.
NewSQL describes distributed databases that keep SQL and ACID transactions while scaling out like NoSQL. Examples include CockroachDB, TiDB and Google Spanner. They suit applications that need relational guarantees and global scale. They are newer, and operating them still needs care.
A vector database stores embeddings, which are lists of numbers that capture the meaning of text or images, and finds the nearest ones to a query vector. They power semantic search and retrieval for AI answers. Dedicated products exist, and many document, search and relational databases now add vector search as a feature.
Many do, within limits. MongoDB supports multi document ACID transactions on replica sets since version 4.0 and on sharded clusters since 4.2. DynamoDB offers transactions across items. Cassandra offers lightweight transactions on a single partition. Check the scope and the cost, since transactions across shards are slower.
A data warehouse stores cleaned, structured data for reporting. A data lake stores raw data of any form cheaply for later processing. A NoSQL database serves live applications with fast reads and writes. They answer different needs, and one architecture often uses all three.
State the access pattern and the consistency need before you name a product.
A shopping cart is read and written by user key, needs low latency, and can tolerate short term inconsistency, so a key value or document store fits, such as DynamoDB or Redis with persistence. Store the cart as one item keyed by the user or session, set an expiry for abandoned carts, and write the order itself to a transactional database.
What the interviewer is listening for: You name the access pattern, and you keep the order record in a transactional store.
Choose a store built for append heavy, time ordered data, such as Cassandra or a time series database. Partition by sensor and a time bucket so no partition grows without limit, cluster rows by time, apply time to live for old data and aggregate older data into summaries. Test the write rate with realistic load.
Check the shard key distribution and the traffic by key to find a hot key or a skewed range. Fix it by choosing a better key, adding a hash or salt to spread the hot key, splitting the hot range, or caching the hot items. Plan any resharding carefully, since moving data is costly.
The read is probably served by a lagging replica. Route a user own reads to the primary for a short time after a write, which gives read your writes behaviour, or use a read concern or consistency level such as quorum for that query. Accept eventual consistency where a delay does not matter.
First list the queries and check that they fit the new model. Model the data around them, migrate a copy and run both systems in parallel, comparing results. Move reads, then writes, in small steps with a rollback plan. Keep relational data where joins and transactions matter, as a migration is not always the best answer.
Strongly consistent reads across regions cost latency, because writes must be confirmed in more than one region. Options are a single primary region with failover, a database with global consensus such as Spanner or a NewSQL system, or tuned quorum settings at some cost in speed. Decide whether each operation truly needs it.
Prepare the four database types, the CAP theorem, consistency models, replication, sharding and data modelling from the queries. Then learn one product in each family in depth, such as Redis, MongoDB and Cassandra. Be ready for scenario questions where you must choose a store and justify it.
Start with MongoDB for the document model and Redis for key value work, because both are widely used and easy to run locally. Add Cassandra or DynamoDB to understand distributed design. Choose according to the jobs you want and check what your target employers use.
No. Most companies use both. Relational databases remain the default for transactional data and reporting, and NoSQL stores serve cases that need flexible data, scale or very low latency. Learning to choose between them is the skill interviewers look for.
Yes. Interviewers expect SQL fluency, since many NoSQL systems offer SQL like languages and you will move data between systems. Knowing the relational model also helps you explain trade offs clearly.
Run Redis and MongoDB in containers, model a small shop in each, and write the queries your design needs. Then run a three node Cassandra cluster or use a free managed tier, and test what happens when you stop a node. Note the results, because interviewers ask about experience.
Use this plan if you have about a month before your interview.
| Week | Focus | What to do |
|---|---|---|
| Week 1 | Concepts | Learn the database types, ACID and BASE, CAP and consistency models. Explain each aloud in two minutes. |
| Week 2 | Key value and document stores | Practise Redis data types and a MongoDB data model with embedding and references. |
| Week 3 | Distributed design | Study sharding, replication, quorums and Cassandra data modelling. Try a failure test. |
| Week 4 | Scenarios | Practise choosing a database for ten realistic cases and justify each choice. |
If you want to practise these questions with a trainer and work on hands on projects, you can book a free demo class for the Prwatech Big Data course. It covers NoSQL databases, distributed data processing and hands on projects.
Contact the learning team for current batch dates and fees.
Written by Mithun Ray, data engineering trainer at Prwatech. Reviewed by Avishekh Verma. Last updated October,2026.