← Pinterest Interview Insights

Pinterest·Machine Learning Engineer·Online Assessment (OA)·Intermediate

Intermediate
Jun 2026

Summary

Pinterest ML engineer interview with a multiple choice section on ML fundamentals. Pretty calculation-heavy, centered on confusion matrix metrics and knowing your way around TPR/FPR.

Questions Asked (1)

Q1

You are given several data tables and asked to identify which one satisfies a specified combination of true positive rate and false positive rate. Calculate confusion matrix metrics to find the match.

Product Analytics & MetricsAlgorithms & Data Structures
Author's notes

Took longer than it should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the exact TPR and FPR targets and the definition of positive class. For each table, compute the confusion matrix (TP, FP, TN, FN) and then calculate TPR = TP/(TP+FN) and FPR = FP/(FP+TN), comparing to the specified values. Identify the table that matches both metrics within any stated tolerance.

Pro tip: Always confirm whether the rates are given as percentages or decimals, and whether there's a tolerance for floating-point comparison. Also, mention that you'd double-check by computing precision or accuracy as a sanity check, but focus on TPR and FPR as requested.

1. Clarify requirements and definitions

Confirm the target TPR and FPR values, the positive class label, and any tolerance for matching. Ensure you understand the table structure (e.g., columns for actual and predicted labels).

2. Compute confusion matrix for each table

For each table, count TP, FP, TN, FN based on the positive class. Be systematic: iterate through rows or use vectorized operations if allowed.

3. Calculate TPR and FPR

Compute TPR = TP / (TP + FN) and FPR = FP / (FP + TN). Handle division by zero if any denominator is zero (e.g., no actual positives or negatives).

4. Compare and identify matching table

Compare each table's TPR and FPR to the targets. If multiple match, check for additional constraints or report all. If none match exactly, consider rounding or tolerance.

5. Verify and present answer

Double-check calculations, especially for the matching table. Present the table identifier and show the computed metrics to justify your answer.

Key Points to Mention

  • Definition of TPR (sensitivity/recall) and FPR (fall-out) and their formulas.
  • How to construct a confusion matrix from raw data (TP, FP, TN, FN).
  • Handling edge cases like zero denominators or imbalanced classes.
  • The importance of specifying the positive class and any tolerance for matching.
  • Potential pitfalls: mislabeling positives/negatives, floating-point precision, and confusing TPR with precision.
  • Efficiency considerations if tables are large (e.g., using vectorized operations or SQL aggregations).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.