FastPrepValidate Server Log Summary Counts
Problems/Validate Server Log Summary Counts

Validate Server Log Summary Counts

Google logoGoogle● MediumINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the raw log fields and the goal of counting actions for each user. It does not give the summary format or the output order. Our version is about 91% the same as the reported question.

A server log is represented by logs. Each row is [timestamp, userId, action]. The rows are unordered, and repeated rows are separate events.

An analytics service returns summary, where each row is [userId, action, reportedCount]. Each user-action pair appears at most once in summary.

Return every incorrect pair as [userId, action, rawCount, reportedCount], where rawCount is computed from logs. A pair missing from either input has count 0. Sort the returned rows by userId, then by action. Return an empty array when the summary is completely correct.

Function

findLogSummaryDifferences(logs: String[][], summary: String[][]) → String[][]

Examples

Example 1

logs = [["2026-10-10T10:00:00Z","u1","login"],["2026-10-10T10:03:00Z","u1","logout"],["2026-10-10T10:05:00Z","u1","login"]]summary = [["u1","login","1"],["u1","logout","1"]]return = [["u1","login","2","1"]]

The raw log contains two login events for u1, but the summary reports one.

Example 2

logs = [["t1","u1","view"],["t2","u2","click"]]summary = [["u1","view","1"],["u2","click","1"],["u3","view","2"]]return = [["u3","view","0","2"]]

The summary includes two view events for u3, although the raw log has none.

Example 3

logs = [["t3","u2","view"],["t1","u1","view"],["t2","u2","view"]]summary = [["u2","view","2"]]return = [["u1","view","1","0"]]

The summary omits the one view event belonging to u1.

Constraints

  • 0 <= logs.length <= 200000.
  • Every row of logs contains exactly three non-empty strings: timestamp, user ID, and action.
  • 0 <= summary.length <= 200000.
  • Every row of summary contains exactly three strings: user ID, action, and a decimal integer from 0 through 2147483647.
  • Each user-action pair appears at most once in summary.
  • User IDs and actions contain at most 50 characters.

More Google Onsite Interview questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Distinct Subset SumsONSITE INTERVIEW · Seen Nov 2026
  • Playlist With No Same Artist in a RowONSITE INTERVIEW · Seen Nov 2026
  • Delete Nodes and Return Forest RootsONSITE INTERVIEW · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • First and Last Target Position in a Mountain ArrayONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
  • Batched Subsequence Word MatchesONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Transform Dotted Keys into a Nested MapProofpoint · ONSITE INTERVIEW
  • Serialize and Deserialize a String Key-Value StoreByteDance · ONSITE INTERVIEWByteDance interview questions
  • In-Memory Database QueriesOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Order Manager with Partial Cancellations and Indexed QueriesStripe · ONSITE INTERVIEWStripe interview questions
  • Deep Merge with a Conflict ResolverAutodesk · ONSITE INTERVIEWAutodesk interview questions
  • Number of AtomsAmazon · ONSITE INTERVIEW
  • Server Log Summary and Minute AnomaliesNinjaTrader · PHONE SCREEN
  • Insert an Employee into an Organization HierarchyWaymo · PHONE SCREENWaymo interview questions
  • Party Windows and Dead Zone TimeScale AI · PHONE SCREENScale AI interview questions
  • Common Words Across FilesMeta · PHONE SCREENMeta interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public String[][] findLogSummaryDifferences(String[][] logs, String[][] summary) {
        // Write your code here.
    }
}
Checking account…