← Pinterest Interview Insights
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.
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).
For each table, count TP, FP, TN, FN based on the positive class. Be systematic: iterate through rows or use vectorized operations if allowed.
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).
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.
Double-check calculations, especially for the matching table. Present the table identifier and show the computed metrics to justify your answer.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.