I had my first technical interview this week. My only whiteboard question: complete my least favorite challenge, the dreaded recursion.
Prompt:
Create a function that accepts a number and returns the sum of of the Fibonacci numbers up to that number
Results:
Unsurprisingly, I wasn't able to pull off the recursion. In the stress of the moment fixated on that instead of solutions that don't use recursion. But since then I've been wondering why recursion is so difficult for me. This is what I cam up with:
- I don't know where to start
- Although I understand recursion theoretically, implementing it is a different case altogether
- My function never returned my base case
- Why? No idea
- Especially when it's a problem I've seen before, I fixate too much on recreating solutions I've seen
- In this scenario, familiarity worked to my disadvantage. Instead of going line by line, I got frustrated by what I thought the solution should look like
- Nerves and stress
- There's nothing more nerve wracking than writing what should be a valid solution only to get
Range Error: Maximum call stack size exceeded
- There's nothing more nerve wracking than writing what should be a valid solution only to get
- Lack of experience
- As frustrating as failing can be, I do realize that these things- interviewing, solving unfamiliar challenges, even recursion- will get easier with more practice
Conclusion:
Three days after the interview, I'm still frustrated by my perceived lack of progress. But I also feel even more motivated to understand JavaScript concepts better. Instead of recreating code I've memorized, my goal is to
- Understand JavaScript is doing under the hood
- Be able to break complex problems into smaller ones
- Write code that does what I intend for it to
I also want to consume resources like this CSX video that focus on exploring programming paradigms
For now, though, I think it's okay to be a little disappointed in myself