FastPrepSummarize Customer Records
Problems/Summarize Customer Records

Summarize Customer Records

Agoda logoAgoda● MediumFULLTIMEOA

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: We kept all the requested totals, the ordering and the report's tie rule. The printed report becomes a result table here.

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

You get a customer table. Each row has a company, a city, a country, an employee count, a contract count and a contract cost.

Return a summary with these parts:

  1. the total number of customers;
  2. the number of customers in each city, with cities in ascending order;
  3. the number of customers in each country, with countries in ascending order;
  4. the country with the largest sum of signed contracts, and that sum; and
  5. the number of different cities.

If several countries tie for the largest contract count, pick the alphabetically larger country, comparing names case-sensitively. Compare country names with case sensitivity.

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.

customers

ColumnTypeNullableDescription
IDTextNo—
NAMETextNo—
CITYTextNo—
COUNTRYTextNo—
CPERSONTextNo—
EMPLCNTIntegerNo—
CONTRCNTIntegerNo—
CONTRCOSTDecimalNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
metricTextNo—
keyTextYes—
valueIntegerNo—

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

Constraints

  • All input columns follow the source schema and are non-null.
  • The source's formatted multi-section output is represented as ordered rows with columns metric, key, and value.

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

  • Prepare Taxi Driver Classification DataBoston Consulting Group · OABoston Consulting Group interview questions
  • Clean the TapeMillennium · OAMillennium interview questions
  • Weekend Appointments for Consular Services ReschedulingMcKinsey & Company · OAMcKinsey & Company interview questions
  • Benchmarking Tool ReportPalantir · OAPalantir interview questions
  • In-Memory Database QueriesOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Latest New JobSphere · ONSITE INTERVIEW
  • Second Highest SalaryHartford Financial Services · ONSITE INTERVIEWHartford Financial Services interview questions
  • Subscription and Usage-Based Billing CalculatorStripe · OAStripe interview questions
  • Hiking Club Fastest PaceInfosys · OAInfosys interview questions
  • Earliest Meeting Time for All EmployeesCapital One · OACapital One interview questions

Interview reports that mention this question

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