#275

Session Step Duration Analysis

MEDIUMData Engineeringpython

Problem Description

You are analyzing user behavior in a multi-step workflow system and need to calculate how long users typically spend on each step. Given a list of session records where each record is formatted as `[session_id, step, timestamp]`, you need to calculate the average time consumed per step across all sessions. Each session progresses through numbered steps (1, 2, 3, ...), and the time consumed at a step is the difference between that step's timestamp and the previous step's timestamp within the same session. Return a dictionary mapping each step number to the average time consumed at that step.

Topics

hash tablearraysortinggrouping

Asked at Companies

meta

Solve This Problem

Sign up to access the interactive code editor, run test cases, view the editorial, and get AI-powered feedback on your solution.

Start Solving →