Calculate 95% Bootstrap Confidence Interval for Order Values
PinterestData Scientist · OnsiteLast 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.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.