PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Statistics & Math/Intuit

Calculate Precision, Recall, and F1

Last updated: Apr 2, 2026

Quick Overview

This question evaluates understanding of binary classification evaluation metrics (precision, recall, F1) and the ability to compute confusion matrix counts from actual and predicted labels, situated in the Statistics & Math domain for Data Scientist roles.

  • medium
  • Intuit
  • Statistics & Math
  • Data Scientist

Calculate Precision, Recall, and F1

Company: Intuit

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

You are given a list of binary classification outputs such as `[{"actual": 1, "predicted": 0, "confidence": 0.93}, ...]`, where class `1` is the positive class. Using the provided `actual` and `predicted` labels, write Python or pseudocode to compute the confusion-matrix counts (`TP`, `FP`, `TN`, `FN`) and then calculate: - `precision = TP / (TP + FP)` - `recall = TP / (TP + FN)` - `F1 = 2 * precision * recall / (precision + recall)` If the interviewer instead asks you to derive `predicted` from `confidence`, assume a decision threshold and explain how the metrics change when the threshold changes. Also describe how you would handle edge cases such as no predicted positives or no actual positives.

Quick Answer: This question evaluates understanding of binary classification evaluation metrics (precision, recall, F1) and the ability to compute confusion matrix counts from actual and predicted labels, situated in the Statistics & Math domain for Data Scientist roles.

Related Interview Questions

  • Compute Precision, Recall, and F1 - Intuit (medium)
  • Choose the right test for proportions - Intuit (hard)
Intuit logo
Intuit
Feb 10, 2026, 12:00 AM
Data Scientist
Technical Screen
Statistics & Math
3
0

You are given a list of binary classification outputs such as [{"actual": 1, "predicted": 0, "confidence": 0.93}, ...], where class 1 is the positive class. Using the provided actual and predicted labels, write Python or pseudocode to compute the confusion-matrix counts (TP, FP, TN, FN) and then calculate:

  • precision = TP / (TP + FP)
  • recall = TP / (TP + FN)
  • F1 = 2 * precision * recall / (precision + recall)

If the interviewer instead asks you to derive predicted from confidence, assume a decision threshold and explain how the metrics change when the threshold changes. Also describe how you would handle edge cases such as no predicted positives or no actual positives.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More Intuit•More Data Scientist•Intuit Data Scientist•Intuit Statistics & Math•Data Scientist Statistics & Math
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.