Skip to content
tezvyn:

Top 30 Databases & Architecture Concepts Quiz

30 multiple-choice questions on the Databases & Architecture fundamentals, drawn from 30 bites in the Databases & Architecture library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

SQL, NoSQL, system design, microservices, APIs

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    What is the primary function of a Database Management System (DBMS)?

    Show the answer

    Answer: c · To manage and control how applications interact with and access stored data.

    The card states the DBMS acts as a "single, controlled gateway" and a "librarian" to manage access and operations on data for applications. Option B describes the database itself, which the card identifies as a common misconception, incorrect confusion point.

    Read the full bite: DBMS: The Software That Runs Your Database

  2. Question 2 of 30

    A team needs to speed up queries on a large table and purge old records. Which task requires DDL?

    Show the answer

    Answer: b · Adding an index on the date column to speed up filtering

    Adding an index changes the database schema, which is the purpose of DDL. Purging old rows may seem structural, but it only deletes data, making it a DML operation.

    Read the full bite: DDL: The Blueprint for Database Objects

  3. Question 3 of 30

    Which action is a clear use of DML because it changes stored data rather than table structure or read-only querying?

    Show the answer

    Answer: d · Inserting a new row into an existing table

    Inserting a new row is explicitly called a textbook DML operation that alters stored data. Running a SELECT statement is a tempting distractor because the card notes that read-only querying is sometimes classified separately as DQL rather than being grouped with DML.

    Read the full bite: DML: Insert, Update, and Delete

  4. Question 4 of 30

    What is the primary reason to avoid using "natural keys" like email addresses as primary keys?

    Show the answer

    Answer: a · Their values can change over time, complicating data management and relationships.

    The card states that natural keys "can change, which creates a maintenance nightmare" and requires updating the value in every referencing table. This directly points to complications in data management and maintaining relationships. While other options might have some truth in different contexts, the card emphasizes changeability as the core issue.

    Read the full bite: Primary Keys: The Unique ID for Every Row

  5. Question 5 of 30

    What primary challenge did the relational model address compared to earlier database systems?

    Show the answer

    Answer: c · The need for complex procedural code to navigate specific data storage paths

    The card states that before the relational model, "Retrieving data required writing complex procedural code to navigate specific data paths," which was inflexible. The relational model aimed to separate the logical data structure from its physical implementation. Option A is a distractor because while hierarchical models were predecessors, the core problem was the procedural navigation within them, not just the representation of hierarchies.

    Read the full bite: The Relational Model: Data as Simple Tables

  6. Question 6 of 30

    In a bank transfer, which ACID property guarantees that if the transaction fails midway, both accounts revert to their original state?

    Show the answer

    Answer: d · Atomicity

    Atomicity ensures that a transaction is treated as an 'all or nothing' operation; if any part fails, the entire transaction is rolled back. Consistency, while ensuring the database moves from one valid state to another, does not specifically handle the rollback of an incomplete operation in the same way Atomicity does.

    Read the full bite: ACID: The Four Guarantees of Database Transactions

  7. Question 7 of 30

    What is the main objective of applying database normalization in a relational database?

    Show the answer

    Answer: a · To ensure data integrity and minimize redundancy by structuring data into smaller, related tables.

    Normalization's primary goal is to eliminate data redundancy and prevent modification anomalies (update, insertion, deletion), thereby ensuring data integrity. Option D describes a benefit of denormalization, often used in analytical systems, which is the opposite of normalization's typical effect on JOINs.

    Read the full bite: Database Normalization: Tidy Tables, Less Redundancy

  8. Question 8 of 30

    By default, what action does a relational database take when a user attempts to delete a record from a "parent" table that is referenced by a foreign key in a "child" table?

    Show the answer

    Answer: c · It blocks the deletion of the parent record to maintain data integrity.

    The card explicitly states that if you try to delete a user referenced by posts, "the database will, by default, block the deletion to avoid creating orphaned posts." This is the standard behavior to enforce referential integrity. Option B describes an 'ON DELETE SET NULL' action, which is a configurable behavior, not the default.

    Read the full bite: Foreign Keys: The Glue of Relational Databases

  9. Question 9 of 30

    What is the main performance trade-off introduced by adding a database index?

    Show the answer

    Answer: d · It speeds up data retrieval but slows down data modification operations.

    The card explicitly states that indexes speed up data retrieval but add overhead to INSERT, UPDATE, and DELETE operations, as the index structure must also be modified. This trade-off between faster reads and slower writes is the primary consideration. Indexes do not inherently complicate schema design, slow down non-indexed queries, or require manual updates for consistency.

    Read the full bite: Database Index: The Phonebook for Your Data

  10. Question 10 of 30

    What is the primary distinction between a standard database view and a base table?

    Show the answer

    Answer: a · A view executes a predefined query against base tables each time it is accessed, without storing its own data.

    A standard view stores only its query definition and executes it against the underlying base tables each time it's accessed, as explained in the 'How It Works' section. Option C describes a common misconception; views do not store their own data, unlike materialized views.

    Read the full bite: Database Views: A Saved Query That Acts Like a Table

  11. Question 11 of 30

    Which statement best describes the core trade-off when selecting a lower transaction isolation level?

    Show the answer

    Answer: d · It aims to maximize concurrent transaction execution, potentially allowing more data anomalies.

    The card states that lower isolation levels increase concurrency by using fewer locks, but this comes at the cost of allowing more types of data anomalies. Option D accurately captures this fundamental trade-off between maximizing concurrent execution and the risk of data anomalies. Option B describes the characteristics of higher isolation levels, not lower ones.

    Read the full bite: Transaction Isolation Levels: The Concurrency vs. Correctness Dial

  12. Question 12 of 30

    What is the fundamental purpose of relational algebra within a database system?

    Show the answer

    Answer: b · To provide a formal, procedural model for query execution and optimization.

    Relational algebra serves as the formal, procedural model that a database uses to translate declarative SQL queries into an optimizable execution plan. Option C describes SQL itself, which is the high-level, declarative language, not relational algebra.

    Read the full bite: Relational Algebra: The Math Behind SQL Queries

  13. Question 13 of 30

    What is the primary philosophical goal Codd's 12 Rules aim to achieve for database systems?

    Show the answer

    Answer: a · Ensuring complete separation between the logical data model and its physical implementation.

    Codd's rules were created to formally define data independence, which is the separation of the logical data representation from its physical implementation. They are explicitly stated as a theoretical benchmark, not a practical tool for vendor comparison.

    Read the full bite: Codd's 12 Rules: The Relational Database Litmus Test

  14. Question 14 of 30

    Under what specific condition might a database designer intentionally opt for a 3NF schema instead of striving for BCNF?

    Show the answer

    Answer: b · If achieving BCNF would make it impossible to enforce a critical functional dependency using a key constraint.

    The card explicitly states that the primary reason not to use BCNF is the trade-off with dependency preservation, where achieving BCNF might prevent enforcing an original functional dependency with a key constraint. Option D describes the goal of BCNF, which is stricter than 3NF in eliminating anomalies, making it an incorrect reason to choose 3NF.

    Read the full bite: Boyce-Codd Normal Form (BCNF): Stricter Than 3NF

  15. Question 15 of 30

    What is the primary purpose of creating an Entity-Relationship Diagram (ERD)?

    Show the answer

    Answer: a · To provide a visual blueprint for a relational database schema before implementation.

    An ERD serves as a blueprint for designing a relational database schema before any tables are created, preventing costly rework. It is explicitly stated that designing the model to match the UI is a common pitfall, and ERDs are less useful for NoSQL databases.

    Read the full bite: Entity-Relationship Diagrams: A Blueprint for Your Data

  16. Question 16 of 30

    What is the primary characteristic that a table must satisfy to be in First Normal Form (1NF)?

    Show the answer

    Answer: c · There are no repeating groups or multi-valued attributes within any column.

    The correct answer B directly states the core principle of 1NF: ensuring each cell contains a single, atomic value by disallowing repeating groups or lists. Option D, while true for relational tables, describes a primary key's role, not the specific atomicity requirement of 1NF.

    Read the full bite: First Normal Form (1NF): No Nested Data

  17. Question 17 of 30

    Which scenario *requires* the use of a junction table in a relational database?

    Show the answer

    Answer: b · A product belonging to several categories, and each category containing multiple products.

    Option B describes a many-to-many relationship, which is the fundamental problem junction tables are designed to solve. Options A, C, and D all represent one-to-many relationships, which can be modeled by placing a foreign key directly in the 'many' side table without needing a junction table.

    Read the full bite: Junction Table: Connecting Many to Many

  18. Question 18 of 30

    In the context of database design, what does the functional dependency "A -> B" primarily signify?

    Show the answer

    Answer: c · For every unique value in column A, there is exactly one corresponding value in column B.

    A functional dependency A -> B means that if you know the value(s) in column A, you can uniquely determine the value(s) in column B. Option B describes a foreign key relationship, which is a different concept from functional dependency.

    Read the full bite: Functional Dependency: The Rules Behind Your Data

  19. Question 19 of 30

    Which of the following describes a 2NF violation in a relation that is in 1NF and has a composite candidate key?

    Show the answer

    Answer: a · A non-prime attribute is functionally dependent on only one attribute of the composite candidate key.

    2NF eliminates partial dependencies, meaning every non-prime attribute must depend on the whole composite candidate key, not just a subset. Option B describes a transitive dependency, which violates 3NF, not 2NF.

    Read the full bite: Second Normal Form (2NF)

  20. Question 20 of 30

    Which scenario represents a violation of Third Normal Form (3NF)?

    Show the answer

    Answer: a · A non-key attribute in a table is fully dependent on another non-key attribute.

    Third Normal Form (3NF) specifically addresses transitive dependencies, which occur when a non-key attribute depends on another non-key attribute instead of directly on the primary key. Options A and C describe violations of First Normal Form (1NF) and Second Normal Form (2NF), respectively.

    Read the full bite: Third Normal Form (3NF): Nothing But The Key

  21. Question 21 of 30

    What is the primary advantage of employing a surrogate key as the primary key for a table containing core business entities?

    Show the answer

    Answer: a · It ensures that relationships between tables remain stable even if the real-world data they represent changes.

    The card emphasizes that surrogate keys solve the stability problem by decoupling internal linking from volatile real-world data, preventing painful cascading updates. Option C is incorrect because surrogate keys are meaningless and exposing them externally is a 'footgun'.

    Read the full bite: Surrogate Keys: Stable IDs for Unstable Data

  22. Question 22 of 30

    Which scenario best demonstrates the primary benefit of denormalization?

    Show the answer

    Answer: d · An analytics dashboard displaying pre-calculated sales trends over time.

    Denormalization is ideal for read-heavy systems like analytics dashboards, where pre-calculating or duplicating data significantly speeds up frequent queries. It is generally avoided in write-heavy systems or when strict data integrity and minimal storage are paramount.

    Read the full bite: Denormalization: Trading Write Speed for Faster Reads

  23. Question 23 of 30

    Which statement accurately describes the primary trade-off when using a materialized view?

    Show the answer

    Answer: b · It sacrifices data freshness to achieve faster query execution.

    The card explicitly states that a materialized view involves a "direct tradeoff: speed for freshness." It pre-computes and stores query results for faster access, but this means the data can be stale. Option A is incorrect because materialized views increase storage by storing a physical copy of the data. Option C is incorrect as they primarily improve read performance, not write performance. Option D is incorrect because materialized views introduce data staleness, which is the opposite of real-time consistency.

    Read the full bite: Materialized Views: Pre-computing Slow Queries

  24. Question 24 of 30

    What specific type of data redundancy does Fourth Normal Form (4NF) primarily address that BCNF does not?

    Show the answer

    Answer: c · Redundancy from combining multiple independent lists of facts about a single entity.

    Correct answer C directly describes the core problem 4NF solves: the redundancy arising when a table combines two or more independent, multi-valued lists of facts about a single entity. Option A describes the type of redundancy addressed by BCNF, which focuses on functional dependencies where a determinant is not a superkey, not on independent multi-valued relationships.

    Read the full bite: Fourth Normal Form (4NF): Isolating Independent Facts

  25. Question 25 of 30

    Which concurrency control strategy is best suited for a system with frequent data conflicts where preventing inconsistent states is prioritized?

    Show the answer

    Answer: b · Pessimistic concurrency, as it acquires locks before data modification, ensuring exclusive access.

    Pessimistic concurrency is designed for high-contention environments with frequent conflicts, as it prevents inconsistent states by locking data before modification. Optimistic concurrency, while avoiding initial locks, would lead to frequent and costly transaction retries in such a scenario.

    Read the full bite: Lock Now or Check Later: Optimistic vs. Pessimistic Concurrency

  26. Question 26 of 30

    When a database uses Write-Ahead Logging (WAL) for a data modification, what action occurs first?

    Show the answer

    Answer: b · A record detailing the intended modification is appended to the WAL file on disk.

    The core principle of WAL is to first record the intended change in a sequential log file on disk. Only after this log entry is safely persisted does the database apply the change to its in-memory copy of the data, making option D incorrect as it happens later.

    Read the full bite: Write-Ahead Logging (WAL): Survive Crashes by Journaling First

  27. Question 27 of 30

    According to the Write-Ahead Logging (WAL) principle, when does a database record an intended data change in its transaction log?

    Show the answer

    Answer: a · Before the data is modified in the main database files, ensuring the log entry is durable.

    The card states, "The log entry is written before the action is taken. This is called Write-Ahead Logging (WAL)." This ensures that a durable record exists for recovery even if a crash occurs during the actual data modification. Option D is incorrect because log entries are written throughout the transaction, not just at commit, to ensure atomicity and durability.

    Read the full bite: Database Transaction Log: Your System's Safety Net

  28. Question 28 of 30

    Consider a scenario where Transaction A is updating a record, holding an Exclusive (X) lock. If Transaction B then attempts to read the same record, what is the immediate consequence for Transaction B?

    Show the answer

    Answer: b · Transaction B must wait until Transaction A releases its Exclusive (X) lock.

    The card explicitly states that if a transaction requests a lock incompatible with an existing one, it must wait. An Exclusive (X) lock, used for writing, is incompatible with any other lock, including a Shared (S) lock requested for reading. Therefore, the reading transaction must wait, rather than reading potentially inconsistent data or forcing a rollback.

    Read the full bite: Shared & Exclusive Locks: The Read vs. Write Rule

  29. Question 29 of 30

    How does Two-Phase Locking (2PL) primarily ensure data consistency in concurrent transactions?

    Show the answer

    Answer: a · By acquiring all necessary locks in a growing phase before releasing any in a shrinking phase.

    2PL's core mechanism involves a strict growing phase for acquiring all locks and a shrinking phase for releasing them, ensuring all locking precedes unlocking. This guarantees conflict-serializability, making concurrent operations appear sequential. Option C describes a general outcome of locking, not the specific two-phase mechanism that ensures serializability.

    Read the full bite: Two-Phase Locking (2PL): Preventing Database Race Conditions

  30. Question 30 of 30

    When a database detects a deadlock between two transactions, what is its typical immediate action to resolve the situation?

    Show the answer

    Answer: a · It aborts one of the transactions, rolling back its changes to free up resources.

    The card explicitly states that the database 'breaks the stalemate by choosing one transaction as the 'victim,' aborting it, and rolling back all its changes.' Option B describes a prevention strategy that developers implement, not an automatic resolution action by the database during an active deadlock.

    Read the full bite: Database Deadlock: The Two-Way Standoff

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon