Skip to content

brightsunp/50-coding-interview-questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

50-coding-interview-questions

Don't do another coding interview... Until you've mastered these 50 whiteboarding questions.

—Sam Gavis-Hughson, founder of Byte by Byte

You can subscribe these problems from here. Really appreciate it to Sam.

Guide

Learn how to develop a systematic approach to each problem as follows:

1. Understand the problem

Understanding exactly what is being asked is critical to your success. Ask any clarifying questions necessary. Look at the input and figure out how that resulted in the given output. If you see any obvious problem areas or edge cases, add in your own example. Based on the input and output, what should be the signature of your function?

2. Find a brute force solution

The brute force solution makes you really understand the problem, and guarantees that you find a solution. Far too many people try to jump into an optimized solution and get lost. It's really hard to recover without simply starting over, and in an interview you definitely don't have time to start over.

3. Optimize the brute force solution

Time to shine yourself. But you shouldn't spend more than 5-10 minutes on this step before moving on to coding. Try brainstorming more efficient data structures, looking at duplicated or unnecessary work, or just looking for more efficient solutions unrelated to your brute force solution.

4. Code the solution

Since you've done all the legwork, coding should be the easy part. If not, it's worth dedicating time to practicing coding, particularly on paper or a whiteboard.

5. Test the solution

This final step is critical. Not only does it show your interviewer that you're careful and thorough, it gives yourself the confidence that your solution is correct. Go through the code line by line. Missing small typos or indexing errors could leave a bad taste in your interviewer's mouth even if you did well otherwise.

Problems

Array(1-14)

Graph(15-16)

Recursion(17-26)

Stack(27-31)

Bit Manipulation(32-37)

Linked List(38-44)

String(45-51)