How to: Work at Google — Example Coding/Engineering Interview

How to: Work at Google — Example Coding/Engineering Interview

Google Students

7 лет назад

228,020 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Randy4i i
Randy4i i - 14.10.2023 12:56

Thank you guys for these amazing resources. It does make me feel less competent and ready but we can only learn hey.

Ответить
im_love_98
im_love_98 - 27.07.2023 15:14

Hii

Ответить
Shamshudhin Nadaf
Shamshudhin Nadaf - 08.04.2023 20:59

My Code :
nums = input('Enter Numbers ').split()
numlst = []
for i in nums:
k =int(i)
numlst.append(k)

for n in range(len(numlst)):
cns = 8-numlst[n]
if cns in numlst:
print('Yes')
break
else :
if n == len(numlst)-1 :
print('No')

Ответить
Ayoub Dkhissi
Ayoub Dkhissi - 29.11.2022 02:12

great video. thanks

Ответить
BrianLC
BrianLC - 14.09.2022 21:13

2016: 2 sum 
2022: solve the travelling salesman problem in polynomial time 😭

Ответить
amazing arc
amazing arc - 13.09.2022 17:48

can anyone explain to me the condition in if statement ... thanks

Ответить
Rogerio Robetti
Rogerio Robetti - 23.07.2022 21:52

Awesome. Thanks for this, is really helpful. You could use a Bloom Filter instead of the hash set to save on space complexity(O(1)) as per you only need to know if the complement is NOT in the list.

Ответить
Aman chimankar
Aman chimankar - 16.07.2022 21:04

👍

Ответить
Israel Wokoh
Israel Wokoh - 01.07.2022 00:36

Nice to know I would have failed in the first 30 seconds...

Ответить
Brijesh Patel
Brijesh Patel - 26.06.2022 13:36

Are they trying to send message to the candidates to feel more comfortable while having the Coding interview? And encourage them to ask questions if they are not clear what they are going to solve?

Ответить
MARVN
MARVN - 25.05.2022 20:41

I have a long way to go... But this is a motivation

Ответить
Tanner Dolby
Tanner Dolby - 16.03.2022 00:15

Really helpful video. This reminds me of the classic Two Sum problem on LeetCode. Since we are told a pair of numbers equals a target sum, we can say that x + y = target. And solving for y (complement of x), we see that y = target - x. Therefore, we can just walk through the input sequence and for every element, insert it into a hash set while performing a lookup in the hash set to see if for a given `x` value (arr[i]) we can find a `y` that satisfies x + y = target.

Ответить
Subi_n_
Subi_n_ - 02.02.2022 20:53

And binary had confirmed with asking decimals !

Ответить
Subi_n_
Subi_n_ - 02.02.2022 20:53

First pair you change to no 9 to 7 and give command to no and yes then click 9 error will appear

Ответить
Razvan Wist
Razvan Wist - 30.01.2022 03:28

Actually, the find() method for sets has a logarithmic lookup time, which would make the complexity O(n log n) instead of liniar.

Ответить
Subha......
Subha...... - 28.01.2022 07:02

Hallo Google I am india for student the following URL and to join to google jobs for student......

Ответить
Rifat Ahammed
Rifat Ahammed - 19.12.2021 09:14

Thank You very much

Ответить
Patrick W
Patrick W - 10.11.2021 21:09

a small problem with empty data: data.size() is unsigned int, after minus one, it will become extremely big, you have to convert it to int first.

Ответить
Michelle
Michelle - 10.11.2021 04:51

interesting, i was thinking since it is sorted to start checking at the end, skipping numbers which are too large and when you get to number that is <= 8, you would start doing binary search looking for the complement with the rest of the array (the beginning part) but that would still be n log n I think

Ответить
singhini
singhini - 07.11.2021 08:33

What if we use if -else loop to get output

Ответить
元始天尊
元始天尊 - 03.10.2021 05:16

For this problem specifically, since there will only be an addition of two number, all you need to do is to subtract one elements of the arrays from 8. If the result matches one of the remaining elements then the number you subtract from and the result will be the pair of two number that sums up to 8. You will only have to do this four times or the number of elements you have in an array.

Ответить
Data Man
Data Man - 14.09.2021 11:05

Strange question: What is the size of whiteboard in feet? 3x2?

Ответить
Nathan 'Nate' Whitehat
Nathan 'Nate' Whitehat - 28.08.2021 19:02

`+data[hi]`… AND… You've just invoke undefined behavior.

EDIT: Wait nevermind. My bad. Implicit conv… Well technically it's still UB. Just way earlier. Signed overflow is still ub (granted if you that large a vector you might want to rethink something. (also infinite loop but that's cheating). Still why use an int where you get a `std::vector<int>::size_type` smh. And that while loop confuses me. (Besides being potentially wrong) I'm way too sleep deprived for that amount of questions. iterators wouldn't kill either. (So many whys)

Fix is obviously don't pass keep a `std::numeric_limits<int>::max() + 2ULL` sized vector to the function…
Or don't have so many implicit conversations.

