Interview practice question
Currency conversion with daily rates
Data Engineering · SQL · Experienced
Orders are in many currencies. Convert each order to USD using the exchange rate valid on the order date, where rates are missing on weekends and holidays.
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Join orders to the rate table on currency and date.
- Rates are missing on non-business days.
- Use the latest rate on or before the order date.
- Build a filled daily rate table with LAST_VALUE IGNORE NULLS over a date spine.
- Handle USD itself with rate 1.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.