Square · Primly Community

Square data scientist interview (SQL + case + stats), breakdown from my recent loop

ds_dmitri · 4 replies

Did the Square DS interview process a couple months ago for a mid-senior DS role on their risk team. Here's the actual breakdown.

OA: Two parts. SQL problems (3 of them, timed, real SQL not pseudocode). The queries weren't trivial: window functions, a self-join, one problem with CTEs. If you're rusty on window functions practice those specifically. The second part was probability/stats questions -- multiple choice and short answer. Topics: conditional probability, expected value, hypothesis testing setup (null/alternative, p-value interpretation), confidence intervals. Nothing advanced stats, but it was faster-paced than I expected.

Phone screen: Stat concept + case. The stat concept question was about A/B testing -- specifically, when should you stop an experiment early and what are the risks? Good answers cover peeking problems, alpha inflation, sequential testing as an alternative. The case was open-ended: "Square launches a new seller feature, describe how you'd measure its success." I went through instrumentation, North Star metric, guardrail metrics, segmentation. About 45 minutes total.

Onsite (4 rounds): SQL deep dive. More complex than the OA. One problem was about joining transaction and refund tables to find merchants with unusually high refund rates. Real-world-ish. ML/modeling round. They asked about a fraud detection use case. Walk me through how you'd build a model: data sources, features, modeling approach, how do you handle class imbalance, how do you evaluate it. I talked through precision/recall tradeoffs for fraud (you care more about recall, false negatives are worse than false positives in most fraud contexts). Case study. Given a hypothetical dataset summary, what's going wrong with our payment completion rate? Pure business problem, data-driven reasoning. Behavioral. Standard STAR. "Tell me about a time your analysis changed a business decision."

SQL and stats are both tested multiple times. Don't neglect either. My advice: practice SQL in HackerRank or Mode, and make sure you can talk through experiment design out loud without needing to write anything down.

4 replies

analyst_ana

The window functions point is so real. I prepped mostly with basic SELECT/JOIN queries and got humbled on my first DS OA when they asked for a rolling 7-day sum partitioned by merchant. Lead/Lag functions too. Add those to the prep list.

ml_mike

The class imbalance answer in fraud detection is basically a litmus test. Candidates who default to accuracy as their metric for a 1:1000 fraud:legit ratio get filtered fast. Precision/recall, AUROC, maybe cost-sensitive learning. Know why you're choosing which metric.

mobile_mara

Exactly. And they asked me to compare AUROC vs AUPRC for fraud. AUPRC is more informative when the positive class is rare -- this is a detail that signals you've actually thought about imbalanced datasets in production.

sre_sol

Did the SQL round have any performance questions? Like, explaining query plans or when to use indexes? Or was it purely about writing correct queries?