PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in data manipulation, string-based date handling, aggregation and pivot transformations, along with reasoning about data structures, de-duplication and missing-value filling.

  • Medium
  • Instacart
  • Data Manipulation (SQL/Python)
  • Software Engineer

Pivot transactions by date without date libs

Company: Instacart

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

Given a stream of transaction rows (shopper_id, date_str, amount) where date_str is ISO format 'YYYY-MM-DD', produce a pivoted report for a specified 7‑day window [start_date, end_date]. For each shopper_id, output one row with columns shopper_id, d0, d1, ..., d6 where di is the sum of amount on the i‑th day offset from start_date. Constraints: rows may be unsorted and duplicate; you cannot import date/time libraries—treat date_str lexicographically for ordering and use simple arithmetic over precomputed consecutive ISO strings; assume all dates in the window exist. Specify your data structures, handling of missing days (fill with 0), and time/space complexity. Implement in any language.

Quick Answer: This question evaluates proficiency in data manipulation, string-based date handling, aggregation and pivot transformations, along with reasoning about data structures, de-duplication and missing-value filling.

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

  • Write SQL to rank advertisers and profitability - Instacart (Medium)
  • Aggregate weekly revenue and attribute 4% drop - Instacart (Medium)
  • Explain handling very large datasets - Instacart (Medium)
  • Pivot data without date libraries - Instacart (Medium)
  • Implement a pivot table transformation - Instacart (Medium)