FastPrepTranscript Window Metrics
Problems/Transcript Window Metrics

Transcript Window Metrics

Sesame logoSesame● MediumFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Sesame technical-phone report asks for an event-handler class that ingests user transcripts and returns the biggest length and unique users over a fixed window, explicitly comparing the maximum component with LeetCode 239. The array adapter, event-count window, per-window output timing, and transcript-length field are authored practice details that expose that reported capability deterministically. The judged contract matches the recoverable source at about 78%.

Transcript events arrive in order. Event i has user userIds[i] and transcript length lengths[i].

For every contiguous window of exactly windowSize events, return one row [maximumTranscriptLength, distinctUserCount]. Rows must follow window order.

Function

transcriptWindowMetrics(userIds: String[], lengths: int[], windowSize: int) → int[][]

Examples

Example 1

userIds = ["a","b","a","c"]lengths = [4,7,5,9]windowSize = 3return = [[7,2],[9,3]]

The first window has users a and b; the second has a, b, and c.

Example 2

userIds = ["u","u","v"]lengths = [2,8,1]windowSize = 2return = [[8,1],[8,2]]

The maximum stays 8 while the distinct-user count changes.

Example 3

userIds = ["x","y"]lengths = [0,3]windowSize = 1return = [[0,1],[3,1]]

A one-event window always has one distinct user.

Constraints

  • 1 <= windowSize <= userIds.length == lengths.length <= 100000.
  • 0 <= lengths[i] <= 1000000000.
  • User IDs are nonempty strings.
See Sesame hiring insights
Saved
class Solution {
    public int[][] transcriptWindowMetrics(String[] userIds, int[] lengths, int windowSize) {
        // Return {maximumLength, uniqueUsers} for each window.
    }
}
Checking account…