PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Airwallex

Implement bootstrap mean and variance

Last updated: Apr 11, 2026

Quick Overview

This question evaluates the ability to implement bootstrap resampling and compute descriptive statistics, testing competency in statistical estimation, numerical stability, edge-case handling, and algorithmic implementation.

  • medium
  • Airwallex
  • Coding & Algorithms
  • Data Scientist

Implement bootstrap mean and variance

Company: Airwallex

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are given an array of `N` numeric observations `x[0..N-1]`. Write a function that uses bootstrap resampling to estimate: 1. the mean of the original sample, 2. the average of the bootstrap replicate means, and 3. the variance of the bootstrap replicate means. Assume the function also receives an integer `B`, the number of bootstrap replicates. For each replicate: - sample `N` values with replacement from the original array, - compute the replicate mean, - store that mean. Return at least these outputs: - `original_mean` - `bootstrap_mean` - `bootstrap_variance` Also explain how you would handle edge cases such as `N = 0`, `B <= 0`, repeated values, and numeric stability. State the expected time and space complexity.

Quick Answer: This question evaluates the ability to implement bootstrap resampling and compute descriptive statistics, testing competency in statistical estimation, numerical stability, edge-case handling, and algorithmic implementation.

Related Interview Questions

  • Implement bootstrap mean and variance - Airwallex (medium)
Airwallex logo
Airwallex
Oct 24, 2025, 12:00 AM
Data Scientist
Onsite
Coding & Algorithms
3
0
Loading...

You are given an array of N numeric observations x[0..N-1]. Write a function that uses bootstrap resampling to estimate:

  1. the mean of the original sample,
  2. the average of the bootstrap replicate means, and
  3. the variance of the bootstrap replicate means.

Assume the function also receives an integer B, the number of bootstrap replicates. For each replicate:

  • sample N values with replacement from the original array,
  • compute the replicate mean,
  • store that mean.

Return at least these outputs:

  • original_mean
  • bootstrap_mean
  • bootstrap_variance

Also explain how you would handle edge cases such as N = 0, B <= 0, repeated values, and numeric stability. State the expected time and space complexity.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Airwallex•More Data Scientist•Airwallex Data Scientist•Airwallex Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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.