This question evaluates temporal data handling, record consolidation, and merging of baseline and event-driven records using SQL/Python to determine current entity state from historical actions.
You have two tables describing LinkedIn members’ push notification settings.
status — each member’s latest setting as of 2020-01-31
member_id
INT (PK)
status
VARCHAR — values:
'on'
or
'off'
actions — all setting change actions during Feb 2020
member_id
INT
date_sk
DATE
action
VARCHAR — values:
'turn_on'
or
'turn_off'
Assumptions:
actions
may include
new members not present
in
status
(e.g., a member created after 2020-01-31).
Return each member’s current notification status as of 2020-02-29.
status
value from 2020-01-31.
Output:
member_id
current_status
How would you handle it if the actions table did not have date_sk (i.e., you had no reliable way to order actions)? Specify what additional data/assumptions are required to make the problem solvable.