Hey there, data enthusiasts! If you’re gearin’ up to land a killer role in data science, analytics, or database management, you’ve gotta nail down data modelling. Trust me, I’ve been there—sittin’ across from an interviewer, palms sweaty, tryin’ to explain a star schema without trippin’ over my words. At TechMentor Hub, we’ve coached tons of folks just like you to ace these chats, and today, I’m spillin’ the beans on the must-know data modelling interview questions. Whether you’re a newbie or a seasoned pro, this guide’s got your back with simple explanations, real-world tips, and a whole lotta grit. Let’s dive in and get you prepped to impress!
Why Data Modelling Matters in Interviews
Before we jump into the nitty-gritty, let’s chat about why data modelling is such a big deal. In a world where companies are drownin’ in data, organizin’ it into somethin’ useful is pure gold. Data modelling is like buildin’ the blueprint for a house—it shows how data connects flows and makes sense for business needs. Interviewers wanna see if you can think logically, structure info, and solve real problems, whether it’s for AI, cloud systems, or analytics. So, masterin’ these concepts ain’t just about passin’ a test; it’s about provin’ you’re the go-to person for makin’ data work.
Data Modelling Basics: Startin’ with the Foundation
Let’s kick things off with the fundamentals. If you’re new to this game, or just need a quick refresh, understanding the core ideas will help you tackle any question thrown your way.
-
What’s a Data Model, Anyway?
Think of a data model as a map for your data. It’s a way to organize and show how pieces of info relate to each other in a system. There’s three main types we deal with:- Conceptual Model: This is the big-picture view, focusin’ on high-level entities and relationships. It’s like sketchin’ out the idea of a database without gettin’ into techy details.
- Logical Model: Here, we add more meat to the bones—attributes, details, and structure, but still keepin’ it tech-independent.
- Physical Model: Now we’re talkin’ real database stuff—tables, columns, indexes. It’s how the data actually lives in the system.
-
Why Should You Care?Knowin’ these types shows you get the full lifecycle of data design. Interviewers might ask you to explain the difference, so be ready to break it down simple-like just as I did here.
Top Data Modelling Interview Questions for Freshers
If you’re just startin’ out, interviewers will likely focus on the basics to see if you’ve got a solid grasp. Here’s some common questions we at TechMentor Hub see poppin’ up, along with how to answer ‘em like a champ.
1. What’s the Difference Between Logical and Physical Data Models?
This one’s a classic. They wanna know if you understand the stages of modellin’. Here’s the deal:
| Aspect | Logical Data Model | Physical Data Model |
|---|---|---|
| Focus | Structure and business rules | Actual database setup |
| Details | Entities, attributes, relationships | Tables, columns, indexes |
| Tech Dependency | Not tied to any tech | Specific to database tech |
| Used By | Data architects and analysts | DBAs and developers |
| Example | Customer entity with Name attribute | Customer table with Name as VARCHAR(50) |
How to Answer: Keep it clear. Say somethin’ like, “A logical model is about the business structure, showin’ entities and how they connect without worryin’ about the tech. A physical model, tho, is all about how it’s implemented in the database, down to the tables and data types.” Throw in an example if you can.
2. Can You Explain Normalization and Denormalization?
Oh boy, this question trips up a lotta folks. Let me break it down easy.
- Normalization: It’s about organizin’ data to cut out duplicates and keep things tidy. You split data into related tables so there’s no redundancy. Think of it as storin’ a customer’s info once, then linkin’ orders to that single record. It keeps data consistent and avoids mess-ups.
- Denormalization: This is the flip side. You combine tables to make queries run faster, even if it means some duplicate data. It’s handy for stuff like reports where speed matters more than storage space.
When to Use ‘Em: Normalize when accuracy and updates are key. Denormalize when you need quick reads, like in analytics systems. Tell the interviewer you’d balance these based on the app’s needs.
3. What Are the Normal Forms (1NF, 2NF, 3NF, BCNF)?
Normalization comes in steps, called normal forms. Here’s the lowdown:
- 1NF (First Normal Form): Every piece of data gets its own cell. No lists or groups stuffed in one spot.
- 2NF (Second Normal Form): Data must depend on the whole primary key, not just part of it. If your key’s two fields, everything’s gotta relate to both.
- 3NF (Third Normal Form): Data should only depend on the key, nothin’ else. No sneaky dependencies.
- BCNF (Boyce-Codd Normal Form): A stricter 3NF, makin’ sure there’s no weird duplicate risks.
Why It Matters These rules stop data from gettin’ messy over time If you update a record, you don’t wanna miss spots ‘cause it’s repeated Explain it like keepin’ your desk organized—everything in its place.
4. What’s a Surrogate Key Versus a Natural Key?
- Surrogate Key: A made-up ID by the system, like a customer_id of 101. It’s simple, unique, and don’t mean nothin’ in the real world.
- Natural Key: Comes from real data, like an email or Social Security Number. It’s got business meanin’ but can be tricky if it changes.
Why Use Surrogate? They’re stable and make database links easier. Natural keys can shift or ain’t always unique. I’d tell an interviewer, “Surrogate keys are my go-to for performance and simplicity, ‘specially when natural ones are messy.”
5. Break Down Primary Key, Foreign Key, and Composite Key
Here’s a quick table to nail this question:
| Key Type | What It Is | Purpose | Example |
|---|---|---|---|
| Primary Key | Unique ID for each record in a table | Makes sure every record is identifiable | StudentID in a student table |
| Foreign Key | Field linkin’ to a primary key elsewhere | Connects tables, builds relationships | CourseID in enrollment table |
| Composite Key | Two or more columns makin’ a unique ID | Used when one column ain’t enough | StudentID + CourseID for enrollment |
How to Answer: Keep it short and sweet. “A primary key uniquely IDs a record, a foreign key connects tables, and a composite key uses multiple fields for uniqueness.” Add an example if they push for more.
6. What Are Entities, Attributes, and Relationships in an ER Diagram?
This one tests if you can design data visually.
- Entities: Things you store data about, like “Student” or “Course.” They’re rectangles in an ER diagram.
- Attributes: Details about entities, like a Student’s Name or ID. Shown as ovals.
- Relationships: How entities connect, like “Student enrolls in Course.” Diamonds in the diagram.
ER Diagram: It’s a visual map of your database, showin’ how everything links up. Tell ‘em, “It’s like a flowchart for data—helps everyone get on the same page before buildin’ the database.”
7. Star Schema Versus Snowflake Schema—What’s the Diff?
- Star Schema: One central fact table (like sales data) hooked to simple dimension tables (like product or date). It’s denormalized for fast queries, lookin’ like a star.
- Snowflake Schema: More complex, with dimension tables split into sub-tables to save space. It’s normalized, looks like a snowflake, but queries can be slower ‘cause of joins.
When to Use: Star for speed and simplicity; snowflake for big datasets where storage and accuracy rule. I’ve used star schemas a ton at TechMentor Hub for quick reporting dashboards.
8. Fact Table Versus Dimension Table?
| Feature | Fact Table | Dimension Table |
|---|---|---|
| Definition | Holds numerical data, like sales | Descriptive data, like product name |
| Function | Data to analyze | Context for facts |
| Location | Center of star/snowflake schema | Surrounds fact table |
| Example | Sales with quantity sold | Product with category |
Tip: Explain it as, “Facts are the ‘what’—the numbers we crunch. Dimensions are the ‘who’ or ‘where’—the background story.”
9. What Are Slowly Changin’ Dimensions (SCD)?
SCD handles data that changes over time, like a customer’s address. There’s different types:
- Type 1: Overwrite old data. No history kept.
- Type 2: Add new records for changes, keepin’ history.
- Type 3: Limited history with extra columns, like old and current address.
- And a few more, but these are the biggies.
Why It Matters: In data warehouses, trackin’ changes is huge for analysis. I’d say, “Type 2 is my fave for keepin’ full history, ‘specially for employee role shifts.”
Advanced Data Modelling Interview Questions for Pros
If you’ve got some experience under your belt, expect deeper questions to test your chops. Here’s what we’ve seen at TechMentor Hub for seasoned candidates.
10. What’s Data Granularity, and Why’s It Important?
Granularity is how detailed your data is. High granularity means tons of detail—like every single purchase with time and price. Low granularity is summarized, like monthly sales totals.
- Why It Matters: High detail lets you dig into patterns but eats storage. Low detail is easier to handle but less insightful. I’ve balanced this in projects by askin’, “Do we need every click, or just the big trends?”
Answer Tip: Show you get the trade-off. “Granularity impacts analysis depth and system performance. I’d choose based on the business goal—detailed for micro-trends, summarized for exec reports.”
11. How Does Data Sparsity Affect Performance?
Data sparsity is when your dataset’s got a lotta empty or zero values. Imagine a huge customer-product table where most folks bought nothin’—it’s sparse.
- Impact on Aggregation: Calculatin’ totals or averages gets slow ‘cause the system’s scannin’ tons of empty cells.
- Impact on Performance: Retrievin’ data drags since storage ain’t optimized for “nothin’” spaces.
How to Answer: “Sparsity can bog down queries and aggregations. I’d optimize by usin’ sparse matrix techniques or rethinkin’ the model to cut empty data.”
12. Explain Subtype and Supertype Entities
- Supertype: A broad entity with shared info, like “Customer” with basics like ID and Name.
- Subtype: Specific versions under it, like “Individual Customer” with extra details (say, SSN) or “Organization Customer” with company data.
Why Use ‘Em: Keeps models clean, avoids repeat data, and mirrors real-world categories. I’ve used this to organize messy client data into neat hierarchies.
13. Enterprise Data Model, Data Mart, or Data Warehouse?
- Enterprise Data Model: The big blueprint for all company data, definin’ how everything connects across systems.
- Data Warehouse: A giant storage hub for historical data from all over, used for analysis and reporting.
- Data Mart: A smaller slice of the warehouse, focused on one area like sales, for specific teams.
Answer Tip: “An enterprise model is the master plan. A warehouse holds all historical data, while a mart’s a targeted subset. I’ve built marts for quick marketing insights.”
14. OLTP Versus OLAP—Break It Down
- OLTP (Online Transaction Processing): Handles daily transactions fast—like online buys or ATM withdrawals. Normalized data for speed and accuracy.
- OLAP (Online Analytical Processing): For analyzin’ big historical data, like sales trends. Denormalized for fast, complex queries.
How to Answer: “OLTP’s for real-time transactions, optimized for updates. OLAP’s for deep analysis, built for read-heavy tasks. I’ve designed OLAP systems for yearly reports at my gig.”
Tips to Crush Your Data Modelling Interview
Alright, you’ve got the questions down, but how do ya seal the deal? Here’s some straight-up advice from us at TechMentor Hub.
- Practice, Practice, Practice: Go through these questions with a buddy or in front of a mirror. Sayin’ it out loud builds confidence.
- Draw It Out: If they ask about schemas or ER diagrams, sketch ‘em on a whiteboard or paper. Visuals show you think like a pro.
- Relate to Real Work: Even if you’re a fresher, tie answers to projects or coursework. For pros, mention specific wins—like optimizin’ a slow database.
- Admit What Ya Don’t Know: If you’re stumped, say, “I ain’t sure, but here’s how I’d figure it out.” Honesty plus problem-solvin’ wins points.
- Stay Chill: Interviews ain’t just about tech—they wanna see if you’re cool under pressure. Take a breath, think, then answer.
Common Pitfalls to Dodge
I’ve seen plenty of smart folks slip up, so let’s cover some traps.
- Overcomplicatin’ Answers: Keep it simple, specially for basic questions. Don’t ramble about advanced stuff unless asked.
- Forgettin’ the Business Side: Data modellin’ ain’t just tech—it’s about solvin’ business probs. Always tie your answer to how it helps the company.
- Not Askin’ Questions: At the end, ask somethin’ like, “What kinda data challenges is your team facin’?” It shows you care.
Bonus: Tools and Resources to Up Your Game
Wanna go deeper? We at TechMentor Hub swear by a few tricks to boost your skills.
- Play with Tools: Get hands-on with stuff like ERwin or MySQL Workbench. Buildin’ models yourself beats readin’ about ‘em.
- Join Communities: Hang out in online forums or local meetups. Swappin’ stories with other data nerds sharpens your thinkin’.
- Mock Interviews: Set up practice rounds with friends or mentors. Real-time feedback catches weak spots.
Wrappin’ It Up: You’ve Got This!
Data modellin’ interviews might seem intimidatin’, but with these questions and tips, you’re already ahead of the pack. Remember, it ain’t just about knowin’ the answers—it’s about showin’ you can think, adapt, and solve problems on the fly. At TechMentor Hub, we’ve watched countless folks turn prep into dream jobs, and I’m rootin’ for you to do the same. So, study up, stay confident, and go knock that interview outta the park. Drop a comment if you’ve got other questions or wanna share your journey—I’m all ears!

