I finally got my Google OA, and I'm posting here right after finishing it. This OA had 2 questions total, 90 minutes, which keeps Google's usual style. Both questions were not too difficult overall.
Problem 1 (paraphrased)
You have a one-dimensional board, and each cell can be in one of three states: empty, a piece, or a coin.
On each turn, you can choose any piece and move it 3 cells to the right. The rules are:
If the piece lands on an empty cell, nothing happens;
If the piece lands on a cell with a coin, the player collects that coin;
Pieces cannot overlap with each other.
You can take any number of turns until no piece can move anymore. The question asks for the maximum number of coins you can collect in total.
Problem 2 (paraphrased)
You're given a number of two-digit numbers, for example 11, 21, 31, 41, 16, 17, 18, 34, 57, and so on.
The question asks: what's the maximum number of these you can pick out at once such that they all share at least one common digit?
For example, you could pick out 11, 21, 31, 41, 16, 17, 18 — 7 numbers total — because they all contain the digit 1.
A few more details about the OA:
No hidden test cases
The system only gave two basic test cases
If you feel that's not enough, you can add your own test cases to verify your logic
Overall it was a pretty good experience — a fairly friendly OA. Hope this helps people who are still preparing.
Also welcome anyone who's already done it to come discuss approaches with me 👍
Discussion
Loading comments…