Pinterest Data Manipulation (SQL/Python) Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Clean and Aggregate Transactions for Finance Dashboard
transactions id | user_id | amount | timestamp | category 1 | 1001 | 19.99 | 2023-01-01 09:00:00 | grocery 2 | 1001 | 5.50 | 2023...
Implement Binary Search for Policy Violation Logs
violations +--------+---------+---------------+ | pin_id | type | violation_date| +--------+---------+---------------+ | 0 | spam | 2022-01...
Analyze Global Engagement and Impressions with SQL Queries
impressions +---------+---------+----------+----------------+ | user_id | country | category | impression_cnt | +---------+---------+----------+------...
Find top category by video time spent
Pandas required. You are given a DataFrame df with columns: user_id (int), pin_id (int), pin_type (str), category (str or None), time_spent_sec (numer...
Compute CTR by pin_format and date
PostgreSQL-compatible SQL required. Given these tables, write a single query that returns, for each event_date and pin_format, the Click-Through-Rate ...
Write SQL to compute max-overlap lists
Invented schema and sample data below. Assume 'today' is 2025-09-01 and 'last 7 days' means 2025-08-26 through 2025-09-01 inclusive. Only consider lis...
Transform nested dicts with pandas apply/lambda
Given a pandas DataFrame df with columns: user_id (int), ts (datetime64[ns]), events (list of dicts), attrs (dict). Example rows (conceptual): user_id...
Write windowed retention and ARPU SQL
You are given three tables. Write one SQL script (CTEs allowed) that answers all parts using window functions and joins (no procedural loops): Schema:...
Write SQL and pandas for shopping events
Use the schema and sample data below to answer SQL and pandas tasks. Treat 'today' as 2025-09-01. Schema users(user_id INT, country STRING) pins(pin_i...
Write SQL to rank categories by impressions
You are given the following schema and sample data. Today is 2025-09-01. Schema: - users(user_id INT, country_id VARCHAR) - countries(country_id VARCH...
Find top video category by average time
You are given a pandas DataFrame 'pins' with columns [pin_id:int, category_id:int, time_spent_sec:float, pin_format:string] and a dict 'category_map' ...
Compute CTR by pin_format for new US users
Write a single SQL query to compute click-through rate (CTR) per pin_format for US new users. New users are those whose signup_date is within 30 days ...
Aggregate video time and unique pins in Python
Part A (category by average time for videos): You receive a list of pin engagement rows and a category map. pins = [ {"pin_id": 10, "category_id": 1,...
Compute CTR by format for new US users
You are given three tables. Write a single SQL query to compute click-through rate (CTR) by pin_format for NEW users in the US, where NEW users are th...