Introduction
Learning to code does not happen overnight; is it what it is, and there are no two ways about it. For the past two years I’ve been on the journey to become a better web developer and it has been a heck of a ride. There were highs and lows, times when I felt like just giving up and times when I didn't want to look away from my computer screen, intense stress and exhilarating satisfaction. All in all, I think that budding developers must go through these experiences to become really good at their career.
Based on my own experience, I feel like there are many stages that developers go through in their careers and I’m sure many of you have had the same experience -
- Stage one: we just want to start coding. We barely know anything about anything and just jump on every new technology that pops up.
- Stage two: we realize that stage one just has us going in circles and we decide on one area to really focus on.
- Stage three: We begin the long and tough process of getting really good at that area.
- Stage four: we start looking at job options.
- Stage five: hopefully we’ve found a job and continue to refine our skills, if we don’t find a job, we continue to refine our skills till we get one.
This short book will focus on stage four, where you’re ready to get a web development job or looking at job options. The average person may think they'll be ok once they know their way around HTML, CSS, JAVASCRIPT and a couple of frameworks (Angular or React maybe). Unfortunately, that is not the case. While doing my own research on the type of questions that pop up in these developer job interviews, I quickly found that those technologies are secondary to one major focus – Problem Solving. I'd really like to help the up and coming developer get better prepared to handle these problem solving questions and to do that, we'll be using leetcode.com.
Leetcode.com is an awesome website that provides interview questions aimed at helping programming job seekers prepare for their interviews. It is a really good resource for practicing those questions that don’t test your general web development knowledge but your problem solving ability. To help you get started I’ve compiled my solutions and explanations for fifteen of the easy questions from leetcode.com using JAVASCRIPT. I should note that even though these solutions where accepted, they may not be the most efficient way of solving the problems. This book is more focused on reasoning out a solution to the problems and engaging the readers' thought process rather than the solution itself.
My real motivation for writing this book came from the difficulty I had with some of the questions that were tagged as 'easy'. There are some algorithms on here that I solved in 5 minutes, some that took me over an hour and some that I just couldn’t solve myself and had to do some research online to get a hint about the solution before I could solve it. While doing my research on these solutions, I also found that it took me a really long time to find the right answers. There was no one place I could go to and get the answers I needed for JAVASCRIPT specifically - even on leetcode.com.
I hope that this short look at my solutions will help you to get a better understanding of JAVASCRIPT and help with the way you approach programming problems. Let's dive in.