Google L3 - Technical Phone Screening - 2025 Nov
Summary
I recently underwent a Google L3 Technical Phone Screening where I was presented with a unique problem involving matching digits from a Pi sequence to their corresponding indices. The problem required careful handling of single and multi-digit index matching rules, and I discussed the approach and some initial challenges with the interviewer.
Full Experience
I had my Google L3 Technical Phone Screening yesterday, and I wanted to share my experience with the community. The interviewer presented a rather intriguing and somewhat abstract problem. It involved a sequence of Pi digits and their 1-indexed positions. The core task was to find indices where the digits of the index itself matched the Pi digits at those positions. For instance, if the index was 13, I had to verify if Pi[13] was 3 and Pi[12] was 1. This required a careful parsing strategy.
Initially, the interviewer only provided the Pi sequence up to index 9, which made it tricky to consider edge cases involving two-digit indices (like 10, 11, etc.) properly. They eventually provided a hint about the range, but I found that aspect of mapping index digits to Pi digits a bit confusing at first.
For the implementation, I was given the freedom to choose the input parameter's data type, and I opted for a String. I thought this would simplify working with individual characters and their conversion to integers. However, I did make a mistake early on by trying something like pi[i].toInt() directly. I haven't received any feedback on the interview yet, but I'm eager to see the outcome and will update this post once I do.
Interview Questions (1)
You are presented with a sequence representing the digits of Pi, indexed starting from 1:
Pi: 3 1 4 1 5 9 2 6 5 3 5 1 3 4
Index: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
The value of Pi is given to be up to 106, implying that indices can extend up to that range. The goal is to identify and output specific index values based on a matching rule. For instance, if the target "Pi value" is 10^6, the expected output is 5, 13.
Example Explanation for Output 5, 13:
- For index
5: The digit at Pi[5] is5, which matches the index value5. - For index
13: This requires matching the digits of the index13with the corresponding Pi digits. The last digit of13is3, which matches Pi[13]. The preceding digit of13is1, which matches Pi[12]. Therefore,13is a valid match.
The core task is to implement a function that takes a parameter (type chosen by candidate, I chose String) and identifies all such matching indices based on the rule: an index k is a match if each digit of k (read from right to left) matches the Pi digit at the corresponding position (e.g., for index XY, Y matches Pi[XY] and X matches Pi[X]). The interviewer initially provided a truncated Pi sequence (up to index 9), which made it challenging to immediately identify edge cases involving multi-digit indices.