Email Chunk Verification
Updated
Problem statement
Given a string email, a lookup string verification, and a positive chunk length k, return a verification string.
Split email from left to right into consecutive chunks of at most k characters. For each chunk, sum its character values, take that sum modulo verification.length, and append the character at that index in verification.
Character values
Lowercase letters have values a = 0 through z = 25, and :, /, and . have values 26, 27, and 28, respectively. Lookup indices start at zero. Include a final chunk even when it contains fewer than k characters. Reset the sum for each chunk. The input name is only a label; this task does not validate email-address syntax.
Return the selected characters in chunk order. Do not modify either input string.
Function
emailChunkVerification(email: String, verification: String, k: int) → StringExamples
Example 1
email = "abcde"verification = "wxyz"k = 2return = "xxw"Chunk sums are 1, 5, 4. Their remainders modulo 4 select "xxw".
Example 2
email = "a:/z."verification = "0123456789"k = 2return = "628"Chunk sums are 26, 52, 28. Their remainders modulo 10 select "628".
Example 3
email = "xyz"verification = "abcdef"k = 8return = "a"Chunk sums are 72. Their remainders modulo 6 select "a".
Constraints
1 <= email.length <= 10^5and every character inemailis a lowercase English letter,:,/, or..1 <= verification.length <= 10^4andverificationcontains printable ASCII characters.1 <= k <= 10^5;kmay exceedemail.length.
More Google Online Assessment questions
- Minimum Operations to Make a SubsequenceOA · Seen Nov 2026
- Book Reading EveningsOA · Seen Nov 2026
- Count Score CategoriesOA · Seen Nov 2026
- Minimum Cars for Rental RequestsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Shortest Path in a Binary MatrixOA · Seen Nov 2026
- Robot Assembly Line ConflictsOA · Seen Oct 2026
- Assign LockerOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Biggest Number From DigitsOA · Seen Oct 2026
- Consolidate On-Call RotationsOA · PHONE SCREEN · Seen Oct 2026
- Decreasing SubsequencesOA · Seen Sep 2026
Similar questions at other companies
- Branch with the Most FilesCapital One · OACapital One interview questions
- Robot Stops Left or Right (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
- Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
- REST API: Highest International StudentsRippling · OARippling interview questions
- Rearrange String by Alternating EndsHudson River Trading · OAHudson River Trading interview questions
- Filter Isolated Interior Signal BitsSEDEMAC · OA
- Scale Ingredient QuantitiesUpstart · OAUpstart interview questions
- Telephone Keypad String EncodingEpic · OAEpic interview questions
- Count Invalid Log GroupsIBM · OAIBM interview questions
- Count Case-Insensitive TripletsTikTok · OATikTok interview questions