Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Even totals from a mixed order list

Python data engineering interview problem. Difficulty: beginner. Pattern: Sorting. About 10 minutes. Part of the Pro drill bank.

A payments file mixes even and odd integer totals because of a legacy cents encoding. A recon job should keep only the even totals for one ledger.

Return the even numbers from a mixed list of order totals.

Requirements

  • Keep original order of the even values.
  • Odd values are dropped, not rewritten.

Constraints

  • totals: list of integers.
  • Zero is even.
  • The list may contain negatives.

Examples

Input: even_totals([1, 2, 3, 4]) Output: [2, 4] This input follows the stated rules and produces this output.

Topics: lakebench, python, comprehensions.

More Python interview questions · All interview problems · Learn data engineering

beginner

Even totals from a mixed order list

Interview-style drill: Return the order totals that are even numbers, using a single expression.

Return the even numbers from a mixed list of order totals.