Courses
Google Coding Interview
Google's angle: arrays and strings done exactly right, one careful step at a time.
- Islands
- 8
- Lessons
- 72
- Exercises
- 250
Complete codeDebugCode orderMultiple choiceTapTrace
Island 1Weave two strings together one letter at a time, appending whatever remains of the longer one.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 2Decide whether an integer reads the same forwards and backwards — without turning it into a string.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 3Convert a Roman numeral to its value, honoring the six subtractive pairs like IV and CM.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze4 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 4Merge a second sorted array into the spare tail of the first — in place, without losing elements.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 5Find the length of the longest run of consecutive integers hiding unordered in an array.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 6Read a matrix in spiral order — around the outside and inward ring by ring.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min
Island 7Pick the two walls that hold the most water — area is width times the shorter wall.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze4 exercises, 5 min
- Boss BattleBoss8 exercises, 8 min
Island 8Rearrange numbers into the very next arrangement in dictionary order — in place, wrapping to smallest from the last.
- Decode the Problem3 exercises, 4 min
- Approach Check4 exercises, 4 min
- Build the Brute Force3 exercises, 5 min
- Find the Bottleneck2 exercises, 4 min
- Discover the Optimal Approach3 exercises, 4 min
- Assemble the Algorithm2 exercises, 5 min
- Read the Implementation3 exercises, 5 min
- Test and Analyze3 exercises, 4 min
- Boss BattleBoss8 exercises, 8 min