Apple - Senior Software Engineer - Tech Screen
Description Template:
Level: l5
Education: Masters
Years of Experience: 10
Questions Asked:
- Find a permutation of string s1 in string s2
Create a map of characters to number of occurences and a variable tracking how many unique characters we have. Go through s1 and fill in the map and the unique variable. Now go through s2 and on every iteration add one symbol to the map and substract (currentIndex - s1.length) symbol from the map. When unique characters === 0 you found the answer. - Merge 2 sorted Linked Lists
Just use the 3rd list and pick the smallest head node of those 2 lists and advance the list from which you picked