Member-only story
Top 5 Hardest Coding Questions From Recent FAANG Interviews
Do you know the dining philosophers problem?

It seems like coding interviews are only getting harder, and preparing for them isn’t an easy task. There’s no limit to the kind of questions that may be presented to you in an interview, and many of them aren’t easy. The “hardest” questions will be different for each person. What comes easily to you may be extremely difficult for someone else — and vice versa.
No matter what your “hardest” questions are, it’s crucial to prepare yourself for your coding interview. We talked to junior and senior developers for their take on the hardest coding interview questions, and we compiled the top five into a list. Today, we’ll explore that list in more detail and give you some tips on how to prepare.
We’ll cover:
- How to design a garbage collector
- The coin change problem
- The dining philosophers problem (multi-threading)
- Why use these programming best practices?
- How to implement an LRU cache
- Next steps to prepare for interviews
1. How To Design a Garbage Collector
If you’ve never heard of it, the garbage collector problem is known to be very difficult. Garbage collection is a topic that most people don’t learn about in school, and the related material is extremely dense. Learning about garbage collection involves a lot of theory, which can be overwhelming. No matter what language you work in, it’s crucial to know the ins and outs of your preferred language to solve this problem effectively.
Don’t be afraid to ask your interviewer questions as you work through this problem. Remember that your interviewer is there to help you and wants to see you do well. It’s common for interviewers to give you little seeds of information to help push you in the right direction.
Note: Garbage collection questions are especially common in core and advanced Java interviews, but they are also important to know for other programming languages.