Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Mode Calculation

PySpark data engineering interview problem. Difficulty: intermediate. Pattern: Aggregation. About 16 minutes. Part of the Pro drill bank.

Most frequent amount value. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Return one row with mode_amount equal to the most frequent amount (ties → smaller amount). Assign result.

Constraints

  • One output row.
  • Break ties with smaller amount.

Examples

Input: repeated amounts Output: mode_amount 10.0 10 appears three times.

Topics: lakebench, pyspark, mode, groupBy.

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

intermediate

Mode Calculation

Interview-style drill: Most frequent amount value.

Return one row with `mode_amount` equal to the most frequent `amount` (ties → smaller amount). Assign `result`.