Google Interview Report
- 0of 0 votes
AnswersTo a binary array, if you want to move 1 to the array side, 0 to the other side, Can only swap two adjacent elements each time, ask the least number of swap Why? For example, the number of min swaps for [0, 1, 1, 0, 0] is 2 (01100 -> 10100 -> 11000)
- ajay.raj December 14, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
AnswersGive a string that outputs the largest alphabetical order of all consecutive substrings For example, "ab", substring has {"a", "ab", "b"}, output "b"
- ajay.raj December 14, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
AnswersbalanceSum, return to the array to meet the minimum sum equal to the minimum index. Title conditions are all positive numbers, the array length> = 3, there must be solution. If a = [1,2,1,3] returns 3 because a [1] + a [2] = a [4]
- ajay.raj December 14, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
AnswersIf xi<xj,yi<yj, we say (xj,yj)dominates(xi,yi). Given a set of number pairs (xi,yi),
- ajay.raj December 14, 2017 in United States
how many indomitable pairs are there?| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
Answersstream reading number, with timestamp, Design data structure to know the minimum value of the past year, the average,
- ajay.raj December 14, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1 - 2of 2 votes
Answersgiven two strings a and b.
- ajay.raj December 14, 2017 in United States
print out the minimum number of flips of the characters in a such
that a is an anagram of b.| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
Answerssorting nested dictionaries
- ajay.raj December 14, 2017 in United States
give a
{b: {cb: cranberry, bb: blueberry} a: apple, c: cherry}
{a: apple, b: {bb: blueberry, cb: cranberry}, c: cherry}
To sort the key output, if there is nested dictionaries, but also to sort| Report Duplicate | Flag | PURGE
Google SDE1 - 0of 0 votes
AnswersMark likes to listen to music while travelling. His iPod™ contains
- ajay.raj December 14, 2017 in United States
N songs and he wants to listen to L (not necessarily different) songs during
a trip. So he creates a playlist such that:
• Every song is played at least once.
• A song can be played again only if at least K other songs have been played
Mark wants to know how many different playlists are possible. Can you help Mark determine this number?
As the number can be very large,
display number modulo 1,000,000,007.
You are given N, K and L.| Report Duplicate | Flag | PURGE
Google SDE1