Loading...

The Spread

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
mid

Problem

Our A/B testing framework computes statistical significance without external libraries. Write a function called sample_variance that takes a list of numbers and returns the sample variance (dividing by n-1), rounded to 2 decimal places. Return 0.0 for lists with fewer than 2 elements.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.