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
November 29, 20260
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
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- 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 ProblemsSample 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, titleis the source of truth for valid SKUs and may ...
Approach
- Concatenate all feeds into one frame.
- Normalize: strip and upper-case SKUs, parse timestamps, coerce prices with
errors="coerce"and drop NaN or non-positive prices. Dropping invalid prices be...