2
donuts
5y

Is HackerRank a good site to prepare for technical interviews? And I guess the general question is how to best prepare?

The problems are interesting but it seems most of the Medium+ ones require knowledge of a specific approach or the large test cases will terminate with timeouts or out of memory.

Been sitting on this for a week. Just implemented the recursive versionwhich is better but now times out.

https://hackerrank.com/challenges/...

Comments
  • 1
    Check out longest common subsequence, it's a good introduction to dynamic programming
  • 0
    Also if you already have the recursion you can memoize the results of each call by storing the result of each call with the input parameters as the key (indexes into a 2d array in this case)
  • 0
    @beegC0de yes that's what I did... Maybe it's just a Java problem... Asked my CS BRO... solved in 10mins... In c++.
  • 0
    @billgates he may not have used recursive calls, you can solve it iteratively by working backwards from base cases
  • 0
    @beegC0de no he did but much simpler than what I did. I guess he just recognized the problem set and knew what the solution would like like although it feels like now Algorithmic coding is just like a different thing from application/OOP coding.

    Low level primitives, arrays vs classes.
  • 1
    @billgates no that's just c++, nicer languages make it much nicer to look at
Add Comment