Checksum Validation Generator

(Google)
You are given a lowercase English string s, a string validation_string, and an integer k. Your task is to generate a final validation string based on the following rules:
Chunking: Divide the string s into consecutive substrings of length k. If the length of s is not perfectly divisible by k, the final substring will contain the remaining characters.
Every lowercase English letter has a fixed integer value corresponding to its alphabetical position (i.e., a = 1, b = 2, c = 3, ..., z = 26).
For each substring, calculate its checksum by summing the values of all the characters within it.
For each calculated checksum, select a character from the validation_string using the index checksum % len(validation_string) (0-indexed).
Concatenate all the selected characters in order to form and return the final validation string.



Get one-to-one training from Google Facebook engineers

Top-notch Professionals

Learn from Facebook and Google senior engineers interviewed 100+ candidates.
Most recent interview questions and system design topics gathered from aonecode alumnus.
One-to-one online classes. Get feedbacks from real interviewers.

Customized Private Class

Already a coding expert? - Advance straight to hard interview topics of your interest.
New to the ground? - Develop basic coding skills with your own designated mentor.
Days before interview? - Focus on most important problems in target company question bank.