PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates relational database design and data-manipulation competencies, including schema modeling and normalization, SQL-based association analysis for co-purchases, and vectorized data transformation using Python/Pandas.

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

Design Scalable Database and Analyze E-commerce Data

Company: Google

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

transactions +-----------+----------+------------+------------+ | user_id | order_id | product_id | order_time | +-----------+----------+------------+------------+ | 101 | 5001 | 23 | 2023-09-01 | | 101 | 5001 | 45 | 2023-09-01 | | 102 | 5002 | 23 | 2023-09-01 | | 103 | 5003 | 67 | 2023-09-02 | | 103 | 5003 | 45 | 2023-09-02 | +-----------+----------+------------+------------+ ##### Scenario A video-streaming start-up needs a scalable database; later you are asked to solve quick data-ops questions for an e-commerce team. ##### Question Design a relational database for the video company: what tables and key columns would you create and how are they related? Write an SQL query that returns the pair of products most frequently purchased together. Using Python/Pandas, add a new column to a DataFrame based on logical conditions from existing columns. ##### Hints Think normalization, primary/foreign keys, group by order_id, value_counts or window functions, and vectorized Pandas operations.

Quick Answer: This question evaluates relational database design and data-manipulation competencies, including schema modeling and normalization, SQL-based association analysis for co-purchases, and vectorized data transformation using Python/Pandas.

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

  • Generate binomial matrix and column-normalize - Google (Medium)
  • Analyze video flags and reviews with SQL - Google (Medium)
  • Write SQL/Python for messy event data - Google (Medium)
  • Add a conditional column in Python - Google (Medium)
  • Find most co‑purchased product pairs in SQL - Google (Medium)