- The first problem was to figure out how many numbers in an array are a power of some number k. Basically you check whether repeatedly dividing by k eventually gets you to 1, but you have to watch out for the special case where k=1.
- The second problem was about a planet's lunar calendar: given the moon phase at the start of the year, compute the moon phase on a given date. The phases cycle every 8 days, so you calculate the total number of days first and then work out the offset — but you have to be careful not to mix up how many days are in each month.
- The third problem was about bubbles popping — it's already been covered a lot on the forum.
- The fourth problem was to find pairs of numbers in the array that can be made equal with at most two digit swaps — just compare the digit differences. I failed quite a few test cases on this one though.
Overall these were all long, tedious problems with a lot of reading and context, and it was all about writing logic — nothing fancy algorithm-wise.
Time was still a bit tight. I came straight here to write this up right after finishing the interview.
Discussion
Loading comments…