Find Users With More Than 10 Errors on Each of Three Days

Quick Overview

Given three days of user error log pairs, sum each user's errors per day and return, in ascending order, the users whose daily total is above 10 on all three days. It tests hash map aggregation, set intersection, and careful handling of a strict threshold and of users missing from a day.

Find Users With More Than 10 Errors on Each of Three Days

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Other

You are given streaming log data across three days. Each day's data is represented as a list of `[UserID, ErrorCount]` pairs, where each pair indicates that a particular user generated a certain number of error logs. A user may appear multiple times within a single day's data. In that case, their error counts for that day should be summed. Return a sorted list (in ascending order) of all `UserID`s who generated more than 10 total error logs on each of the three days. ### Function Signature ```python def log_stream_processing(day1: list[list[int]], day2: list[list[int]], day3: list[list[int]]) -> list[int]: ``` ### Rules - Each day is a list of `[user_id, error_count]` pairs. A user's total for a day is the sum of all their pairs in that day's list. - A user who does not appear in a day's list has 0 errors that day. - "More than 10" is strict: a daily total of exactly 10 does not qualify. - Each qualifying user ID appears once in the result, and the result is sorted ascending. Return an empty list when no user qualifies. ### Constraints - `1 <= len(day1), len(day2), len(day3) <= 10^4` - `1 <= UserID <= 10^6` - `0 <= ErrorCount <= 10^5` - A user may appear multiple times in a single day's data; their error counts should be summed. ### Examples ```text Input: day1 = [[1,15],[2,5],[3,20],[4,11]], day2 = [[1,12],[2,11],[3,15],[4,12]], day3 = [[1,11],[2,9],[3,25],[4,11]] Output: [1,3,4] ``` User 1 has 15, 12 and 11 errors, user 3 has 20, 15 and 25, and user 4 has 11, 12 and 11, all above 10. User 2 has 5, 11 and 9, so it fails on day 1 and day 3. ```text Input: day1 = [[1,5],[1,8],[2,20]], day2 = [[1,15],[2,3],[2,3]], day3 = [[1,11],[2,11]] Output: [1] ``` User 1 totals 5 + 8 = 13 on day 1, then 15 and 11, so it qualifies. User 2 totals 20 on day 1 but only 3 + 3 = 6 on day 2, so it fails. ```text Input: day1 = [[7,10],[8,11]], day2 = [[7,20],[8,11]], day3 = [[7,20],[8,11],[9,50]] Output: [8] ``` User 7 has exactly 10 errors on day 1, which is not more than 10. User 9 appears only on day 3, so its total on days 1 and 2 is 0. User 8 has 11 errors on every day.

Overview: Given three days of user error log pairs, sum each user's errors per day and return, in ascending order, the users whose daily total is above 10 on all three days. It tests hash map aggregation, set intersection, and careful handling of a strict threshold and of users missing from a day.

NVIDIA logo
NVIDIA
Nov 25, 2026
easySoftware EngineerOtherCoding & Algorithms
0
0

You are given streaming log data across three days. Each day's data is represented as a list of [UserID, ErrorCount] pairs, where each pair indicates that a particular user generated a certain number of error logs.

A user may appear multiple times within a single day's data. In that case, their error counts for that day should be summed.

Return a sorted list (in ascending order) of all UserIDs who generated more than 10 total error logs on each of the three days.

Function Signature

def log_stream_processing(day1: list[list[int]], day2: list[list[int]], day3: list[list[int]]) -> list[int]:

Rules

  • Each day is a list of [user_id, error_count] pairs. A user's total for a day is the sum of all their pairs in that day's list.
  • A user who does not appear in a day's list has 0 errors that day.
  • "More than 10" is strict: a daily total of exactly 10 does not qualify.
  • Each qualifying user ID appears once in the result, and the result is sorted ascending. Return an empty list when no user qualifies.

Constraints

  • 1 <= len(day1), len(day2), len(day3) <= 10^4
  • 1 <= UserID <= 10^6
  • 0 <= ErrorCount <= 10^5
  • A user may appear multiple times in a single day's data; their error counts should be summed.

Examples

Input: day1 = [[1,15],[2,5],[3,20],[4,11]], day2 = [[1,12],[2,11],[3,15],[4,12]], day3 = [[1,11],[2,9],[3,25],[4,11]]
Output: [1,3,4]

User 1 has 15, 12 and 11 errors, user 3 has 20, 15 and 25, and user 4 has 11, 12 and 11, all above 10. User 2 has 5, 11 and 9, so it fails on day 1 and day 3.

Input: day1 = [[1,5],[1,8],[2,20]], day2 = [[1,15],[2,3],[2,3]], day3 = [[1,11],[2,11]]
Output: [1]

User 1 totals 5 + 8 = 13 on day 1, then 15 and 11, so it qualifies. User 2 totals 20 on day 1 but only 3 + 3 = 6 on day 2, so it fails.

Input: day1 = [[7,10],[8,11]], day2 = [[7,20],[8,11]], day3 = [[7,20],[8,11],[9,50]]
Output: [8]

User 7 has exactly 10 errors on day 1, which is not more than 10. User 9 appears only on day 3, so its total on days 1 and 2 is 0. User 8 has 11 errors on every day.