Quick Overview

Write a function that returns the arithmetic mean of a list of integers and returns 0 for an empty list. A warm-up from a timed data science assessment that tests careful handling of the empty case and floating-point division.

Average of a List of Integers, Returning 0 for an Empty List

Company: Waymo

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Write a function that returns the arithmetic mean of a list of integers and returns 0 for an empty list. A warm-up from a timed data science assessment that tests careful handling of the empty case and floating-point division.

Loading…