Hey devs from all over the worldπ
I have been doing interviews lately and I still have a couple to tackle. That's why I have been on Codewars & Hackerrank, Solving some coding challenges in preparation. After all,
βBy failing to prepare, you are preparing to fail.β β Benjamin Franklin
As a frontend developer, I rarely encounter code challenges at my day to day work. Don't get me wrong! I know they are important, I am just saying they are more important in the interviewing phase.
The issue is. I feel like I need to get better at coding challenges. I am not all bad. By Hackerrank standards, If It's an easy one I can do it. If its a medium I struggle. Some mediums are ok, others I have to look at the discussions to get ideas. If it's hard, I don't even bother.
Most interviews don't ask around the hard level anyway. In my experience, they somewhat below the medium level. Maybe because I am interviewing for junior to mid-level positions. However, solving those challenges live is a whole different story!
My strategy up till now is to solve as much as I can. But, I find myself wondering...
- Are there any other strategies out there?
- Is there a way to get better at them other than solving as much as you can?
- Are there some concepts out there (Math or programming) that someone needs to know before even trying to solve a coding challenge?
- How do you guys prepare for coding challenges in interviews?
Top comments (6)
I think the key here is that you'll get better by practicing. Solving coding challenges requires a unique thought process that doesn't come up regularly in your day to day - so you'll need to practice on your own to feel more comfortable with it.
You can also watch a few youtube videos of people solving problems during interviews. It will help you get a feel for how the interviews go and how to approach them.
Another thing - research the company you are interviewing for as best you can. I was able to find interview details on glassdoor for many companies before applying. Keep in mind they might switch up their process regularly so it might not be the exact same problems but you'll get a feel for the level of difficulty.
Think about it like this, if you wanted to get better at playing the guitar how would you do it? Play more guitar. The same concept applies to solving challenges. Best of luck for your future interviews!
Thanks, Carson. Yeaah I agree with you. I just have to man up and solve as much as I can.
I find myself wasting a bunch of time on some problems tho. What do you think is better taking my time and ending up with my solution or just look at people's solutions for help to save time.
I mean committing to a hard challenge could take all day, Looking at the solution and figuring the idea out won't
Give the problem a fair shot. Get out your notebook/whiteboard and draw it out. Trying to work through it in your head is tough. Also interviewers will appreciate seeing your thought process visually.
If you get to a point where you are totally stuck and have sunk a bunch of time into it then consider looking at others solutions and try to really understand it.
There isn't one right away to approach it so its up to you to figure out what your balance is. With time you'll be better at solving them and thus more prepared for your interviews!
Thanks, Carson.
Have you tried other websites that aren't hackerank? Check out exercism.io for instance. Sometimes a change in environment helps us to overcome mental barriers :)
When I get stuck, I usually sketch out the problem on a notepad. Sometimes I'll write full code in pen!
Thanks, James. I will definitely try switching environments.
Notepads for sure makes a ton of difference.