gOOgle - L4 _ Screen Round
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-29Added By Anonymous
Source: Link
🧭 Experience: unknown
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: Google
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
Had screening round yesterday. Cant remember the exact question but it was someting along these lines.
You're building a streaming payment validator that receives a number as a digit-by-digit string. At every step, you need to check if the current prefix forms a number divisible by a given integer m.
Return an array div such that div[i] = 1 if the prefix from word[0..i] is divisible by m, else 0.
You cant store the numbers as they can be very large
Brute force is obvious but interviewer was not ammused, can anyone provide O(n) solution
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: Google
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
Had screening round yesterday. Cant remember the exact question but it was someting along these lines.
You're building a streaming payment validator that receives a number as a digit-by-digit string. At every step, you need to check if the current prefix forms a number divisible by a given integer m.
Return an array div such that div[i] = 1 if the prefix from word[0..i] is divisible by m, else 0.
You cant store the numbers as they can be very large
Brute force is obvious but interviewer was not ammused, can anyone provide O(n) solution