PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates competency in randomized sampling and data manipulation using SQL or Python, focusing on probabilistic selection and the use of built-in sampling functions within the Data Manipulation (SQL/Python) domain.

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

Select 10% Users Randomly from User Table

Company: TikTok

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

users +----+----------+-------------+ | id | username | signup_date | +----+----------+-------------+ | 1 | alice | 2023-01-02 | | 2 | bob | 2023-02-15 | | 3 | carol | 2023-03-20 | | 4 | dave | 2023-04-10 | | 5 | erin | 2023-05-05 | +----+----------+-------------+ ##### Scenario Need to pull an exploratory sample from a large user table for downstream analysis. ##### Question Write an SQL query that randomly selects approximately 10% of all users from the users table. ##### Hints Use a built-in random function or TABLESAMPLE and filter by a threshold.

Quick Answer: This question evaluates competency in randomized sampling and data manipulation using SQL or Python, focusing on probabilistic selection and the use of built-in sampling functions within the Data Manipulation (SQL/Python) domain.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,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)