Amazon

  1. Server Utilization Time
    "Given a table containing server start and stop timestamps for multiple servers, write a query to calculate the total uptime (in full days) for each server. Assume a server can start and stop multiple times."
  2. Highest-Grossing Items
    "You have an orders table with item_id, quantity, and price. Write a query to find the top 5 items that generated the most total revenue."
  3. User Shopping Sprees
    "Given a purchase history table with timestamps, identify users who made multiple purchases within a short span (e.g., within 30 minutes). List these users and how many sprees they had."
  4. Average Review Ratings
    "From a reviews table (product_id, rating), write a query to compute the average rating per product, and return only those products with more than 50 reviews."
  5. Maximize Prime Item Inventory
    "Using historical daily sales data for Prime items, predict the minimum inventory needed to avoid stockouts based on an average daily sales figure."

Google

  1. Median Google Search Frequency
    "Given a table summarizing how many searches each user made per day, write a query to find the median number of searches."
  2. Odd and Even Measurements
    "You have a table of sensor measurements. Separate the data into odd and even measurement IDs and calculate the average measurement value for each group."
  3. Median of Search Queries
    "Given users' total number of searches in a month, write a query to determine the median number of searches submitted."
  4. Top Search Keywords
    "Using a search_logs table (user_id, keyword), write a query to find the top 10 most searched keywords."
  5. Search Query Trends
    "Analyze how search query volumes change over time (daily, weekly, or monthly). Write a query that shows the number of searches over each time period."

Meta (Facebook)

  1. Average Post Hiatus
    "Given user posts with post timestamps, calculate the average number of days between consecutive posts for each user."
  2. Advertiser Status
    "Given campaign start and end dates, identify advertisers who haven't had any active campaigns in the past 30 days and mark them as 'Inactive'."
  3. Number of Comments Per User
    "Using a comments table (user_id, post_id, comment_timestamp), find how many comments each user has made in the past year."
  4. User Engagement Metrics
    "Write a query that calculates total likes, total comments, and total shares for each user across all their posts."
  5. Friend Recommendation System
    "Given a user-friendship table, suggest friends by finding users who share at least 2 mutual friends but are not already directly connected."

Stripe

  1. Repeated Payments
    "Identify all cases where the same user made two payments with the same amount and same merchant within 10 minutes of each other."
  2. Transaction Anomalies
    "Write a query to detect potential fraudulent transactions — specifically looking for users who made purchases above 2x their average spend within a week."
  3. Merchant Performance
    "Calculate the success rate of each merchant's transactions (number of successful transactions divided by total attempted transactions)."
  4. Customer Retention Analysis
    "Determine how many users made repeat purchases within 30 days of their first transaction."
  5. Payment Method Preferences
    "Find the most commonly used payment method (credit card, PayPal, etc.) for each customer based on their transaction history."

Microsoft

  1. Teams Power Users
    "Using Teams activity data (messages sent, meetings joined), identify the top 5% most active users."
  2. Supercloud Customer Analysis
    "Using Supercloud usage logs (compute hours, storage used), write a query to find customers with the highest resource consumption."
  3. Product Usage Metrics
    "Analyze logins and usage across multiple Microsoft products (Outlook, Teams, Excel). Find the top 3 most used products per user."
  4. License Utilization
    "Given tables for assigned licenses and active user logs, calculate what percentage of software licenses are actually being used."
  5. User Activity Trends
    "Group user activities (logins, file uploads) weekly. Plot user engagement trends across the last 6 months."

Netflix

  1. Content Streaming Patterns
    "Given watch history data (user_id, content_id, timestamp), find which hours of the day have the highest number of streams."
  2. Subscription Retention
    "Write a query that tracks how many users continue their subscriptions 30, 60, and 90 days after joining Netflix."
  3. Genre Popularity Analysis
    "Using a table of shows watched (user_id, show_id, genre), count total watches per genre and rank genres by popularity."
  4. User Watchlist Behavior
    "Analyze the behavior of users on the Watchlist feature: how many items they add, how many they actually watch, and how long they keep them unwatched."
  5. Recommendation System Efficiency
    "Given recommendation and watch logs, calculate the ratio of recommended content that was actually watched by users within 7 days of the recommendation."