3 ms·
The last good paying work I had I somehow passed the coding interview, but I bombed out of the last few I had and went back to basics. I signed up to Project E
by Mc91 8y ago
The last good paying work I had I somehow passed the coding interview, but I bombed out of the last few I had and went back to basics. I signed up to Project Euler and Hacker Rank and have been doing problems from them.
What I do is start the Linux program "recordmydesktop", and then go about solving the problem as if I am interviewing, i.e. on the clock.
One thing I noticed is these programs use maps, characters, use 64 bit long numbers, do string manipulation, do certain type conversions and so on more than I usually do programming. Some of these things I would usually look up, such as how to type convert a character '7' to an integer, or create and populate a multi-array and things like that. So I made sure how to memorize how to do these test-tending things.
Then I watched over my recordmydesktop sessions to see where I ran into trouble. I noticed array one-offs were a problem - getting an index out of bound error, using < instead of <= etc. Or I would declare a variable before a loop and use it initially, but forget to assign or reset it at the end of the loop when it needed that. Sometimes I would declare a variable like k and then re-use it in the same method. Also, if I ever have to switch to a web browser to look up what call does a string reversal, I note that as well, and if it is common enough, I memorize how it is done so I don't have to look it up again.
Memorizing the string manipulation, map etc. functions is already working for me. I am getting better at some of the other problems, like not assigning/resetting variables at the end of loops (I put a comment next to them that they will need to be assigned/reset, and then do it later, and then erase the comment). Some I still have to work on, like reasoning about exactly where the array boundary is. These aren't things I mess up necessarily, but things that slow me down, and cause bad compiles or runtime errors.
I can already see the improvement in the problems I am doing. I had been letting myself naturally memorize some of these things, I guess it's not so bad that I am memorizing more of them that I may need.