Why top software companies ask CS fundamentals in tech interviews?
It is a well known fact that companies like Google, Facebook, Amazon, and Microsoft ask questions involving CS fundamentals in tech interviews even for candidates with years of industry experience. Questions like “Implement an LRU cache” or “Detect a cycle in a graph” are frequently used to test candidates irrespective of seniority or past industry experience. I have met many seasoned engineers who find it frustrating or confusing that companies would ask them such questions. Some of their reasons for not wanting to be asked questions like these are:
- I have never needed to implement an LRU cache. Do engineers at company X really waste their time implementing it?
- I am a senior engineer with N years of experience as a <insert framework here> expert. I can’t be bothered to remember CS fundamentals. Why don’t they ask me about <same framework here>?
- It’s been many years since college and I would just use an open source library for this.
- How is this relevant to day-to-day at that company?
All seemingly valid concerns. And yet these companies ask these questions. And have some of the world’s best engineers working for them. So why do these companies ask CS fundamentals and how does that translate into great engineers? In my opinion it is for the following reasons:
- They need fungible engineers. Google, Facebook, Amazon, etc. have hundreds if not thousands of simultaneous projects dealing with robots with realtime operating systems to mobile applications to compilers. Engineers are coding in every language and every paradigm imaginable. They need engineers who can quickly learn new stacks as the company strategy shifts. Strong CS fundamentals allows engineers to quickly pick up a new language or new programming paradigm. Engineers with strong fundamentals can become experts on specific frameworks quickly but the converse is not necessarily true.
- They invest heavily in training. Smaller companies are usually entrenched in a specific stack or framework and it behooves them to hire people who are already familiar with the technology since they don’t often have the resources to train someone on the technology. Whereas large companies are able to invest significantly in training fungible engineers onto new tech.
- CS fundamentals are important. I actively interview candidates. Do I expect people to implement an LRU cache? Absolutely not. But I expect them to be familiar with the trade-offs in selecting data structures to build something like that. On multiple occasions a simple fix to a service just changing the underlying list implementation has shaved off response time by 50%. And when your service serves thousands of requests per second, this kind of optimization can result in thousands of dollars being saved.
- Being able to solve problems outside one’s comfort zone is important. As interviewers and engineers we know that you have not had to solve this kind of problem since college. But that is the point. Candidates should be able to solve problems that are not in their wheelhouse. Good candidates will keep their composure, make reasonable assumptions and suss out their knowledge to solve problems. Working at these companies is all about solving problems one has never solved before.