First, they asked me my expected graduate date and my transcript via mail. After I sent those, they sent me a coding assessment that included two coding problems. The time limit was 90 minutes.
There is a string text consisting of at most 10 letters. Replace all occurrences of each distinct letter in text with a different decimal digit. Each occurrence of the same letter should be replaced with the same digit. The choice of digit for each letter does not matter, as long as the digit is different from the digits chosen for other letters. After the replacements, the text treated as a number should be as large as possible.
Write a function:
cpp string solution(string &text);
That, given a string text, returns a string representing the largest number that can be obtained.
Examples:
Given text = "BABBC"
Since letter 'A' can be replaced with digit 8, each letter 'B' with 9, and letter 'C' with 7, the function should return "98997". Note that there are other valid substitutions, for example "12113", but "98997" represents the largest number among them.
Given text = "XYYZZZ", the function should return "988777".
Assume that:
text is within the range [1..10].text consists only of uppercase letters (A−Z).The following metrics were computed from 2 interview experiences for the Google Software Engineering Intern role in Dublin, Ireland.
Google's interview process for their Software Engineering Intern roles in Dublin, Ireland is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Google's Software Engineering Intern interview process in Dublin, Ireland.