Back to questions

Patient Support Analysis (Part 3) UnitedHealth SQL Interview Question

Patient Support Analysis (Part 3)

UnitedHealth SQL Interview Question

UnitedHealth Group (UHG) has a program called Advocate4Me, which allows policy holders (or, members) to call an advocate and receive support for their health care needs – whether that's claims and benefits support, drug coverage, pre- and post-authorisation, medical records, emergency assistance, or member portal services.

Write a query to obtain the number of unique callers who made calls within a 7-day interval of their previous calls. If a caller made more than two calls within the 7-day period, count them only once.

If you like this question, try out Patient Support Analysis (Part 4)!

Table:

Column NameType
policy_holder_idinteger
case_idvarchar
call_categoryvarchar
call_datetimestamp
call_duration_secsinteger

Example Input:

policy_holder_idcase_idcall_categorycall_datecall_duration_secs
13894a08c6-82c6-49ed-84a0-b627752cdca7benefits01/11/2023 02:09:23794
137ee4e5f0-4924-47f7-8809-172bb59c6ef0provider network02/01/2023 18:41:03659
140b68aafa-6907-43c3-9dbd-a6c171cf5006claims assistance02/17/2023 10:03:27757
14c4660294-9443-4aba-b6d4-f39a9d5e5f00benefits02/21/2023 13:57:3136
1506545ac5-18f5-4ae8-9b1e-087c7dc8decamember portal01/08/2023 03:19:24973
159580a1ad-842a-482f-a05c-7e1c09b926b3provider network01/09/2023 01:33:06729

Example Output:

policy_holder_count
2

Explanation:

Policy holder IDs 14 and 15 each made two calls within a 7-day interval. For example, ID 14 made calls on 02/17/2023 and 02/21/2023, and ID 14 on 01/08/2023 and 01/09/2023 consecutively. Hence, the count of unique callers is two.

The dataset you are querying against may have different input & output - this is just an example!

Input

Output