170 points ยท by mattdue ยท 8y ago ยท 100 comments
I am about to be interviewed by one of the big five (they reached out to me, I wasn't actively preparing for interviews).
Not being from a CS or software engineering background, I never took an algorithm and data structure course, and from what I know the coding test mainly involves those.
I know there are a ton of resources online for coding interview preparation, but I wanted to seek suggestions on an efficient/quick resource given that I have strong coding skills but not familiar with data structure/CS algorithm.
I'm excited to be interviewing programmers in the near future as our company grows. I have to think through a lot of things, but I'd like to focus on: Have you successfully deployed an application before? How have you overcome the technical challenges of programming on a team. How have you improved your abilities over time. Explain something you're proud of creating in the format you're most comfortable with. How do you power through losing passion about a project? How comfortable will you be learning new frameworks and paradigms? Prove to me that you're an able programmer in whatever format you'd prefer. Etc.
All questions available ahead of time. Try to keep things comfortable for the candidate. Enough depth and variance to figure out if they have the technical skills you need. You get to see how they like to work.
Owners started tech business using trust-fund money. They were extremely non-technical, scared of computers to be honest. They hired people that were like them (also non-technical), and didn't have the ability to properly vet candidates. Tech staff was hired basically off of Craig's List with very little interviewing. Tech was built and company got large enough to get a couple contracts (heavily influenced by owners' existing personal connections).
As you'd expect, tech stack started creaking under the load. At first tech staff thought they had everything under control (strong Dunning-Kruger effect, bolstered by early successes). Eventually tech staff realized how badly things were going and started lying to management to cover for their own incompetence.
Decent tech management was hired (I think by accident) and the tech staff saw the writing on the wall. The entire tech staff just didn't show up to work one day. Left without any notice or warning (the more intriguing stuff tangents off here). New, more capable tech staff was hired (including me). At this point the system was hemorrhaging data and users. We triaged, stemmed the bleeding, and built out a decent infrastructure with a decent tech stack.
Unfortunately for them that was too late. The contracts had fairly stiff penalties for non-compliance, and the company was in non-compliance for a looooooong time. The owners had made some false statements about the assets of the company, and settlements offered were based on those statement, far too high for the company to pay. Other companies were pissed about that and took it to court. Owners ended up getting taken to the cleaners and lost pretty much everything, including a bunch of assets that they had owned before but transferred to the company (including real estate) in some fairly shady tax dodge scheme.
Ultimately the world is a better place now that this company doesn't exist. It operated in an extremely sketchy manner, and I left when I found out the gist of what was going on. I learned the earlier and later parts of the story from personal connections.
Does that count? I mean, ultimately I think if you have poor engineering talent then it's management's fault. But you can make that argument for any corporate issue: it's management's fault for not recognizing the problem and addressing it soon enough.
Also, to be able to thoroughly study for and prepare for something on one's own, this on itself probably illustrates a lot about this person's qualities already. Of course it would be theoretically nice to spend all this time and energy on something that is unique to every person, but that is not totally realistic and would be hard to evaluate. One can still do that with their side projects though.
It's similar to what happened to higher education: 400 years ago higher-ed diplomas were extremely rare and it were mostly people who really held on to something to study, something to look into, that did those stuffs, and the institution could adapt to their needs individually. However, now that a huge percentage of the population get higher-ed diplomas, there has to be a standardized procedure to stuffs like university admission, issuance of doctoral degrees, etc.
What would you do if you were on the employer's side? Eventually people have to find a compromise and this is the solution that they came up with. Guess if I were on their side it would be hard for me to come up with something better and "safer". Also, it does suck to have to sit for exams which aren't necessarily directly related to the actual skills, but on the other hand I would say that that what I learned via SAT did indeed help my future studies, both in the university and by myself. I guess coding interviews can be perceived as something similar. There's no use complaining about the situation. One just has to face up to it and ace it, especially given how everybody else just has to go through the same. It's not something entirely ludicrous/Kafkasque after all.
Also, to be able to thoroughly study for and prepare for something on one's own, this on itself probably illustrates a lot about this person's qualities already. Of course it would be theoretically nice to spend all this time and energy on something that is unique to every person, but that is not totally realistic and would be hard to evaluate. One can still do that with their side projects though.
๐๐ฎ๐ 01
* Backtracking - know how to solve 1 problem (Knight's tour)
* Tree - implement BST
* Tree traversal - implement DFS, BFS & DFS iterative
๐๐ฎ๐ 02
* Quicksort - know how to implement
* Mergesort - know how to implement
* Binary search - know how to implement
* Min/Max Heap (priority queue) - know how to implement
๐๐ฎ๐ 03
* Graph - implement adjacency list
* Graph traversal - implement DFS, BFS & DFS iterative
* Graph algo - implement "Prim Minimum Spanning Tree"
* Graph algo - Implement "Detect Cycles algo"
๐๐ฎ๐ 04
* Graph algo - Implement "Detect Connected Components" algo
* Graph algo - Implement "Lowest Common Ancestor" algo
* Graph algo - Implement Djikstra single shortest path algo
๐๐ฎ๐ 05
* Sets - Determine all subsets of a set
* Sets - Determine Maximum consecutive subarray sum
* Sets - Determine 2 sets intersection
๐๐ฎ๐ 06
* String - Implement Levensthein Edit distance
* String - Implement Polynomial Hash
* String - Determine all substrings
* String - Find anagrams
๐๐ฎ๐ 07
* String - Implement KNP algorithm for pattern matching
* Basic DS - Implement Queue, Stack, Dynamic array, Linked list absolutely cold
----
I chose javascript as the language for all this brushing up (no need to manage memory, and I can focus on the algo)
It's a big list, but it's a traversal of the CS engineering domain that makes sense to me, and it's only a fraction of the expected knowledge for that kind of interview.
----
Edit: I pushed some of the code of this list on GH here: https://github.com/netgusto/brushup
I struggle to implement each concept in the smallest, simplest way possible. I'll keep adding code as I write it.
If JavaScript is your language then you are likely looking at front end development, in which case it will be much more useful to know about frameworks and testing strategies than CS theory.
Also, JS isn't just for front-end development. Aside from Node.js, which is increasingly a larger player server-side, it's also used in a bunch of desktop apps.
And yes, js is used in other contexts as well, but it is primarily used in front end developer. Which is why I used the word 'likely'.
A disjoint-set data structure is a data structure
that keeps track of a set of elements partitioned
into a number of disjoint (non-overlapping) subsets.
A union-find algorithm is an algorithm that
performs two useful operations on such a
data structure:
Find: Determine which subset a particular
element is in. This can be used for determining
if two elements are in the same subset.
Union: Join two subsets into a single subset.As an interviewee, you know that you're going to have a handful of different interviewers. What you don't know is how much of an effect each of those interviewers is going to have on the hire/no hire decision. Is one bad interviewer enough to torpedo you? Two? And you have no idea what kind of questions each interviewer will ask. So, let's say only 10% of interviewers ask these kinds of questions (I'm guessing that's low). That's a ~41% chance that you're going to have to answer this, and if one bad interviewer is all you need, then you'd be foolish not to prepare just in case.
As an interviewer, we're given surprisingly few guidelines on how to interview. You take a one day class, then shadow half a dozen interviews, and that's it. We aren't given specific questions to ask, and specific questions get banned all the time (any time they're "leaked" as a Google interview question).
Once someone is hired it's really hard to force them out, so approving someone who talks a smooth game but can't back it up is extremely costly. I've seen teams get stuck with multiple people for well over a year because it takes a long time to get them out, they won't leave willingly. Meanwhile they're taking up headcount and letting them actually touch code is dangerous. In fact, I've seen teams spend an additional engineer training them to the point where they are productive, just because that's cheaper.
So you want people to actually prove themselves with some kind of an algorithm question, but you get no real guidance on how to provide these and you constantly have to come up with new ones, but they have to be the kind of question that take less than 45 minutes to explain and solve. I have no doubt that some people fall back on these kinds of questions.
Yeah, I get that these questions suck, and I try not to be that interviewer. But as an interviewee I would consider it extremely foolish to not brush up on it, just in case.
To me, that's step zero. I still can't believe companies like Google, etc get stuck at step 0. They don't seem to care about step 1, 2, 3, 4. It doesn't matter if you have 1 year or 10 years of experience, we all go through step zero (again, even though we got an MS in CS a few years back).
So, if Google ends up in a situation where "teams get stuck with multiple people for well over a year because it takes a long time to get them out", it's because the hiring process at Google sucks. If it is that costly and painful to hire the wrong people, then why Google hasn't put more resources to actually innovate and think beyond college-like evaluations. It is OK for people with zero experience, it is not OK for people with at least one work experience (which I call step 1). Of course, if you have 10 years of experience they need to use a different language in order to interact with you. So, unless someone just graduated from college looking for a job, you can't hire someone exclusively based on step 0 because it simply doesn't tell you if a candidate knows how to write code, build features, work in a collaborative environment, deal with requirements from product team, reuse exiting code, handle code reviews and feedback from peers, create frameworks or adopt new frameworks. All it tells you is if your CS degree is fake or not...
Presumably because it is one of the big five (I didn't know there was such a thing). I suspect it looks good on your CV. You'll always be a big five alumni :-)
Also (again personal opinion) - python is the most practical language for doing interview questions, because interviews are heavily time-constrained and python allows the developer to go from idea to implementation in the shortest amount of time. I'm not going to penalize anyone for their language choice, but somebody who completes the task in 5 minutes and then spends 25 minutes getting bonus points for things like "what if the input data is larger than RAM?" is going to come across stronger than someone who spends 30 minutes on parsing the input and runs out of time before they get to the algorithm.
i'm not sure if python is the best, but it's a very strong choice. python also has a lot of built in data structures that are relatively non-broken and highly useful for the archetypical algorithm-prototyping interview questions
e.g. if you are using a language that only lets you use strings or ints as keys for dicts/hashmaps - instead of say letting you use immutable compound values as keys, or a language that doesnt give you set data-structures which support basic set operations (contains, equal, subset, superset, intersect, union, etc), or a language that requires you to write a paragraph of OOP-boilerplate to encode e.g. a list of pairs of values, you're making life harder for yourself than necessary.
also, i claim without evidence that prolonged and continuous exposure to working with languages that dont offer sensible data structures, or only offer broken data structures, may over time hamper your ability to think and problem solve clearly.
https://app.codility.com/programmers/lessons/1-iterations/
and try to do at least two exercises from each lesson up to lesson 15 if you can. The open reading material at the top of each section is excellent and discusses all the CS theory you will need.
Good luck!
This will not guarantee you a pass โ honestly, some people spend months preparing for the big 5 interviews โ but it may give you a fighting chance, and either way it will give you a good foundation for future interviews.
https://leetcode.com/problemset/all/
And frankly, given your lack of background in this area, it would do you a world of good to get more time to prepare. Try to push the interview back a bit. Even one extra week would be an improvement.
https://leetcode.com/problemset/top-100-liked-questions/
If you've never took any algorithm course and have only a week for preparation, it would be very difficult to prepare for coding interview. But I think you can at least finish all easy problems from this list. In this case, you may at least pass screening coding interview.
Right now, I'm very actively interviewing with pretty selective high-frequency trading companies. I can say that LeetCode has pretty relevant set of interview problems.
One more thing. Even if you solved a problem, always look at description of solution, if there is no description of solution, you should look at discussion.
From there, you can find references to common algorithms/themes like binary search etc.
The good news though is that unless you lied on your resume, they already know that and are still interested in you. So you likely have other characteristics they are interested in.
I would concentrate instead on learning about the company you are interested in. That's something you can do in the course of a week.
Algorithms and data structures are 1-3 classes out of ~45.
I know someone who was able to pull it off in 2 weeks, though they were unemployed at the time. They got into Google with 7 years of prior experience at the time. He admits a lot of it was luck. But it's possible.
I turn up on the day, but then these interviews asking difficult algorithm question seem to be a rarity in the UK, thankfully.
Our interview process seems to be much more reasonable.
It's just a way to see who can learn those algorithms because the big five need to filter out most people somehow. This is their method of doing it.
Also what I've noticed. Since the 90s, I've never been asked one of these algorithm question.
Most of it's just a chat about my CV and what they do. A good interviewer or developer would smell bullshit.
I sometimes get a few basic quizzes or fizzbuzz level exercises, which I don't have a problem with. Usually when I ask about it, it's just an extra filter due to someone in the past slipping through the cracks. Having worked with people who'd fail such tests, it's a good signal knowing my potential team members are at a reasonable standard.
Perhaps...I've seen a few share of those in interview situations or in pre-interview screening tests. I like the fact the fact that is a standard test that every candidate faces. I'm not sure that the nature of the tests has any relation to the type of work one will be required to in some of these places...
https://www.educative.io/collection/5642554087309312/5679846...
Tell the recruiter you need a month to prepare or they will have to skip the CS basic screen for you in order to fast forward the process. If you're one of these niche developers (python/C++), you might have a little power when it comes to asking you the right questions. Same goes when a company originally contacted you, you're in a position of power.
Not trying to correct you, I'm really just curious since I have a similar background and an in a similar situation to the OP.
Ive had interviews that re use the exact same questions (fortune 100 companies)
When you do the interview, do your best and try not to care about the outcome. If you don't care about the outcome, you won't be nervous and you'll likely do better.
Why not stick to data science, which is very hot right now?
Have some friends conduct a few mock interviews every day, giving you some questions you donโt know the answer to. Then have them give feedback on your poise, especially with difficult questions.
You will be calmer and more confident in the rough patches of the interview.
As someone who is coming from another web dev job, not coming right out of college.
Will I still be quizzed on data structures and algorithms? Or will it be more on-topic subjects like frameworks, patterns, architectures, etc?
Perfect if you want to crack something in a week
- Only if they take a completely trivial amount of time
Interviews are a sales process. The test can never really be an accurate assessment of how well you work - we don't even have that for full-time employees over a year, so how well it works over a couple of hours is never going to be that great.
Also, preparation is part of the test. Some interviewers like to ask questions about what you know about the company to see if you've prepared by reading their website etc. I've seen people be marked down with "obviously he didn't prepare for this interview, so he wasn't that motivated".
At some point I think it was intended to be like a 'coding-oriented IQ test', after you'd passed a set of HR checkboxes. Obviously an IQ test you study carefully for is not a broadly applicable measure of relative performance. As far as I understand, many of the top companies are shifting away from this interview paradigm, but it'll take the rest of the industry which adopted it a long time to catch up (I imagine).
* Minimize the time spent by their engineers interviewing candidates,
* Standardize the process as much as possible, so that anyone can run the interview.
I'm convinced there are many reasons for smaller shops not to blindly follow Google's practices. But as a candidate, what can you do... it's their loss, I guess.
You are competing against other people. If you are not particularly interested in winning then by all means don't do any training. Same deal for athletics.
I think programmers are more reflective and analytical than people from other industries, so programming as an industry gets a lot of flak from the inside, but I really believe it's no better anywhere else.
"Half of programmers can't program! What's wrong with this industry?" Half of everyone is completely and utterly incompetent at whatever they're paid to do, why do you think we're special? Programmers just happen to notice these things.
"The interview process is broken!" Yeah, so it is everywhere else, programming is just the only industry where someone would possibly even care about whether something is insane or not.
'Tis my two cents.
But look at it this way: if you want to hire a musician to a band, and you do large scale hiring, you probably want to put some minimum requirments like being able to play, and maybe handling rudimentary musical theory and being able to read sheet music. CS 101 stuff is exactly this - you understand the fundamental concepts and are capable of conversing in them.
Musicians who have formal degrees are understood to handle the basic theory and everything that matters is how well they can play.
There is no degree in CS that would guarantee you understand the fundamentals or you know how to combine the basic concepts into practice. I presume this is one of the rationales for whiteboarding.
Of course, there are all sorts of weird and wacky bands that have other hiring policies but the big five are not weird nor wacky.
Apparently how well the hiring went does not predict anything abouy on-job performance, but probably some whiteboarding will not let those people in who would be totally incapable of operating with basic CS theory. Sure, this leaves lot of potential talent out, but often hiring a bad apple is lot more expensive than discarding an ok candidate.
Who's 'N'? If it were an 'M', I would imagine Microsoft, but nothing comes to mind except 'Netflix', which I don't consider to be on par with the rest of the group by any means.
Company knows how the interview prep is, and the candidate that understand more how to solve non-trivial problems can be the right service provider for that company.
I'm not talking by experience but what I was taught, I'm currently finishing my university but the Data Structure and Algorithm course is one of the most difficult to pass and that's only basic structure. A candidate able to think fastly about dynamic programming or structure a possible solution for a NP-complete problem can provide a service that others candidate can't.