PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/Coinbase

Compute delivery metrics and top-K queries

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data manipulation, streaming aggregation, spatial proximity computation, and top-K query design skills using SQL and Python and belongs to the Data Manipulation (SQL/Python) domain.

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

Compute delivery metrics and top-K queries

Company: Coinbase

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

You have restaurant menus and orders for a food delivery platform. Part 1: Given a user location and a set of restaurants (each with its menu items and prices), return the restaurant offering the lowest total price for a specified basket and the nearest such restaurant if there are ties; define distance computation assumptions. Part 2: Given a stream of orders with timestamps and item-level prices, compute over a time window the total revenue, order count, and average order value; support multiple overlapping windows efficiently. Part 3: Over a time window, return the Top-K orders by total price and the Top-K items by units sold; design data structures/algorithms to handle updates in real time (e.g., heaps, hash maps) and discuss complexity and tie-breaking. Implement clean function signatures and minimal tests.

Quick Answer: This question evaluates data manipulation, streaming aggregation, spatial proximity computation, and top-K query design skills using SQL and Python and belongs to the Data Manipulation (SQL/Python) domain.

Related Interview Questions

  • Compute adoption, latency, and cross-region transactions - Coinbase (Medium)
  • Write SQL: sum values ≤ each row’s value - Coinbase (Medium)
  • Write SQL and Python for funnels/retention - Coinbase (Medium)
  • Implement filters and cursor pagination - Coinbase (Medium)
  • Calculate Cumulative Sum for Each Integer in Table - Coinbase (Medium)
Coinbase logo
Coinbase
Jul 31, 2025, 12:00 AM
Software Engineer
Onsite
Data Manipulation (SQL/Python)
4
0

You have restaurant menus and orders for a food delivery platform. Part 1: Given a user location and a set of restaurants (each with its menu items and prices), return the restaurant offering the lowest total price for a specified basket and the nearest such restaurant if there are ties; define distance computation assumptions. Part 2: Given a stream of orders with timestamps and item-level prices, compute over a time window the total revenue, order count, and average order value; support multiple overlapping windows efficiently. Part 3: Over a time window, return the Top-K orders by total price and the Top-K items by units sold; design data structures/algorithms to handle updates in real time (e.g., heaps, hash maps) and discuss complexity and tie-breaking. Implement clean function signatures and minimal tests.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase Data Manipulation (SQL/Python)•Software Engineer Data Manipulation (SQL/Python)
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.