FastPrepConvert a Purchase at Its Historical Exchange Rate
Problems/Convert a Purchase at Its Historical Exchange Rate

Convert a Purchase at Its Historical Exchange Rate

Agoda logoAgoda● EasyFULLTIMEOA

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: We kept the rule for looking up the rate by time and converting the purchase. The live HTTP and MySQL parts become input tables here.

Our version is about 88% the same as the reported question.

A purchase has a price in an international currency and a timestamp. Exchange-rate changes are recorded with the timestamp at which each rate becomes effective.

Return the amount payable in internal currency by using the latest exchange rate whose timestamp is less than or equal to the purchase timestamp.

In the assessment, the purchase came from a local REST endpoint and the rate history from MySQL. Here both are supplied directly as tables.

Table schema

Pandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

purchase

ColumnTypeNullableDescription
product_nameTextNo—
product_priceIntegerNo—
purchase_timestampIntegerNo—

currency

ColumnTypeNullableDescription
rate_timestampPKIntegerNo—
exchange_rateIntegerNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
amount_to_payIntegerNo—

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • The purchase table contains exactly one row.
  • At least one currency row is effective at the purchase timestamp.
  • Currency timestamps are unique.

More Agoda Online Assessment questions

  • Special Diameter EndpointsOA · Seen Nov 2025
  • TV Series in a Production WindowOA · Seen Nov 2025
  • Count One Groups by SizeOA · Seen Jul 2025
  • Minimum Price With Discount CouponsOA · Seen Jul 2025
  • Lexicographically Smallest Task QueueOA · Seen Jul 2025
  • Highest-Ranked University by CountryOA · Seen Jun 2025
  • Jump Game with Prime-3 StepsOA · Seen Jun 2025
  • Team FormationOA · Seen Apr 2025
  • Two-Core Process AssignmentOA · Seen Apr 2025
  • Unique Digits in RangeOA · Seen Apr 2025

Similar questions at other companies

  • Build Taxi Driver Performance FeaturesBoston Consulting Group · OABoston Consulting Group interview questions
  • Students Scoring Above AverageCapstone Investment Advisors · OA
  • Bond Interest Summary Above 3%Wells Fargo · OAWells Fargo interview questions
  • Employee Promotion OpportunitiesIntuit · OAIntuit interview questions
  • Students and Their SubjectsBirla Pivot · OA
  • Companies with Average Salary Above 40000AT&T · OAAT&T interview questions
  • First Missing Number in a Consecutive ArrayArista Networks · OA · PHONE SCREENArista Networks interview questions
  • Weekend Appointments for Consular Services ReschedulingMcKinsey & Company · OAMcKinsey & Company interview questions
  • Repair a Binary SearchJefferies · OA
  • Companies Above a Salary ThresholdVerisk · OA

Interview reports that mention this question

  • Agoda Staff Backend OA Questions: 5 Experiences
All Agoda interview questionsSee Agoda hiring insights