Google | SWE L3 | USA
Anonymous User
4022

Question:
You have chars = ['z','p'], length = 3, and max_repetition = 2. How many valid 'names' we can get with given name's length, allowed chars and maximum contiguous repetitions of a sigle char?
Output: 6
Because all valid names are: 1) zzp 2) zpz 3) zpp 4) pzz 5) pzp 6) ppz
zzz or ppp are not allowed here because they have 3 contiguous repetitions (our max_repetition == 2)

Kinda a math question of how to count all possible permutations with allowed duplicates but with limit of contiguous repetitions of a char.

Experience: There were no any efforts from the interviewer to communicate. All 45 mins there was a silent from his side and maybe he or someone else was wathing a TV because there was a lot of noise. So just ctrl+c/ctrl+v the question, no hints or any reaction to my code and my outloud discussion of ideas. I think a big part of success with Google and other companies depends on the people who try to "interview" you. It was like an interview with a robot who just programmed to wait 45 mins and then do own businesses (watch a tv?)
Bonus: his web camera was looking at the ceiling, when at the same time you need to show yourself

Comments (17)