Python data engineering interview problem. Difficulty: intermediate. Pattern: Stacks. About 14 minutes. Part of the Pro drill bank.
Days until a warmer temperature for each day. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement daily_temperatures(temperatures: list) -> list.
Input: daily_temperatures([73, 74, 75, 71, 69, 72, 76, 73]) Output: [1, 1, 4, 2, 1, 1, 0, 0] Next warmer offsets.
Topics: lakebench, python, monotonic stack, next greater.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Days until a warmer temperature for each day.
Implement `daily_temperatures(temperatures: list) -> list`. Example: `[73, 74, 75, 71, 69, 72, 76, 73]` → `[1, 1, 4, 2, 1, 1, 0, 0]`. Keep the harness.