InterviewNoodle
Published in

InterviewNoodle

You have 2 free member-only stories left this month.

The Ultimate Strategy to Preparing for a Coding Interview

How to prepare more quickly for coding interviews

Sample Problem for Binary Search: Bitonic array maximum

Example: Input: [1, 3, 8, 12, 4, 2], Output: 12

Solution

Code

Sample Problem for Two Pointers: Pair with the target sum

Example: Input: [1, 2, 3, 4, 6], target = 6, Output: [1, 3] (The numbers at index 1 and 3 add up to 6: 2+4=6)

Solution

Code

Sample Problem: K closest points to the origin

Example: Input: points = [[1,2],[1,3]], K = 1, Output: [[1,2]]

Solution

Code

Sample Problem: Subsets

Example: Input: [1, 5, 3]
Output: [], [1], [5], [3], [1,5], [1,3], [5,3], [1,5,3]

Solution

Code

Sample Problem: Binary Tree Path Sum

Solution

Code

Conclusion

Thanks for reading

Get an email whenever Arslan Ahmad publishes.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

One stop learning portal for your next coding and system design interview.

Share your ideas with millions of readers.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store