KatInterview

Support Ticket Analytics: Root Causes, Refund Impact, Chatbot Test

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsab-testingcausal-inferencesql

Last updated

Join ticket, resolution and survey tables to find the worst complaint category, estimate a refund policy's causal effect from observational data, and design a chatbot A/B test.

Scenario

You are a data scientist on the customer-care analytics team of an online retailer. Three tables describe support tickets:

  1. complaints(complaint_id, user_id, category, timestamp): one row per ticket.
  2. resolutions(complaint_id, resolution_type, resolution_time_hours): how and how fast a ticket was closed.
  3. satisfaction_scores(user_id, complaint_id, csat_score): post-ticket survey result on a 1-5 scale.

Questions

  1. Finding the problem category. Determine which complaint category has the lowest average csat_score and which has the longest resolution_time_hours. Give the SQL or analytical approach, and explain how you would decide what to prioritize if the two metrics point at different categories.
  2. Estimating a policy's effect. The business is considering a "proactive refund" policy for certain categories (a refund issued before the customer asks). With only historical observational data, how would you estimate its causal effect on csat_score?
  3. Testing a new channel. Design an A/B test to learn whether a new AI-chatbot resolution path yields higher csat_score than human-only resolution. Address sample size and power.

Constraints

  • About 20% of tickets have no csat_score. Explain how you would handle the bias this introduces.
  • resolution_time_hours can contain extreme outliers because some long-standing claims are still open.

Example

If "Shipping" shows an average CSAT of 2.1 and an average resolution time of 48 hours, while "Product Quality" shows 3.5 and 12 hours, Shipping is the category to prioritize.

Edge cases to address

  • Tickets that are unresolved (null resolution_type).
  • Users who file several tickets in a short window (serial complainers).

Give a structured answer covering all three parts, with SQL where relevant.

Hints

Hint 1

Start from `complaints` and LEFT JOIN the other tables so open and unrated tickets are not silently dropped. Use medians and percentiles instead of means for resolution time, and treat the unresolved rate as its own metric.

Hint 2

For missing CSAT, first check whether missingness depends on observed variables (category, resolution time, unresolved status). If so, reweight responders by the inverse of their response probability, and run a best-case/worst-case bound as a sensitivity check.

Hint 3

For the refund question, the core problem is selection: agents refund the high-value or most severe cases. Think propensity scores with overlap and balance checks, then stronger designs such as agent-leniency instruments, difference-in-differences, or a threshold-based regression discontinuity.

Hint 4

For the A/B test, randomize by user rather than ticket, analyze by intent-to-treat, include guardrails such as response rate, escalations and cost, and compute sample size from the standard deviation and the minimum detectable effect.