Design logical model and consumption
Company: EY
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Technical Screen
Overview: This question evaluates understanding of logical data modeling, ERD-level design with keys and cardinalities, slowly changing dimensions, normalization versus denormalization trade-offs, and strategies for exposing curated datasets and read paths for analytics and regulatory consumers, indicating competency in data modeling and data delivery.
Tables
customers_dim(customer_sk INT, customer_id INT, customer_name VARCHAR(100), risk_segment VARCHAR(20), is_active CHAR(1), effective_from DATE, effective_to DATE, current_flag CHAR(1))
accounts(account_id INT, customer_id INT, account_type VARCHAR(20), opened_date DATE, closed_date DATE)
trades(trade_id INT, account_id INT, trade_date DATE, instrument VARCHAR(20), quantity INT, price DECIMAL(18,2), side VARCHAR(4))
positions(position_id INT, account_id INT, instrument VARCHAR(20), position_date DATE, quantity INT)
limits(limit_id INT, account_id INT, limit_type VARCHAR(50), limit_value DECIMAL(18,2), currency VARCHAR(3), effective_from DATE, effective_to DATE)
Hints
- To get the correct customer version, join customers_dim on customer_id and ensure trade_date falls between effective_from and effective_to.
- Join positions and limits on account_id (and instrument/date for positions), then compute position_notional and breach_flag with a CASE expression.