InterviewDB Experience · Los Angeles

User Session: Track and Analyze User Session Activity With Duration and Event Counts

Interview Experience

Problem You have a table of user events with timestamps. A session is a sequence of events from the same user with no gap exceeding 30 minutes. Compute per-user: number of sessions, average session duration in minutes, and the session with the most events. Expected output: Approach Use window functions: LAG(created_at) OVER (PARTITION BY user_id ORDER BY created_at) to compute gaps, then mark session boundaries, assign session IDs with a running sum, and aggregate. Follow-ups Write the full SQL…

Full Details

🔒

Unlock all Abnormal Security questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a abnormal security interview during the onsite round.

It covers the following topics: Coding, Sql, Onsite .