Anyone ever been invited by Google for a programing challenge?

Started by Legend, Apr 06, 2023, 03:33 AM

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

the-pi-guy

Very slowly still going through this.

Solving problem #4 was kind of cathartic.

Found a good recurrence relationship (where solving for q(n) requires solving for smaller values. Was running into an issue where it was running immensely slow. Smaller values than 70 were running almost instantly. Larger values didn't seem to be finishing. I ran it for like 10 minutes and it never finished.


Added a hashmap to store older results, but it wasn't having the expected performance improvement.

Went to bed at midnight. 5 minutes later, had a feeling that I was checking inputs against the outputs, instead of checking inputs against previous inputs.

Fixed that. It ran nearly instantly even for very large values, and immediately showed that it solved all the test cases. Whereas before google would hang for a good minute before telling me several cases failed.

Actually gave me similar feelings to beating a Dark Souls boss.   ;D

Legend

Actually gave me similar feelings to beating a Dark Souls boss.  
That's what I loved about some of these challenges. You know it's expected to be possible so you just keep coming back to try again.

the-pi-guy

Spoiler for Hidden:
<br>First one was breaking down N into squares. <br>Second one was finding the parent of a node in post order. <br>Third one was ?? I don&#39;t remember.<br>Fourth one was strict partition function minus 1<br>Fifth one was finding the depth based on a recurrence relationship.<br>Sixth one was also basically finding the shortest depth based on a recurrence relationship.


5th one was kind of fun. I made like 2 different ways to solve it. One traversing down the tree, and the other traversing up. And kind of a third way that optimized it.  

6th one was goofy for me.

I came up with a nice way to do it, and then apparently thought it looked too easy, and came up with a dumber solution a couple days later. Realizing my dumber solution simplified to the previous one.   :'(

the-pi-guy

Got booted for going over time.  

Had two weeks. Was planning on doing it last weekend, and then stuff came up. And this weekend I was exhausted and undergoing time crunch.

A little disappointed that I only made it to the 8th problem I think.  

On the other hand, I'm feeling relieved.  

Schools Out Free GIF - Schools Out Free Freedom GIFs

Legend

Got booted for going over time.  

Had two weeks. Was planning on doing it last weekend, and then stuff came up. And this weekend I was exhausted and undergoing time crunch.

A little disappointed that I only made it to the 8th problem I think.  

On the other hand, I'm feeling relieved.  

Schools Out Free GIF - Schools Out Free Freedom GIFs
I can only imagine how freeing that must feel. You've been on this for ~2 months!

Your questions were pretty complex. I didn't even want to think about the last one.

Go Up