PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Thumbtack

Implement min, mean, median robustly

Last updated: Mar 29, 2026

Quick Overview

This question evaluates implementation skills in basic descriptive statistics (min, mean, median), numerical stability in online aggregation methods, robust handling of edge cases like None/NaN and extreme numeric ranges, and algorithmic complexity reasoning in the Coding & Algorithms domain for a Data Scientist role.

  • Medium
  • Thumbtack
  • Coding & Algorithms
  • Data Scientist

Implement min, mean, median robustly

Company: Thumbtack

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Implement three functions in Python without using numpy/pandas: (1) my_min(nums) returning the minimum in O(n) time and O(1) space; (2) my_mean(nums) using a numerically stable online method (e.g., Kahan or Welford) and explaining why naive summation can be inaccurate; (3) my_median(nums) for both odd and even lengths. First provide an O(n log n) solution using sorting, then implement an O(n) expected-time solution using quickselect; discuss behavior for empty lists, presence of None/NaN, and very large integers/floats; analyze time/space complexity and worst-case pitfalls.

Quick Answer: This question evaluates implementation skills in basic descriptive statistics (min, mean, median), numerical stability in online aggregation methods, robust handling of edge cases like None/NaN and extreme numeric ranges, and algorithmic complexity reasoning in the Coding & Algorithms domain for a Data Scientist role.

Related Interview Questions

  • Design streaming new-vs-returning monthly metrics - Thumbtack (hard)
  • Implement TF–IDF with sparse matrices - Thumbtack (medium)
Thumbtack logo
Thumbtack
Oct 13, 2025, 9:49 PM
Data Scientist
Onsite
Coding & Algorithms
2
0

Implement three functions in Python without using numpy/pandas: (1) my_min(nums) returning the minimum in O(n) time and O(1) space; (2) my_mean(nums) using a numerically stable online method (e.g., Kahan or Welford) and explaining why naive summation can be inaccurate; (3) my_median(nums) for both odd and even lengths. First provide an O(n log n) solution using sorting, then implement an O(n) expected-time solution using quickselect; discuss behavior for empty lists, presence of None/NaN, and very large integers/floats; analyze time/space complexity and worst-case pitfalls.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Thumbtack•More Data Scientist•Thumbtack Data Scientist•Thumbtack Coding & Algorithms•Data Scientist Coding & Algorithms
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.