The answer in itself is fine though. (I'm just over sensitive to potential UB)

Ответить
Akshat Singhania
Akshat Singhania - 28.08.2021 11:43

I did this problem on leetcode when i was like 12yo

Ответить
feast
feast - 08.08.2021 11:55

Nice mam or sir ✓

Ответить
Víctor Calabuig Rodríguez
Víctor Calabuig Rodríguez - 03.08.2021 14:51

I love the acting from the guy pretending to be looking for the answer. Thankfully for him he is an engineer and not an actor XD

Ответить
vasu dev sharma
vasu dev sharma - 19.07.2021 08:53

In the loop we can subtract the value like :-( sum - value ) and then find the output in before Position. if it found it return true and if not then false. In this case we not need to store any data.

Ответить
20CCU125 Surya .S
20CCU125 Surya .S - 15.06.2021 10:44

It's useful for me❤️

Ответить
Ahmed Adam Ahmed Ahmed
Ahmed Adam Ahmed Ahmed - 07.04.2021 01:26

I have a lot do .now .I need hard thanks Googler ,its very motivating

Ответить
Ahmed Adam Ahmed Ahmed
Ahmed Adam Ahmed Ahmed - 07.04.2021 01:12

waw at it's very good. I need additional information

Ответить
Omar Vayani
Omar Vayani - 03.12.2020 17:51

This is the math of common sense 😂

Ответить
john smith
john smith - 14.11.2020 15:12

I don't think He would take such a long amount of time
its just a matter of 2 min for someone who is a intermediate even
LOL
he is pretending to be slow
LOL

Ответить
john smith
john smith - 14.11.2020 15:10

Well The Question goes like this I suppose:
lets say
(python 3)

lst = [1,2,3,4,5,6]

for i1 in lst:
i2 = 8 - i1
if i2 in lst:
print(i1, i2)
we get the pairs

Ответить
Nishan Chetia
Nishan Chetia - 03.11.2020 10:03

Hello 🤗, I am a student studying in class 11 with arts stream. I am thinking that can I be a part of Google if I am arts stream student. My aim is to get job in Google. Can I get it or not? Please respond 🤗🤗 ..i want to know. Which degree will be best for me to get job in Google. Actually, I am a student from India. From class 6 my aim is to be a part of Google. This present year, I had passed out class 10 board exams. Before getting results my choice was to choose Science stream but I had opted Arts because science marks was poor. In other subjects like English I scored 81% and in social science I scored 89%. My mood was totally bad that I can't get job in IT companies 😣. But I have seen that the people who are working in Google have said that anyone from any stream can get job in Google, but you must have creative skills and many more. I just asking one question please reply can I get job in Google?
Hope you will reply sir.

Ответить
Abrahan Raymundo M
Abrahan Raymundo M - 28.10.2020 08:38

it seems like a competitive programming problem

Ответить
Ranjith MG
Ranjith MG - 16.10.2020 17:25

another checking possibility to reduce time complexity:
if the asked sum is even and
the adding numbers should be (even and even) or (odd and odd)
if the asked is odd
the adding numbers should be (even and odd)

Ответить
MATHS ADDA
MATHS ADDA - 19.09.2020 10:21

Did commerce students get job in Google

Ответить
Hyprxx
Hyprxx - 03.09.2020 20:32

Since comp.find is logarithmic and you are repeating this for every value in data, then the actual time complexity of the function is O(N*logN). Why did they say it was linear?

Ответить
bashkalike
bashkalike - 14.08.2020 16:08

What I realized from interview questions is that mostly they based on data structure and algorithm. Personal thought though.

Ответить
Santi Cazorla
Santi Cazorla - 06.08.2020 07:11

1st problem I did in LeetCode TwoSum problem

Ответить
Knowledge Tube
Knowledge Tube - 22.06.2020 07:03

Can i use Hindi language for communicate with Google recruiter

Ответить
Ankit Tiwari
Ankit Tiwari - 16.06.2020 18:12

1x2+3+3=8 excluding √
1x2+4+2=8

Ответить
Kenneth Washington_Anderson
Kenneth Washington_Anderson - 12.05.2020 15:42

Oh okay 😊👍👍😂👌.

Ответить
Emmanuel Mtali
Emmanuel Mtali - 06.05.2020 02:38

Edge case: negative integers

Ответить
Faheem Ahmad Official
Faheem Ahmad Official - 05.05.2020 23:50

OMG! i can only do sorting!!! even odd!

Ответить
Luis Orozco
Luis Orozco - 02.05.2020 06:26

Could someone be so kind of give me feedback please?

const findPair = (nums, target) => {
let result = [];
const tempArr = nums.filter(num => num < target);
tempArr.forEach(num => {
let dif = target - num;
let r = tempArr.find(n => n === dif);
if (r) {
if (num + r === target) result = [num, r];
}
});
return result;
};

I'd really appreciate it, it's a messy code but it seems to work XD

Ответить
F For Fun
F For Fun - 18.03.2020 11:30

These questions are so easy for me..

Ответить