Merge Seller Price Feeds and Keep the Most Recent Offer

Last updated: November 29, 2026

Quick Overview

Third-party sellers upload price feeds several times a day as separate files. Using pandas, combine the feeds, clean the SKU and price fields, keep only the latest valid price per seller and SKU, and attach catalog titles while dropping SKUs that are not in the catalog.

Amazon
Data Manipulation (SQL/Python)
Data Scientist
Amazon
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Third-party sellers upload price feeds several times a day as separate files. Using pandas, combine the feeds, clean the SKU and price fields, keep only the latest valid price per seller and SKU, and attach catalog titles while dropping SKUs that are not in the catalog.

Amazon Marketplace ingests millions of seller offers, and messy feeds (whitespace in SKUs, prices as strings, unknown SKUs) are a daily reality. In a technical screen this checks pandas fluency with concat, type coercion, drop_duplicates semantics and merge validation, plus the judgment to say which bad rows are dropped and why.

What the Interviewer Expects
  • Normalize join keys (strip, upper-case) before deduplicating or merging
  • Coerce price to numeric and drop invalid or non-positive values explicitly
  • Sort by timestamp and use drop_duplicates with keep='last' (or groupby idxmax) to keep the latest offer
  • Deduplicate the catalog and use merge validate= to catch fan-out
  • State the timezone assumption when parsing feed timestamps
Key Topics to Cover
pandas concat
drop_duplicates
key normalization
merge validation
type coercion
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you report the rows you dropped so sellers can fix their feeds?
  • What changes if a seller can send a deletion record meaning 'remove this offer'?
  • How would you scale this to tens of millions of rows per hour?
  • How would you detect suspicious price drops of more than 50 percent between consecutive feeds?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data
  • Each feed: sku, seller_id, price, feed_ts. Prices may arrive as strings or garbage; SKUs may have stray spaces or lower case.
  • catalog: sku, title is the source of truth for valid SKUs and may ...
Approach
  1. Concatenate all feeds into one frame.
  2. Normalize: strip and upper-case SKUs, parse timestamps, coerce prices with errors="coerce" and drop NaN or non-positive prices. Dropping invalid prices be...

Submit Your Answer
Markdown supported