SCDs & History Tracking
21. What are Slowly Changing Dimensions (SCDs)? SCDs are dimension table design patterns that handle changes to attribute values over time. When a customer moves from New York to Chicago, do you overwrite the old address, keep both, or store a “previous” column? The answer depends on whether historical analysis needs the old value. The biggest mistake is defaulting to Type 1 (overwrite) everywhere because it is simpler — then six months later the business asks “what region was this customer in when they placed that order?” and the data is gone.
22. Explain SCD Type 1, Type 2, and Type 3. Type 1 overwrites the old value with the new one — no history is kept. Type 2 creates a new row for each change, using effective_date, end_date, and an is_current flag to track versions. Type 3 adds a “previous” column (e.g., previous_city) to store exactly one prior value. Type 2 is the default for most warehouses because it preserves full history, but it increases table size significantly — a customer who changes address 5 times generates 5 rows. In an interview, always mention the trade-off: Type 2 is more powerful but requires surrogate keys and careful JOIN logic using date ranges.
23. How do you implement SCD Type 2 in SQL? The standard approach uses a MERGE statement that compares incoming records against the current dimension rows. When a change is detected, you expire the old row (set end_date and is_current = false) and insert a new row with the updated values. Here is a simplified example:
In an interview, mention that production implementations also handle brand-new customers (not just changes) and use a hash of tracked columns to detect changes efficiently.
24. When would you use SCD Type 3 over Type 2? Type 3 is appropriate when you only need to track the most recent change for a specific attribute, not the full history. A classic example is an organizational restructuring where sales territories are reassigned — you want both the “current_territory” and “previous_territory” for a transition period comparison, but you do not need every territory the rep has ever belonged to. The limitation is that Type 3 scales poorly: if you need to track changes to 5 attributes, you suddenly have 10 extra columns. In an interview, say “Type 3 is rare in practice — I default to Type 2 unless storage or complexity is a hard constraint.”
25. What is a mini-dimension, and when do you use one? A mini-dimension extracts rapidly changing attributes from a large dimension into a separate, smaller table. If your dim_customer has 10 million rows and the loyalty_tier and credit_score_band columns change weekly, SCD Type 2 on the full dimension would explode row counts. Instead, you create a dim_customer_profile mini-dimension with just those volatile attributes and its own surrogate key. The fact table then has foreign keys to both dim_customer and dim_customer_profile. In an interview, this question separates candidates who have dealt with real-scale SCD problems from those who only know textbook definitions.
26. What is a bridge table, and how does it relate to SCDs? A bridge table resolves many-to-many relationships by sitting between a fact table and a dimension. In the context of SCDs, bridge tables become necessary when a dimension relationship itself changes over time. For example, a patient-to-doctor assignment is many-to-many and changes quarterly. The bridge table tracks which doctors are assigned to which patients at which point in time, using effective and end dates. In an interview, mention that bridge tables need a weighting factor column to prevent double-counting in aggregations.
27. How do you handle late-arriving dimensions? Late-arriving dimensions occur when a fact record arrives before the corresponding dimension record — for example, a transaction is recorded before the customer master data is loaded. The standard approach is to insert a placeholder row in the dimension table with a special surrogate key and default values, then update it when the real data arrives. If you are using SCD Type 2, the late-arriving data may need to be inserted with a backdated effective_date, not the current date. In an interview, this question tests whether you have dealt with real-world pipeline timing issues.
28. What is a Type 6 (hybrid) SCD? Type 6 combines Types 1, 2, and 3 (1+2+3=6). You maintain full history with Type 2 rows (effective/end dates), add a “current” column that is overwritten (Type 1) on every row for the same entity, and optionally include a “previous” column (Type 3). This lets analysts query with WHERE is_current = TRUE for the latest view or join on date ranges for the historical view, while the overwritten “current” column on all rows enables easy side-by-side comparison. In an interview, explaining Type 6 unprompted shows you have worked with complex analytical requirements.
29. What is a snowflake schema, and how does it differ from a star schema? A snowflake schema normalizes dimension tables into sub-dimensions. Instead of a flat dim_product with category_name and department_name baked in, you split those into dim_category and dim_department tables linked by foreign keys. This reduces storage by eliminating redundancy in dimensions but adds JOINs at query time. In most modern columnar warehouses (BigQuery, Snowflake, Redshift), storage is cheap and JOINs are expensive, so star schemas are preferred. In an interview, say “I default to star schema unless I have a specific reason to snowflake, such as a very large dimension with highly redundant hierarchical data.”
30. What is Data Vault modeling? Data Vault is a modeling methodology designed for auditability and flexibility. It uses three core table types: Hubs (business keys), Links (relationships between hubs), and Satellites (descriptive attributes with full history). Data Vault separates structure from content, making it highly resilient to source system changes. The trade-off is complexity — a simple star schema with 5 tables might become 15+ tables in Data Vault. In an interview, position Data Vault as ideal for the raw/vault layer of a warehouse, with star schemas built on top as the presentation layer.
31. What is a Hub, Link, and Satellite in Data Vault? A Hub stores the unique business key and its load metadata (load date, record source). A Link captures the relationship between two or more Hubs — it is essentially a many-to-many association table. A Satellite stores the descriptive attributes and change history for a Hub or Link, using effective dates. The key insight is that Hubs and Links rarely change (business keys and relationships are stable), while Satellites absorb all the volatility. In an interview, draw a quick example: Hub_Customer, Hub_Product, Link_Order (connecting them), Sat_Customer_Details, Sat_Order_Details.
32. What is a One Big Table (OBT) approach, and when is it appropriate? The OBT approach pre-joins all dimensions into a single wide, fully denormalized table. It is popular in modern analytics stacks where BI tools (Looker, Metabase) work best with a single source table and columnar storage makes wide tables cheap. The trade-off is update complexity — changing a customer attribute requires updating every row that references that customer. OBT works well for read-heavy dashboards with infrequent dimension changes. In an interview, say “OBT is a serving-layer optimization, not a replacement for proper modeling in the transformation layer.”
33. What is a junk dimension? A junk dimension collects miscellaneous low-cardinality flags and indicators that do not belong in any existing dimension. Instead of cluttering the fact table with columns like is_gift_wrapped, is_expedited, payment_method (3 possible values), you combine them into a single junk dimension with every possible combination. A junk dimension with 4 binary flags has at most 16 rows. In an interview, the key point is that junk dimensions keep the fact table clean and narrow, which matters at billions of rows.
34. What is a role-playing dimension? A role-playing dimension is a single physical dimension table used multiple times in the same fact table with different meanings. The classic example is dim_date appearing three times in a shipment fact: order_date_key, ship_date_key, and delivery_date_key. Each foreign key “plays a different role” but points to the same date dimension. In an interview, mention that you typically create views (dim_order_date, dim_ship_date) to make the model self-documenting for BI users.
35. What is a factless fact table used for coverage analysis? A coverage factless fact captures what could have happened rather than what did happen. For example, a retail chain loads a table of every product-store-date combination where a promotion was active. By left-joining this against the actual sales fact, you can find which promotions generated zero sales in certain stores — information you cannot derive from transaction data alone. In an interview, this is a strong answer because it shows you think about “absence of data” problems, which are common in business analysis.
36. How does the Activity Schema pattern work? The activity schema is a modern pattern where all user actions are stored in a single, narrow table with columns like entity_id, activity_type, timestamp, and a JSON feature column. Instead of building separate fact tables for clicks, signups, and purchases, everything goes into one stream. You then self-join this table to build customer journeys or funnel analyses. The trade-off is query complexity — self-joins on large activity tables can be expensive. In an interview, position it as useful for event-driven analytics products, not as a replacement for traditional dimensional modeling in a warehouse.
37. What is the difference between wide tables and normalized tables in a modern analytics stack? Wide tables pre-join data for read performance; normalized tables minimize redundancy for write integrity. In modern columnar engines, wide tables scan only the columns you request, so having 200 columns does not penalize a query that reads 5. However, wide tables are harder to maintain and reason about. The practical default: normalize in your transformation layer (dbt staging/intermediate models), then materialize wide tables as your final mart. In an interview, this framing shows you think in layers rather than absolutes.
38. How do you model semi-structured data (JSON, arrays) in a warehouse? Semi-structured data like JSON payloads should be flattened into typed columns during the transformation layer. Most warehouses (BigQuery, Snowflake) can query JSON natively, but relying on JSON access in production dashboards is fragile — schema changes in the source silently break downstream queries. The best practice is to extract known fields into columns and keep the raw JSON as a fallback. In an interview, mention that arrays should be unnested into separate rows with a cross join, and that this is where grain decisions become critical.
Core Concepts & Fundamentals
1. What is data modeling, and why does it matter for data engineers? Data modeling is the process of defining how data is structured, stored, and related across your system. Without it, you end up with a warehouse full of inconsistent tables where “revenue” means three different things depending on which team built the pipeline. In an interview, emphasize that modeling is not a one-time exercise — it evolves as business requirements change and new sources are onboarded. The best models balance query performance with maintainability. Read more in our guide on what is data modeling.
2. What is an ER diagram, and when would you use one? An Entity-Relationship diagram maps entities (tables), their attributes (columns), and the relationships between them (one-to-many, many-to-many). The biggest mistake engineers make is skipping the ER diagram and jumping straight to DDL statements — then discovering six weeks later that a missing relationship forces a costly migration. Use ER diagrams during the design phase to get stakeholder alignment before writing any code. In an interview, mention that ER diagrams are most valuable for OLTP systems where referential integrity is critical. See our full walkthrough on ER diagrams.
3. Explain the difference between conceptual, logical, and physical data models. A conceptual model defines the high-level entities and relationships — think “Customer places Order.” A logical model adds attributes, data types, and keys without worrying about a specific database engine. A physical model is the actual implementation: column types, indexes, partitioning strategies, and storage format. The common interview trap is treating these as purely academic layers. In practice, jumping from conceptual straight to physical is how you end up with a schema that nobody besides the original author can understand.
4. What is normalization? Walk through 1NF, 2NF, and 3NF. Normalization is the process of organizing data to reduce redundancy and enforce integrity. 1NF requires atomic column values and no repeating groups. 2NF eliminates partial dependencies — every non-key column must depend on the entire primary key, not just part of it. 3NF removes transitive dependencies — if column C depends on column B, which depends on the primary key A, then C should live in a separate table. In an interview, always pair the definition with a real example: “In a sales table, storing customer_name alongside customer_id violates 3NF because name depends on customer_id, not on the sale.”
5. When should you denormalize, and what are the risks? Denormalization is deliberate redundancy added to reduce the number of JOINs at query time. You should denormalize when read performance is critical and write frequency is low — classic data warehouse territory. The risk is data inconsistency: if a customers name changes, you now need to update it in every denormalized table or accept stale data. A good rule of thumb is to normalize your source-of-truth layer (staging/raw) and denormalize your serving layer (mart/presentation). In an interview, naming this layered strategy shows you understand trade-offs, not just definitions.
6. What is a primary key, and how does it differ from a surrogate key? A primary key uniquely identifies each row in a table. A natural primary key uses business data (like email or order_number), while a surrogate key is a system-generated identifier with no business meaning, typically an auto-incrementing integer or UUID. Surrogate keys are preferred in warehouses because natural keys change — companies merge, email addresses update, product SKUs get reassigned. In an interview, point out that surrogate keys also improve JOIN performance since integer comparisons are faster than string comparisons. Learn more about keys in dimensional modeling.
7. What is a foreign key, and why do some warehouses skip enforcing them? A foreign key creates a reference from one table to the primary key of another, enforcing referential integrity. Many modern cloud warehouses (BigQuery, Redshift, Snowflake) allow you to declare foreign keys but do not enforce them at write time because enforcement adds overhead to every INSERT and UPDATE. The keys still serve as documentation and can help the query optimizer generate better plans. In an interview, saying “we declare them for documentation but enforce integrity upstream in the pipeline” is the practical answer interviewers want.
8. What is a composite key, and when is it necessary? A composite key uses two or more columns together to uniquely identify a row. It is necessary when no single column is unique on its own — for example, an order_line_items table might use (order_id, line_number) as its composite key. The common pitfall is creating composite keys with too many columns (4+), which makes JOINs verbose and error-prone. In an interview, mention that most dimensional models avoid composite keys in dimension tables by using surrogate keys, but they appear naturally in fact tables as combinations of foreign keys.
9. What is the difference between a candidate key and an alternate key? A candidate key is any column (or set of columns) that could serve as the primary key — it is unique and not null. Once you pick one candidate key as the primary key, the remaining candidate keys become alternate keys. For example, in an employees table, both employee_id and social_security_number are candidate keys, but you would pick employee_id as primary and SSN becomes an alternate key. In an interview, this question tests whether you understand that primary key selection is a design choice, not a given.
10. What does “cardinality” mean in data modeling? Cardinality describes the numerical relationship between two entities: one-to-one, one-to-many, or many-to-many. Getting cardinality wrong is one of the most expensive modeling mistakes because it directly impacts your grain. If you model a one-to-many relationship as one-to-one, you will silently drop rows. If you model a one-to-one as many-to-many, you will introduce duplicates that inflate every aggregate. In an interview, always ask clarifying questions about cardinality before proposing a schema — it shows you think before you code.
The Easiest Way to Ace the Data Modeling Interview: A 3-Step Guide
0