PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Amazon

Implement ad matching and delivery routing

Last updated: Mar 29, 2026

Quick Overview

This prompt evaluates algorithm and data-structure design plus optimization skills across two domains: efficient ad-matching with dynamic updates and budgeted targeting, and route planning on weighted graphs for near-optimal delivery sequences.

  • Medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Implement ad matching and delivery routing

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Part A: Implement a data structure for an ad-matching service that supports add(campaign), remove(campaign), and match(request), where a request has attributes (e.g., location, device, interests) and campaigns specify targeting predicates and budgets. Optimize for fast matching and frequent updates; discuss complexity and trade-offs. Part B: Given a weighted road graph with nonnegative edges, a depot, and N delivery stops, implement plan_route(graph, depot, stops) to produce a near-optimal route. Compare exact versus heuristic approaches (e.g., shortest paths plus TSP heuristics), analyze complexity, and handle practical constraints such as capacity or time windows.

Quick Answer: This prompt evaluates algorithm and data-structure design plus optimization skills across two domains: efficient ad-matching with dynamic updates and budgeted targeting, and route planning on weighted graphs for near-optimal delivery sequences.

Related Interview Questions

  • Implement Datacenter Router Commands - Amazon (hard)
  • Replace Delimited Tokens in a String - Amazon (medium)
  • Minimize Circular Redistribution Cost - Amazon (medium)
  • Find the Most Common Visit Pattern - Amazon (hard)
  • Maximize Value Under a Budget - Amazon (medium)
Amazon logo
Amazon
Jul 16, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
2
0

Part A: Implement a data structure for an ad-matching service that supports add(campaign), remove(campaign), and match(request), where a request has attributes (e.g., location, device, interests) and campaigns specify targeting predicates and budgets. Optimize for fast matching and frequent updates; discuss complexity and trade-offs. Part B: Given a weighted road graph with nonnegative edges, a depot, and N delivery stops, implement plan_route(graph, depot, stops) to produce a near-optimal route. Compare exact versus heuristic approaches (e.g., shortest paths plus TSP heuristics), analyze complexity, and handle practical constraints such as capacity or time windows.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,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.