← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Meta data scientist interview with a SQL question focused on currency conversion for ad revenue reporting. Pretty standard stuff but the multi-currency angle made it slightly more interesting than a plain aggregation problem.

Questions Asked (1)

Q1

Given a table of ad revenue in various local currencies and a separate exchange rate table, write a SQL query to return the total ad revenue converted to USD.

Product Analytics & MetricsData Modeling
Author's notes

Straightforward join-and-aggregate once you see it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the table schemas and the grain of each table (e.g., daily ad revenue per currency, exchange rates per currency per date). Then write a SQL query that joins the revenue table to the exchange rate table on currency and date, multiplies revenue by the rate, and sums the converted amounts to get total USD revenue.

Pro tip: Always confirm whether exchange rates are quoted as USD per local currency or local currency per USD, and whether to use the rate on the revenue date or a period-average rate—this shows you understand real-world data nuances and can prevent costly errors.

1. Clarify table schemas and grain

Ask for or state the columns and granularity of both tables (e.g., revenue: date, currency, amount; exchange_rates: date, currency, rate_to_usd). Confirm the direction of the exchange rate.

2. Determine the join keys and type

Identify that you need to join on currency and date (or the appropriate time period). Decide between inner join (to only include dates with rates) or left join (to keep all revenue, handling missing rates).

3. Write the conversion logic

Multiply the local revenue amount by the exchange rate to convert to USD. If the rate is USD per local currency, multiply; if local per USD, divide.

4. Aggregate to total USD revenue

Use SUM() on the converted amounts to get the total ad revenue in USD. Optionally group by date or other dimensions if needed.

5. Validate and handle edge cases

Check for missing exchange rates, duplicate rates, or currency mismatches. Consider using COALESCE or filtering to ensure accurate results.

Key Points to Mention

  • Table schemas and granularity (date, currency, amount, rate)
  • Join conditions: currency and date (or appropriate time period)
  • Exchange rate direction (USD per local vs. local per USD)
  • Handling missing or multiple exchange rates (e.g., use latest rate, average rate, or inner join)
  • Aggregation with SUM() and potential grouping
  • Data quality checks: duplicates, nulls, currency codes

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.