Problem Solving Technique #1 for Coding Interviews with Google, Amazon, Microsoft, Facebook, etc.
Skills:
Algorithm Basics90%
Key Takeaways
The video discusses a problem-solving technique for coding interviews, specifically thinking on paper to conceptualize a solution before writing code, using an example of finding two integers in an array that multiply to 20. The technique involves breaking down the problem, considering multiple solutions, and using data structures and algorithms to implement the solution.
Full Transcript
in the next few videos I'm going to introduce you to the three problem-solving techniques I've personally used to get the recording interviews with companies such as Google and also to be a better software developer in general the first tip I want to give you is to think on paper when I say think on paper I don't literally mean when you get a coding interview problem take out a piece of paper out of your pocket or whatever and start writing down your thoughts right there this is more about how you think about the problem and not about using physical paper per se so to see what I mean exactly let's take a look at one example of this suppose you're given this problem in which you're supposed to write a function that takes an array of integers and finds two integers out of that array that multiply to 20 together so with this example with this given array you can see that 4 & 5 here multiply to 20 together so that's the pair you need to find when a typical candidate is given this problem they might start writing some code right away to solve this problem but that's not necessarily the right thing to do before you start coding you want to make sure that you have the right solution in concept one way to do this is ask yourself how would I solve this problem on paper so imagine writing down this array on a piece of paper then you're trying to find a pair of numbers that add up to that multiply to 20 in this array again I don't mean that you need to write this down on a piece of paper literally but I think this is a good way to think about this problem without going into too much implementation detail at the beginning then you might say for example well I can look at each item and ask myself for example for two at the top is there number 10 in this array so check these numbers one by one and check if any of them is 10 and the answer is no so let's go to the next number look at number four here and ask myself is there number five here because four and five would multiply to 20 together and then week check these numbers now and once we get to five we'll just return this pair of numbers four and five and we're done so this is one potential solution to this problem and this way you can explain it without using any computer science and this is how you can come up with a solution without going into too much implementation detail you might also ask yourself what if you had an array which is much longer than this one you might have for example 1,000 items in this array then the previous solution of checking every potential pair of numbers to see if they multiply to twenty would be a lot of work so ask yourself again how would I solve this problem on paper you can imagine a very long piece of paper with a thousand numbers what I would do for this problem is I would write down each number I see by going to these numbers one by one on a separate piece of paper so when we see two right down to right here and when we see four right down four and so on and whenever we see a new number for example five right here I would ask myself what's the number that would multiply to 20 with five the answer is of course four so we can instead of going through this whole array we can just check this separate piece of paper and ask myself is there four already or have we already seen the number four the answer is yes so we can just return four and five from this function and we're done this way with this solution we don't have to check every single potential pair in this array to see if they multiply to twenty once you have this basic strategy down which you can use on paper you can then translate this into data structures and algorithms using your computer science knowledge with this solution a good data structure to use to keep track of each number we've seen might be a hash table or dictionary for example to recap the idea of this Josie is to think about how to solve the given problem in concept first or on paper first then think about how to translate this into data structures and algorithms using your computer science knowledge I would even say you shouldn't start coding until you go through this whole process first unless the problem is so easy that you're fairly certain that your solution is correct and optimal right away now this is actually something I used for my daily work as a software developer at Google to whenever I had a complicated problem to solve I would first take out a piece of paper and think about it on paper this time literally on a physical piece of paper and then I would consider multiple solutions and make sure that I knew how to solve the problem first before I actually put it in code so this is a technique that's not only useful for coding interviews but also to be a better software developer in general - ok guys thanks so much for watching this video this video was actually an excerpt from my brand new course on udemy 11 essential coding interview questions in which I cover 11 of the most essential coding interview questions to master for your next coding interview if you're interested in taking this course there is a link with a discount code glow in the description alright I'll see you soon
Original Description
This is one of the 3 problem solving techniques I personally used to get through coding interviews with companies such as Google.
To get the 2 other techniques, check out my Udemy course, "11 Essential Coding Interview Questions":
https://www.udemy.com/11-essential-coding-interview-questions/?couponCode=SOLVE2
Playlist
Uploads from CS Dojo · CS Dojo · 13 of 60
1
2
3
4
5
6
7
8
9
10
11
12
▶
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
4 Hacks for Finding the Optimal Answer in Coding Interview QUICKLY!
CS Dojo
Dynamic Programming Tutorial with Fibonacci Sequence
CS Dojo
Kadane's Algorithm to Maximum Sum Subarray Problem
CS Dojo
Longest Common Subsequence (Dynamic Programming)
CS Dojo
0-1 Knapsack Problem (Dynamic Programming)
CS Dojo
Amazon Coding Interview: Count Negative Integers in Row/Column-Wise Sorted Matrix
CS Dojo
Microsoft Coding Interview Question and Answer: Lowest Common Ancestor
CS Dojo
Learn Counting Sort Algorithm in LESS THAN 6 MINUTES!
CS Dojo
Radix Sort Algorithm Introduction in 5 Minutes
CS Dojo
Coding Interview Question and Answer: Longest Consecutive Characters
CS Dojo
Coding Interview: Can You RANDOMLY Reorder Array in O(N)?
CS Dojo
Coding Interview Question: Tower Hopper Problem
CS Dojo
Problem Solving Technique #1 for Coding Interviews with Google, Amazon, Microsoft, Facebook, etc.
CS Dojo
Google Coding Interview Question and Answer #1: First Recurring Character
CS Dojo
Facebook Coding Interview Question and Answer #1: All Subsets of a Set
CS Dojo
Think you're not smart enough to work at Google? Well, think again.
CS Dojo
How to Crack a Google Coding Interview - An Ex-Googler’s Guide
CS Dojo
Amazon Coding Interview Question - K Closest Points to the Origin
CS Dojo
How I Got an Internship at Microsoft
CS Dojo
How I Got a Job at Google as a Software Engineer (without a Computer Science Degree!)
CS Dojo
Why I Left My $100,000+ Job at Google
CS Dojo
Top 5 Programming Languages to Learn to Get a Job at Google, Facebook, Microsoft, etc.
CS Dojo
How I Learned to Code - and Got a Job at Google!
CS Dojo
Why I Left Google To Be A YouTuber FULL-TIME (and NOT part-time!)
CS Dojo
What Is Dynamic Programming and How To Use It
CS Dojo
Python Tutorial for Absolute Beginners #1 - What Are Variables?
CS Dojo
What's It Really Like To Intern At Google? (LIVE with a former Google software engineer intern)
CS Dojo
How to Use If Else Statements in Python (Python Tutorial #2)
CS Dojo
Dynamic Programming Interview Question #1 - Find Sets Of Numbers That Add Up To 16
CS Dojo
How To Use Functions In Python (Python Tutorial #3)
CS Dojo
What’s It Like To Be A Program Manager Intern At Microsoft? (LIVE with a former Microsoft intern)
CS Dojo
Introduction To Lists In Python (Python Tutorial #4)
CS Dojo
Introduction to For Loops in Python (Python Tutorial #5)
CS Dojo
What Programming Language Should I Learn First?
CS Dojo
What Is Competitive Programming and How To Prepare For It (LIVE with Gaurav Sen)
CS Dojo
While Loops and The Break Statement in Python (Python Tutorial #6)
CS Dojo
More About For Loops in Python & Solutions to the Last 2 Problems (Python Tutorial #7)
CS Dojo
How to Learn to Code - Best Resources, How to Choose a Project, and more!
CS Dojo
How To Use Dictionaries In Python (Python Tutorial #8)
CS Dojo
Data Structures & Algorithms #1 - What Are Data Structures?
CS Dojo
An Overview of Arrays and Memory (Data Structures & Algorithms #2)
CS Dojo
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3)
CS Dojo
Classes and Objects with Python - Part 1 (Python Tutorial #9)
CS Dojo
Introduction to Classes and Objects - Part 2 (Data Structures & Algorithms #4)
CS Dojo
Classes and Objects with Python - Part 2 (Python Tutorial #10)
CS Dojo
Introduction to Linked Lists (Data Structures & Algorithms #5)
CS Dojo
Introduction to Recursion (Data Structures & Algorithms #6)
CS Dojo
Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7)
CS Dojo
Amazon Coding Interview Question - Recursive Staircase Problem
CS Dojo
Using Boolean in Python (Python Tutorial #11)
CS Dojo
Intro to Data Analysis / Visualization with Python, Matplotlib and Pandas | Matplotlib Tutorial
CS Dojo
What Can You Do with Python? - The 3 Main Applications
CS Dojo
Facebook Coding Interview Question - How Many Ways to Decode This Message?
CS Dojo
List Comprehension Basics with Python (Python Tutorial #12)
CS Dojo
How To Use Sets in Python (Python Tutorial #13)
CS Dojo
Python books for beginners? What Python projects to work on? | 2 Python Beginner FAQ’s!
CS Dojo
Resources for Learning Data Structures and Algorithms (Data Structures & Algorithms #8)
CS Dojo
6 Python Exercise Problems for Beginners - from CodingBat (Python Tutorial #14)
CS Dojo
Google Coding Interview - Universal Value Tree Problem
CS Dojo
Best laptops for programming? How to get a job at Google? - And other FAQ’s!
CS Dojo
More on: Algorithm Basics
View skill →Related Reads
📰
📰
📰
📰
Blind 75 | Arrays & Hashing — 04 Group Anagrams
Medium · AI
Finding the Longest Increasing Path in a Matrix: From a Simple DFS Idea to an Optimized Solution
Medium · Python
LeetCode 24: Swap Nodes in Pairs
Medium · Python
What I learned writing 1,096 tests for algorithm animations
Dev.to · Nav
🎓
Tutor Explanation
DeepCamp AI