Calculate 95% Bootstrap Confidence Interval for Order Values

Quick Overview

This question evaluates a data scientist's competence in statistical inference using bootstrap resampling, proficiency with numerical computing for large sample operations, and attention to performance optimization.

Calculate 95% Bootstrap Confidence Interval for Order Values

Company: Pinterest

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

##### Scenario An e-commerce firm wants a 95% confidence interval for the average order value but only has a single historical sample of order amounts. ##### Question Given an array of past order values, write efficient Python code to return the 95% bootstrap confidence interval using 10,000 resamples. Explain your approach and any performance optimizations. ##### Hints Use vectorized resampling (np.random.choice) and percentile bounds; avoid Python loops.

Quick Answer: This question evaluates a data scientist's competence in statistical inference using bootstrap resampling, proficiency with numerical computing for large sample operations, and attention to performance optimization.

|Home/Coding & Algorithms/Pinterest
Pinterest logo
Pinterest
Aug 4, 2025, 10:55 AM
mediumData ScientistOnsiteCoding & Algorithms
28
0
Scenario

An e-commerce firm wants a 95% confidence interval for the average order value but only has a single historical sample of order amounts.

Question

Given an array of past order values, write efficient Python code to return the 95% bootstrap confidence interval using 10,000 resamples. Explain your approach and any performance optimizations.

Hints

Use vectorized resampling (np.random.choice) and percentile bounds; avoid Python loops.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...