Google Interview Report
- 0of 0 votes
AnswersGiven the width, height, start point, end point of the grid, and a list of points, you have to go through these points, ask how many paths are there from the start point to the end point, you can only move from (i, j) down and right.
- ajay.raj December 12, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1 - -2of 2 votes
AnswerThe design of two functions, cyclecount (num, mod), cycleHistogram (low, high, mod). Probably, cyclecount (num, mod) do digits square sum mod operation. For example mod (12), mod (5) -> square (1) + square (2) mod 5 = 0 -> square (0) mod 5 = 0. Stop return 2. Finished digits square sum after take mod, mod and before the formation of a repetitive cycle. Return form the size before the cycle. CycleHistogram (low, high, mod) will give a [low, high]. Then return a histogram which stores the number of [low, high] inside the cycle size 1,2,3,4,5.
- ajay.raj December 12, 2017 in United States| Report Duplicate | Flag | PURGE
Google SDE1