Sessionize Member Activity and Measure Job View to Apply Conversion

Last updated: November 29, 2026

Quick Overview

Given raw member events with timestamps, split each member's activity into sessions using a 30-minute inactivity gap, and compute the share of sessions with a job view that also contain a later apply click.

LinkedIn
Data Manipulation (SQL/Python)
Data Engineer
LinkedIn
November 29, 2026
Data Engineer
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given raw member events with timestamps, split each member's activity into sessions using a 30-minute inactivity gap, and compute the share of sessions with a job view that also contain a later apply click.

LinkedIn tracking events arrive out of order through Kafka from web and mobile clients, and the Jobs funnel is measured per session. This onsite exercise checks sessionization logic, ordering within a funnel and careful definitions of the denominator.

What the Interviewer Expects
  • Groups events by member and sorts by time, not arrival order
  • Starts a new session when the gap exceeds 30 minutes, with a clear boundary rule
  • Enforces order: an apply only counts after a job view in the same session
  • Uses sessions with a job view as the denominator
  • States complexity and how it would run at scale
Key Topics to Cover
sessionization
funnel analysis
event ordering
group by key
streaming data
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you do this in SQL with LAG and a running sum?
  • How would you handle a session spanning midnight in a daily batch?
  • What if the same event arrives twice?
  • How would you require the apply to be on the same job that was viewed?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Input is a list of (member_id, ts_seconds, event_type) in arbitrary order. Event types include feed_view, job_view and apply_click. A gap greater than 30 minutes between consecutive events sta...

Approach

Bucket events by member, sort each bucket by timestamp, and walk once, opening a session whenever the gap to the previous event exceeds the threshold. Track two flags per session: saw_job and `conve...


Submit Your Answer
Markdown supported

Related Questions