How to Crack a Google Coding Interview - An Ex-Googler’s Guide

preview_player
Показать описание
This is the process I would personally use to get through coding interviews with Google, or with any other company for that matter.

If you liked this video, I would also recommend my Udemy course, "11 Essential Coding Interview Questions":

(You'll get a discount through the link above.)
Рекомендации по теме
Комментарии
Автор

Thanks so much for watching this video, guys!

CSDojo
Автор

This is literally the first time i understand the code behind a coding interview, that means progress! thank you so much for making it easy to understand

andrespalermo
Автор

CS Dojo. I never thought about the 0-9 concept. Thank you for giving me some knowledge on questions a condition that I wouldn't be aware of.

ralphchamberlain
Автор

I def like how you explain this stuff. You make it VERY clear and it is still very fun to watch. You rock!

qwarlockz
Автор

Find the length, loop through, multiply by 10^n, 10^n-1 and so on, add one to the number.

rajvigneshh
Автор

I love the way you explain programming, thanks so much!

MannyGonzalezReyna
Автор

I think the purpose of the video is "how to solve" a technical question in an interview setup and not solving this particular problem. Several people here have commented about other algorithms. I think they are missing the point.

kalyanchatterjee
Автор

Thank you for your contributions.
This helps a lot for my coming interview

JacobHo
Автор

Thanks . Always wanted this type of tutorial :-)

PrashantKumar.GPT.
Автор

Depending on the language you choose, in the case of 999, your new array may return 1 in the [0] position and random things in the rest.

magnetospin
Автор

Your solution makes sense, I did this in javascript. However my original JS solution involves taking the array of numbers, joining it into a string, parse inting it, adding the value 1, turning the value ack into a string, splitting it then mapping it running parse int individually on each element. I mean it works, and the reason for mapping at the end is he says they're integers which to me means they'll be number values and not strings or any other type of primitive value.

Zack-dvrz
Автор

You are just doing great hope you will recover fast ...

BrighterWay
Автор

I've seen a few of your videos before and I'm learning python for data science(I have math and statistical training) so when I started watching this video I was thinking of your other interview videos and was wondering how hard these questions are supposed to be(to someone with formal CS training and someone without it), but this video explains it in so many words. I've seen the time complexity stuff, which I imagine once you take the time to understand isn't that difficult. I've seen there's quite a lot of problem solving involved, which seems to involve understanding of what the question asks, data structures(?), and perhaps some mathematical things I take for granted. So given that it doesn't seem too bad, to me anyway. I just need to make sure I understand data structures and time complexity first and foremost. Although I may learn other stuff while learning that. Personally it's just a matter of finding the time but I'll be grateful once I do understand it. For a CS major, I imagine this *should* all be a given but the logical look at the high level discussion might cause some problems possibly, hence the reason for these videos.

cosmosnomad
Автор

thanks man! u're doing great for people like me.

johncarlos
Автор

my approach:

def add (arr):
res = list(arr)
last = len(res) - 1
while True:
if res[last] < 9:
res[last] += 1
break
res[last] = 0
last -= 1
if last < 0:
res[0] = 1
res.append(0)
break

return res

RichardGrable
Автор

Python:
Def addOne(set1):
Value= (''.join(str(x) for x in set1)*1
Value = int(Value)+1
Value = [int(i) for i in str(value)]
Print(Value)


addOne([1, 2, 3, 4])

turtlefast
Автор

we can also do that taking each element of array in a string buffer by appending it and then convert that string into an integer and add one to that integer value and last putting each value of that integer to the array.
This is my idea, If i am thinking in right direction then please inform me its very kind of you.
You are doing great job my friend .

Dark.Ventur
Автор

You can improve the loop by changing if total statement to "if total != 10: carry=0;break;"
Cause once the carry is zero it cannot become 1 thus the rest is unnecessary if you copy the original array instead of making a new one

noahsnoeks
Автор

Very nice interview question.
I wanted to share my implementation of the problem (Python 3)

def add_one(array):
if not next(filter(lambda x: x != 9, array), None): # All elements of the array are equal to 9
return [1] + [0] * len(array)
for i in range(1, len(array) + 1):
if array[-i] != 9:
return array[:-i] + [array[-i] + 1] + [0] * (i - 1)

paolocabaleiro
Автор

I just love that cute little fluffy penguin stuffie ❤️🐧

promamukherjee