PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates the ability to compute monthly conversion rates and average order value from event and transaction data, testing skills in time-based aggregation, joining datasets, distinct user counting, and metric calculation.

  • Medium
  • TikTok
  • Data Manipulation (SQL/Python)
  • Data Scientist

Calculate Monthly Conversion Rate and Average Order Value

Company: TikTok

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

page_views +-----------+---------+---------------------+ | user_id | page_id | view_timestamp | +-----------+---------+---------------------+ | 101 | 12 | 2023-05-01 10:05:00 | | 102 | 15 | 2023-05-02 14:20:00 | | 101 | 18 | 2023-05-04 09:10:00 | +-----------+---------+---------------------+ ​ purchases +-------------+---------+--------+---------------------+ | purchase_id | user_id | amount | purchase_timestamp | +-------------+---------+--------+---------------------+ | 1 | 101 | 19.99 | 2023-05-01 10:12:00 | | 2 | 103 | 29.99 | 2023-05-03 12:45:00 | | 3 | 101 | 9.99 | 2023-05-04 09:15:00 | +-------------+---------+--------+---------------------+ ##### Scenario E-commerce platform wants to track how many monthly site visitors convert into paying customers. ##### Question Using the available tables, write a SQL query that returns each month, the number of distinct visitors, the number of purchasers, and the conversion rate (purchasers/visitors). Extend the query to include average order value per month. ##### Hints Use date_trunc, LEFT JOIN page_views to purchases, aggregate with COUNT(DISTINCT) and SUM/AVG.

Quick Answer: This question evaluates the ability to compute monthly conversion rates and average order value from event and transaction data, testing skills in time-based aggregation, joining datasets, distinct user counting, and metric calculation.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find high-value crypto users and top-CTR product - TikTok (easy)
  • Write monthly customer and sales SQL queries - TikTok (easy)
  • Find top-paid employee per department - TikTok (easy)
  • Count buggy vs non-buggy by employer - TikTok (Medium)
  • Select max-discount product per category - TikTok (Medium)