PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Statistics & Math/Snapchat

Calculate Posterior Probability Using Bayes' Theorem Example

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of Bayes' theorem and probabilistic reasoning for computing posterior probabilities in binary classification, emphasizing priors, likelihoods, and conditional probability.

  • easy
  • Snapchat
  • Statistics & Math
  • Data Scientist

Calculate Posterior Probability Using Bayes' Theorem Example

Company: Snapchat

Role: Data Scientist

Category: Statistics & Math

Difficulty: easy

Interview Round: Technical Screen

##### Scenario Interviewers want to test your understanding of Bayes’ theorem using a straightforward numerical example (e.g., medical-test or spam-detection toy problem). ##### Question Walk through a complete Bayes-theorem calculation: 1) clearly define prior P(H) and likelihoods P(E|H), P(E|¬H); 2) write the full formula; 3) compute the posterior P(H|E) and report the final numeric answer. ##### Hints State assumptions, show every step, then simplify to one decimal/fraction.

Quick Answer: This question evaluates understanding of Bayes' theorem and probabilistic reasoning for computing posterior probabilities in binary classification, emphasizing priors, likelihoods, and conditional probability.

Related Interview Questions

  • Compute posterior spam risk from flags - Snapchat (Medium)
  • Derive logistic regression and thresholds - Snapchat (hard)
  • Explain median vs mean for L1/L2 - Snapchat (medium)
  • Compute expectations and test fairness for coin flips - Snapchat (easy)
  • How to Update Bayesian Model for Concept Drift? - Snapchat (medium)
Snapchat logo
Snapchat
Jul 12, 2025, 6:59 PM
Data Scientist
Technical Screen
Statistics & Math
26
0

Bayes' Theorem Toy Problem: Spam-Flag Example

Context

You are evaluating a simple classifier that flags messages as spam. Based on historical data, you know the spam rate and the classifier’s performance (true positive and false positive rates). Compute the probability that a message is truly spam given it was flagged.

Assume:

  • Prior spam rate: 2% of all messages are spam.
  • If a message is spam, the classifier flags it 90% of the time.
  • If a message is not spam, the classifier still flags it 5% of the time (false positive).

Task

Walk through a complete Bayes-theorem calculation:

  1. Clearly define the prior P(H) and likelihoods P(E|H), P(E|¬H).
  2. Write the full formula.
  3. Compute the posterior P(H|E) and report the final numeric answer.

Show every step, state assumptions, and simplify the final answer to a clear fraction and a one-decimal percentage.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More Snapchat•More Data Scientist•Snapchat Data Scientist•Snapchat 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.