Compute Variance from a Python List
Company: PayPal
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Technical Screen
Quick Answer: This question evaluates understanding of basic statistical concepts and numerical computation—specifically population versus sample variance—and tests algorithmic implementation skills, edge-case handling, and complexity reasoning within the Coding & Algorithms domain.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([1,2,3],)
Expected Output: 0.666667
Explanation: Population variance.
Input: ([5,5,5],)
Expected Output: 0.0
Explanation: Zero variance.
Input: ([],)
Expected Output: None
Explanation: Empty list.
Hints
- Model object-style prompts as arrays or operation streams when needed.
- Handle empty and boundary cases before the main logic.