CVS Health Data Manipulation (SQL/Python) Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Calculate Medical Claims by Age and Gender in 2024
MEMBERSHIP +----+----------+--------+---------+ | id | age_band | gender | zipcode | +----+----------+--------+---------+ | 1 | 18-25 | F | 9...
Create and query an e-commerce schema
PostgreSQL only. 1) Create these tables with appropriate types and constraints (choose minimal correct types): products(product_id PK, name NOT NULL, ...
Aggregate radiology spend and derive fiscal month
Using Python/pandas, complete the tasks below. Assume the following CSV-like input, where service_dt is object dtype and amounts may be negative (adju...
Compute age-band spend and YoY in Georgia
Using ANSI SQL only, answer the three parts below on the following schema and samples. Assume dates are YYYY-MM-DD, paid_amt can be negative (adjustme...
Calculate annual percentages and YoY by cohorts
Answer both SQL and Python parts. Be precise about deduping and denominator choices. SQL schema (sample rows): orders order_id | user_id | order_date ...
Use pandas to aggregate, pivot, and label
Given two pandas DataFrames, write code to: (1) merge and aggregate revenue; (2) produce a 2x2 pivot; (3) compute per-state counts with value_counts, ...
Write SQL for dedup and purchase shares
You are given two tables with intentional duplicates. Write SQL to: (a) identify duplicate user_ids and produce a canonical, deduplicated users set; (...
Create Views, Insert, and Update Correctly
Treat “today” as 2025-09-01. Use the schema and sample data below to write SQL for each part. Schema: customers(cust_id INT PRIMARY KEY, name TEXT, re...