Google Data Scientist Interview Experience — A Two-Part Invoice Matching Coding Screen

Google·Data Scientist·Oct 2025
Technical Screenmedium

We started with quick self-introductions on both sides — no deep-dive project questions. Then came two coding questions built around a single scenario; the questions and the amount of code involved weren't trivial. At the end I got to ask the interviewer some questions.

Q1: Given the invoice ID inside a payment's memo, find the matching invoice in the invoice list and output the result.

My approach: parse the payment string to pull out the ID, amount, and memo, then extract the target invoice ID from the memo. Build a map from invoice ID to invoice details, then look up the match. If found, output the payment info; otherwise say it wasn't found. Handle edge cases like extra whitespace. Time complexity O(n).

Q2: Extend the matching logic to support two modes — memo matching and amount matching. If the memo is in the standard format, match by invoice ID; otherwise match by payment amount (and if multiple invoices share the same amount, pick the one with the earliest due date). This one built directly on Q1.

My approach: 1) if the memo contains "Paying off:", use the same memo-matching logic as Q1; otherwise fall into amount-based matching. 2) Iterate over all invoices and filter to the ones where amount == paymentAmount; if nothing matches, output something like "cannot find matching invoice for amount ...". 3) Sort the matches by dueDate (or just iterate through them) to find the earliest one.

No real problems — I got all the code written out. Good thing I'd more or less already rehearsed this, since I'd done a mock interview beforehand, so the interviewer and I were pretty in sync and it went smoothly. My code comments were detailed, and the interviewer kept giving hints the whole way through, even though I wasn't feeling too confident inside (TT). None of the overseas TikTok/Google/Microsoft/Amazon interviews I'd done before had asked anything quite like this.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Google
Role
Data Scientist
Rounds
Technical Screen
Difficulty
medium
Interview date
Oct 2025
Questions from this interview
1 question

Real Google interview experiences

First-hand reports from Google candidates — the rounds, the questions they were asked, and how it went.

All 127 Google interview experiences