PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in pandas-based data manipulation, specifically competencies in aggregating revenue, merging store metadata, and producing ranked regional summaries.

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

Compute and Rank Store Revenue by Region Using Pandas

Company: Apple

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

Sales +------------+---------+------------+--------+---------+ | date | store_id| product_id | units | revenue | +------------+---------+------------+--------+---------+ |2023-01-01 |1 |101 |3 |30.00 | |2023-01-01 |1 |102 |2 |40.00 | |2023-01-02 |2 |101 |5 |50.00 | |2023-01-02 |2 |103 |1 |20.00 | |2023-01-02 |3 |101 |4 |40.00 | +------------+---------+------------+--------+---------+ ​ Stores +---------+---------+ | store_id| region | +---------+---------+ |1 | West | |2 | East | |3 | Central | +---------+---------+ ##### Scenario Pandas data-wrangling coding task on sales data ##### Question Using pandas, compute total revenue per store per day from the sales table. Merge the sales table with the stores table on store_id, then list the top three regions by total revenue. ##### Hints Use groupby, agg, merge, sort_values, and reset_index appropriately.

Quick Answer: This question evaluates proficiency in pandas-based data manipulation, specifically competencies in aggregating revenue, merging store metadata, and producing ranked regional summaries.

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

  • Detect sessions and gaps using SQL LEAD - Apple (Medium)
  • Write queries to compute salary and budget stats - Apple (easy)
  • Analyze TSV File for User Page Visits and Patterns - Apple (Medium)
  • Explain Python lists, dicts, and concurrency - Apple (Medium)