On the bright side, something of an industry has been built up around preparing people for tech company interviews (similar to the SAT prep industry). Check out Gayle McDowell's Cracking the Coding Interview, CodeKata, or Interview Cake.
It can be demotivating, but don't give up, and take a look at some of your algorithm books. Or cut to the chase:
Gayle also has a number of YouTube videos such as:
and a web site:
Elements of Programming Interviews: The Insider's Guide by Adnan Aziz
Programming Interviews Exposed: Secrets to Landing Your Next Job by John Mongan, Noah Kinder, and Eric Giguire
If you want to take that approach, and say "f%!# it, I'm going to buckle down and work my ass off so I do get the job next time" there are a few concrete steps you can take.
1. Find, read, and do the exercises in two or three of the various popular books on "programming interviews". I'm thinking of books like Cracking the Coding Interview, Programming Interviews Exposed, Ace the Programming Interview, etc.
2. The companies you mentioned are well known for asking lots of detailed questions on fundamental computer sciences concepts. If doing "big o" analysis and talking about algorithms in detail isn't your forte, get a couple of good Algorithms course books and go through them. Personally, I'm a fan of the Robert Sedgwick books, and the CLR book is a standard in this area.
3. Look over the many various articles / blogs / etc. written about preparing for Google interviews.
I have never applied to Google myself, so I can't speak to that from first-hand experience, but this Steve Yegge blog post always struck me as being excellent:
4. Take as many interesting Coursera, EdX, Udemy, etc. courses as you can find time for.
5. Write code any chance you can. Get involved in, or start, an open source project (or two). Volunteer to code for a non-profit / charity or something in your area. Write an app for yourself, to fill a need of your own.
6. Make sure you broaden your horizons and challenge yourself. If you've always written, say, Java or C++ or Ruby code, then make an effort to learn Go, or Erlang or Haskell or Prolog.
All of that said, as I've gotten older, I probably feel a little bit less of the "I'll show you!" thing. I've developed more of a stoic approach, and almost a bit of a zen mindset. There's a lot to be said for a sort of calm, peaceful acceptance of things, even when they are negative. There's a lot more one could say about this, but I don't want to get too philosophical here. I'll just point out that you applied to two... TWO.... companies. Out of like a BILLION possible companies you could work for. Ok, maybe not a billion, but certainly millions, or thousands, depending on where you live and your willingness / ability to travel.
My point is, don't put too much weight on what happened with Google or Amazon. The whole "dream companies" thing is a crock of shit, IMO, looking back on it with hindsight. I've worked for two companies in my career that I once thought of as my "dream" destinations, and neither experience was anything special (neither was bad either), and not worth getting all worked up over.
Final last bits of advice.
1. Read Nietzsche
2. Read Ayn Rand
3. Get drunk
4. Listen to some Queensryche
Easy for me to say, since I find problems like those easy; I cranked through a few dozen of them with only having to really think about a couple.
If you can't answer them all yet...well, now you have something specific to study.
In their best form, these types of questions are a litmus test for whether you have a certain type of background. When they fail it's because they test for skills not required by the job. It's fashionable to complain about this, but it seems to me to be more practical and useful to just get better at answering these sorts of questions. Leveling up from "terrible" to "adequate" at this will take less time than you think, and due to the craigslist penis effect will put you way ahead of the game.
Easy resource to get started: https://www.interviewcake.com/
This book is pretty well regarded: http://www.amazon.com/Cracking-Coding-Interview-Programming-...
Btw, anyone with better starting places for this, please jump in.
i've actually been working on learning angular for the past few weeks. i've stopped updating my github in that time since i'm just doing basic stuff, but once i finish some more tutorials and documentation i plan on building an angular project to display on my github. are there any particular features that would really catch your eye as someone who hires programmers?
any suggestions regarding the coding interview problem? i see http://www.amazon.com/Cracking-Coding-Interview-Programming-... recommended a lot.
You can see the proof for yourself when you burn through the following two books within the three months.
You need to spend 4hrs+ on weekends though. You will get to talk to candidates already working in the top companies and will be working in a group of 20+ highly motivated and intelligent peers.
2.) Work through one of the popular coding interview books .
3.) Practice off-keyboard things like white-boarding and public speaking. Get up in front of your white board and work through a problem like you're teaching a class on the subject.
I recognize that 1 and 2 might feel like gaming the system a bit - they are, but as long as companies continue to practice contrived interviews targeted preparation will naturally follow.
As stated, you don't lack the ability to perform in general, just within the artificial confines of an interview.
Casually mentioning that your day is full of interviews should help you appear more desirable..
So, perhaps this can get you started.
I plan on getting a copy of: http://www.amazon.com/Cracking-Coding-Interview-Programming-... too.
I strongly recommend
- Algorithms in a nutshell from O'Reilly (http://www.amazon.com/Algorithms-Nutshell-In-OReilly/dp/0596...)
- Cracking the Coding interview (http://www.amazon.com/Cracking-Coding-Interview-Programming-...)
Those two books are perfectly concise and straight to the point to understand and learn exactly what you feel you are lacking as a self-taught programmer.
The first one will teach you what you have to know, putting everything into work context, making it really easy to understand why and how this or that algorithm is useful.
Cracking the coding interview then offers really good challenges to practice and master those algorithms. And of course, if you are interested in getting a job, will perfectly prepare you for that ;)
Prior to my first technical interview I spent tons of time studying algorithms and data structures. Looking back I feel that my time would have been better spent selecting several sample questions (such as the ones you included) and solving them on a whiteboard over and over again (and checking and improving them along the way).
For questions check out careercup.com, glassdoor.com, project euler, and the Cracking the Coding Interview book: http://www.amazon.com/Cracking-Coding-Interview-Programming-...
The more practice you have, the faster you will be able to: recognize what type of problem a particular question is, come to an initial solution, and improve upon that solution.
Feel free to reach out to me with any questions! (contact info in my profile)
Why the rejetions? Has any company told you what exactly were the reasons for rejection? Ask for a reply from the interviewers and the specific questions. Don't get those questions wrong again.
I contribute to a plethora of open source projects in a range of languages such as
C++, Perl, Python, and even various Lisp-like languages.
Well my bookshelf is stocked...
I enjoy mathematics. ...
And for all of this I still blunder my way through...
I still draw a blank when asked what the magnitude of complexity is for the guests
function I just wrote.
My input is N, and I loop from 0 to N, hence complexity is O(N).
I loop twice, so complexity is O(2N).
The input is M and N, my function has nested loops, 0 to M, 0 to N,
complexity is O(M * N).
My input is N and I divide and conquer recursively cutting in half...
that's (N/2)/2)/2)/2... lg N!
I'd also recommend studying for interviews seriously. Cracking the code interview, http://www.amazon.com/Cracking-Coding-Interview-Programming-..., it helps quite a bit.
Edit: It looks like the author of the above has a newer book out called "The Google Resume", probably worth taking a look at too.
MIT's IAP course resources are pretty good too: http://courses.csail.mit.edu/iap/interview/materials.php