Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Modeling for Complex Requirements
00:00
5 left

Modeling for Complex Requirements

HardSQL · PostgreSQL

Problem

Can you explain how you would build a data model or Entity Relationship Diagram to support a complex business requirement?

Use the provided relational model to demonstrate how requirements, entities, and relationships can be represented and validated. Include requirements without entities and entities without relationships in the result.

Output

  1. One row per business requirement and associated entity, including requirements with no entity.
  2. Columns: requirement_name, entity_name, relationship_count, and relationship_status.
  3. Sort by requirement identifier, then entity identifier, with missing entities last.

Schema

business_requirements
ColumnTypeDescription
requirement_idPKINTUnique identifier for a business requirement
requirement_nameVARCHAR(150)Name of the business requirement
owner_teamVARCHAR(100)Team responsible for the requirement
statusVARCHAR(30)Current lifecycle status
data_entities
ColumnTypeDescription
entity_idPKINTUnique identifier for a data entity
requirement_idINTRequirement supported by the entity
entity_nameVARCHAR(100)Name of the modeled entity
entity_typeVARCHAR(40)Classification of the entity
entity_relationships
ColumnTypeDescription
relationship_idPKINTUnique identifier for an entity relationship
requirement_idINTRequirement containing the relationship
source_entity_idINTEntity from which the relationship originates
target_entity_idINTEntity referenced by the relationship
relationship_typeVARCHAR(50)Business meaning of the relationship
cardinalityVARCHAR(20)Expected relationship cardinality
Tablesbusiness_requirementsdata_entitiesentity_relationships
Interviewer

Your question is Modeling for Complex Requirements. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.