Tag: Data Eng

  • MSD0124 Feature Leakage Detector

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0118 AML Transaction Monitoring

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0114 Hospital Readmission Prediction

    Design a system that predicts which discharged hospital patients will be readmitted within 30 days, so care teams can prioritize follow-up calls, home visits, and medication counseling for the highest-risk patients. Payers and care-delivery organizations such as UnitedHealth Group’s Optum run care-management programs of exactly this shape, and the Centers for Medicare & Medicaid Services penalizes hospitals with excess readmissions through its Hospital Readmissions Reduction Program.

    The budget covers intervention for only the top few percent. Ranking quality at the top of the list matters more than overall accuracy, and the model’s features must come only from data available at discharge time, since post-discharge information does not exist yet.

    How would you design this system? Cover label and leakage discipline (what counts as readmission, which features leak the intervention or post-discharge information), metric choice when only top-ranked patients get treatment (precision@k, uplift of targeted intervention versus blanket risk score), fairness and access (risk scores must not systematically under-serve populations with less data history), how model output plugs into the care-team workflow to actually change outcomes, and validation that the intervention, not just the prediction, works.

    Line-art scene: patients walk out of a hospital past a dashed line marking where data stops, a 30-day calendar sends some of them back to the hospital, and a question mark asks which ones two care-team nurses with a phone and a home-visit icon should reach with only 50 slots a day

    The Problem: a thousand patients leave every day, about 15% come back within 30 days, and the care team can reach only 50 of them, using only what is known at the moment of discharge.

    Answer

    The design is a discharge-time scoring service that feeds a capacity-limited care-team worklist. A calibrated gradient-boosted model scores each patient from features frozen at the discharge order, trained on a composite label of unplanned readmission or death within 30 days at any hospital. Slots are filled by expected readmissions prevented rather than raw risk, so the 50 daily interventions go to patients the program can actually help. Group-level calibration audits keep thin-history patients from being quietly pushed down the list. A standing randomized holdout at the top of the list measures whether the follow-up program, not just the model, changes outcomes.

    (1) Discharge-Time Cutoff: every feature is read as of the discharge order from a point-in-time store; final billing codes, late-signed notes, and anything after discharge are excluded by construction.
    (2) Composite Claims Label: unplanned 30-day readmission at any hospital or death, built from claims so returns to other hospitals count, with planned readmissions removed.
    (3) Capacity-Aware Ranking: the model is selected on precision@k at the 5% budget, and slots are filled by predicted uplift (risk times responsiveness), not risk alone.
    (4) Fairness Guardrails: calibration and recall@k are audited by race, payer, language, and data-history depth; sparse records get explicit missingness features instead of reading as healthy.
    (5) Workflow Integration: scores reach the EHR worklist before the patient leaves, tiered into home visit, nurse call, and pharmacist counseling, with reason codes that choose the intervention.
    (6) Randomized Holdout: 10% of top-ranked patients receive usual care, giving an unbiased estimate of prevented readmissions and clean training data for the uplift model.

    Readmission pipeline: EHR and claims data plus social-needs screens enter a point-in-time feature store guarded against late-coded and post-discharge fields; risk and uplift models feed a targeting policy with a 50-per-day cap and fairness audit; the care-team worklist splits into treated patients and a 10% holdout whose 30-day claims outcomes drive retraining

    Figure 1: One loop: features frozen at the discharge order feed risk and uplift models, a capacity-and-fairness policy fills 50 slots, and a randomized holdout with claims outcomes closes the loop.

    Clarify Before Designing:
    (1) Data Owner: is this a hospital with only its own EHR, or a payer like Optum that sees claims from every hospital? That decides whether readmissions elsewhere can be labeled at all.
    (2) Capacity And Menu: how many interventions per day, of which types (call, home visit, pharmacist), and what does each cost in staff time?
    (3) Label Definition: all-cause or unplanned only; do observation stays and ED returns count; how is death within 30 days handled?
    (4) Scoring Moment: must the score exist before the patient leaves (bedside medication counseling) or only by the next morning (phone calls)?
    (5) Existing Program: are patients already being targeted, which contaminates historical outcomes, and can we randomize a holdout within capacity?
    (6) Equity Constraints: which groups must be audited, and is race, language, and payer data available for auditing even if not used as features?


    Login to view more content
  • MSD0111 Review Authenticity Detection

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0109 Account Takeover Detection

    Design the account takeover detection system for a consumer platform with hundreds of millions of accounts. Attackers use credential-stuffing lists and phishing to log in with a user’s real password, so “correct credentials” is not proof of legitimate access. The system must decide in real time at login whether to allow, challenge (step-up auth), or block. After login, it must also decide whether suspicious account behavior (new device, changed payout address, unusual purchase) warrants a freeze.

    How would you design this system? Cover the login-time risk score (device fingerprint, IP/ASN reputation, velocity, impossible travel, typing/navigation behavioral signals versus credential correctness), step-up authentication as the middle path between false accept and false block, post-login behavioral monitoring for the window where credentials were right but the actor is wrong, false-positive cost (locking out a traveling user), and adversary adaptation as defenses deploy.

    Line-art scene: a traveling account owner, an attacker script with a leaked list of 10 million pairs, and a phisher with a fake login page all pass the same password check; a question mark asks who is typing, and a second question mark asks whether the session after login, with a new device, a changed payout address, and a 900-dollar gift-card order, still belongs to the owner

    The Problem: the owner, a credential-stuffing script, and a phisher all pass the same password check, so the platform must decide who is really typing at login and whether the session is still the owner’s afterward.

    Answer

    The design is a layered risk engine that treats a correct password as necessary but never sufficient. A cheap edge tier absorbs credential-stuffing bursts with velocity counters before any model runs. A calibrated gradient-boosted model then scores every password-correct login from possession and context signals. Those signals include device history, IP/ASN reputation, impossible travel, behavioral cadence, and whether the exact username and password pair sits in a breach corpus. Two cost-derived thresholds map the score to allow, challenge, or block, and because a challenge costs cents while a wrongful lockout costs a support ticket, step-up absorbs nearly all of the gray zone. A session monitor keeps scoring after login, since phished cookies and correct-password attackers do their damage in the minutes after the gate.

    (1) Credential Correctness Is One Feature: the score is built from what the attacker usually lacks (the owner’s device, network, location history, and typing rhythm) and not from the password check, which the attacker passes by construction.
    (2) Edge Velocity Tier: per-IP, per-ASN, per-fingerprint, and global failure-ratio counters drop or tarpit stuffing bursts so the model path only sees plausible logins.
    (3) Calibrated Score, Two Thresholds: a GBDT outputs a calibrated P(\text{ATO}), and thresholds derived from the costs of fraud, friction, and lockout split it into allow, challenge, and block.
    (4) Risk-Adaptive Step-Up: pick the challenge the attacker most likely cannot pass, preferring a known-device prompt or passkey over SMS, and never block on a single soft signal like geography.
    (5) Post-Login Session Monitor: re-score on every sensitive event (recovery change, payout change, high-value order), with step-up, cooling-off holds, and freezes that notify the owner on old channels.
    (6) Label Loop With Exploration: delayed labels from “this wasn’t me” reports and chargebacks retrain the model weekly, and a small exploration budget keeps blocked traffic from becoming a blind spot.

    Account takeover pipeline: a login request passes an edge tier that drops bot bursts, a risk model fed by a feature store, and a policy engine that routes to block, challenge, or allow; allowed sessions flow into a session monitor that can hold, step up, or freeze, and delayed labels feed weekly retraining of the risk model

    Figure 1: The edge tier drops stuffing bursts, the calibrated risk model and policy engine route each login to block, challenge, or allow, and allowed sessions stay under a session monitor whose outcomes become delayed labels for weekly retraining.

    Clarify Before Designing:
    (1) Traffic & Scale: how many login attempts per day, what share comes from already-known devices, and how large are credential-stuffing bursts at peak?
    (2) Latency Budget: how many milliseconds may the risk call add to the login path, and must post-login checks block a sensitive action synchronously?
    (3) Available Factors: what fraction of accounts has a verified phone, a signed-in trusted device, or a passkey? That decides which challenges exist at all.
    (4) What an Attacker Can Steal: stored cards, payouts, gift cards, or messaging reach? That sets the cost of a takeover and which post-login actions need holds.
    (5) Label Sources: do we receive “this wasn’t me” reports, recovery claims, and chargebacks, and with what delay?
    (6) Lockout Tolerance: what does a wrongful block cost in support load and churn, and is there a regulatory requirement such as strong customer authentication for payments?


    Login to view more content
  • MSD0107 Event Recommendation Attendance

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0106 Multi-Objective Shopping Ranking

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0095 LLM Judge Meta-Evaluation

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0081 Real-Time Payment Fraud

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0079 ML Data Flywheel

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.