Katkat

Calculate 95% Bootstrap Confidence Interval for Order Values

PinterestData Scientist · Onsite

Last updated

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.

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.