Google Coding Interview with an ex-Microsoft Software Engineer

Google Coding Interview with an ex-Microsoft Software Engineer

Rachit Jain

4 года назад

931,297 Просмотров

✅New YouTube Account - Developer Bhaiya 👉🏻https://bit.ly/developer-bhaiya-youtube
👀https://rachitiitr.com - My Personal Portfolio and things I recommend for Coding Interviews.

Rachit, an ex-Microsoft Software Engineer and Clement, an ex-Google Software Engineer do a Mock Coding Interview.

Part II: https://www.youtube.com/watch?v=xUHohVsidLA

🔥 System Design Course: Educative - Must for experienced SDEs
https://www.educative.io/collection/5668639101419520/5649050225344512?affiliate_id=4549609873473536
💰First 100 Users can use "Rachit" as coupon code to get 10% off.

🔥 DailyCodingProblem: Access to Facebook, Google Interview Questions
https://dailycodingproblem.com/rachit
💰Use "rachit" as coupon code to get 10$ off.

SUBSCRIBE AND HIT BELL ICON TO CHECK MORE OF MY CONTENT
http://youtube.com/RachitJain?sub_confirmation=1

Social Profiles -
👀https://rachitiitr.com
👀https://www.instagram.com/rachitjain2095
👀https://twitter.com/rachitiitr
👀 https://fb.me/AlgorithmsWithRachitJain
👀https://linkedin.com/in/rachitiitr

================
Important Playlists:
================
🔥 30 Days of Interview Prep ➡ https://www.youtube.com/watch?v=FzCnuFJnjcE&list=PLfBJlB6T2eOvEEhW7yoRKTsbd9xeru30v
🔥 Software Interview Experiences ➡ https://www.youtube.com/watch?v=C6aM_QpXco4&list=PLfBJlB6T2eOuUAof03sQFlUcrk_Bc7jOA
🔥 Life Lessons I learnt for Success ➡ https://www.youtube.com/watch?v=IIJ3mobGVOU&list=PLfBJlB6T2eOv8klCHHNVLOmTOIxKu-xzn


MyProgrammingBlog
===============
Programming Blog ► http://rachitiitr.blogspot.com
Github ► https://github.com/rachitiitr/DataStructures-Algorithms

MyProgrammingProfiles:
===================
CodeForces ► http://www.codeforces.com/profile/rachitjain
CodeChef ► http://www.codechef.com/users/rachitiitr

Тэги:

#mock_coding_interview #google_interview #microsoft_interview #google_interview_questions #microsoft_interview_questions #data_structures #algorithms #interview_prep #mock_interview #coding_interviews #algoexpert #dailycodingproblem #goldman_sachs #flipkart #microsoft #google #interview_questions #software_engineering #coding_interview_problems #ds_algo #leetcode_solutions #coding_interview_prep
Ссылки и html тэги не поддерживаются


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

Rachit Jain
Rachit Jain - 24.08.2019 16:48

Hope this was fun to watch as we simulated a real world Interview over Google Hangouts.
"Going Greedy does result in minimization but it comes at a cost, and that cost is Wrong Answer".

Part II and other links are in the description.

Ответить
haider michael
haider michael - 24.06.2023 16:23

i was out when 793 ist one of your favorite numbers, "but 793 is not necessarily occouring" even when 793 was in the input number.
but also im an dumb average guy ..

Ответить
Pulkit Malhotra
Pulkit Malhotra - 09.06.2023 12:53

Trie

Ответить
Gavin Phillips
Gavin Phillips - 13.03.2023 09:09

why not just create a function to look through the given values of pi for text matches

Ответить
Soumyadeep Dash
Soumyadeep Dash - 13.12.2022 00:53

We can do it in better complexity by using aho corasick algorithm. This will give time complexity of O(n + m).

Ответить
TheGodfather101
TheGodfather101 - 19.07.2022 19:51

Why not just use regex

Ответить
Yash Yadav
Yash Yadav - 11.06.2022 12:10

Why do my interviewers run after small mistakes like forgetting to set value of dp[pos] before returning from check() or at the line where it returns early on finding ans is EQUAL to UNDEFINED?
I could never get away with those 🥲

Ответить
Stewart Zayat
Stewart Zayat - 23.04.2022 22:56

Regarding the fun intro to the interview, it hasn't been proven whether or not pi has the property that any finite string of digits occurs in the decimal representation as was described by Clement. It is only conjectured that it does.

Ответить
Atul Kale
Atul Kale - 17.04.2022 05:11

Thing I learned from this video is to make an interactive interview session, Interviewer should be that much supportive. Please bring such topics which really gives feeling of giving interview with sense of thinking that needs to be followed by candidate while giving interviews.

Ответить
FDK
FDK - 10.03.2022 04:18

I swear this seems so similar to word break on leetcode.

Ответить
mohammad baba
mohammad baba - 22.12.2021 13:38

If this was an actual interview its a guaranteed fail as the answer was not clear in code and the dp addition feels forced. Also, the solution is heavily reliant on global variables which is almost never the case in a real production environment.

Ответить
Munawar Shah Afridi
Munawar Shah Afridi - 01.12.2021 14:29

I don't know who is host and who is guest !!!!

Ответить
Kev Dev
Kev Dev - 24.11.2021 01:45

He is an ex_Microsoft Software Engineer and uses a MacBook. Do you know the reason why doesn't he work there?

Ответить
KelvinxG
KelvinxG - 07.11.2021 16:14

I can use trie

Ответить
20BCS029-Ishtiyak Ahmad Khan
20BCS029-Ishtiyak Ahmad Khan - 29.10.2021 14:45

Anjali :why you cancelled my order?

Ответить
SAURABH AHUJA
SAURABH AHUJA - 21.10.2021 12:47

They have explained the easy problem in a hard way just to promote their algo expert.... This is simple word break problem......and simple approach is start taking character from starting and when u find any match in favorite arr you have two choices either you split or continue with next charater...try both ways . And find min spaces.....add some memoization to optimize

Ответить
Ashwin Mahajan
Ashwin Mahajan - 20.10.2021 14:28

Iterate over favArray instead of pi in the check function. Although the time complexity seems higher, the average best-case scenario would probably be better (say if length(favArray) is smaller and/or length of each value in favArray are longer). Is my assumption correct?

Ответить
Nameless
Nameless - 12.10.2021 20:16

I understand the problem and how to do it in no time but the thing is my Implementation sucks... Well, I just completed C data structures...

Ответить
S5 Traders
S5 Traders - 28.09.2021 16:17

These days interviewers think like every candidate is a Damn & hardcore CODER,,,,

Ответить
ALifeOfLaurels
ALifeOfLaurels - 08.09.2021 05:49

i've never done a coding interview but i'm wondering, why is the code written on a text file? isn't it supposed to be run? or the code isn't actually run in tech/coding interviews?

Ответить
Akshat Sahu
Akshat Sahu - 06.09.2021 18:39

Thanks dude. your way of thinking helped me learn a lot !!

Ответить
Abhisek Mukherjee
Abhisek Mukherjee - 22.08.2021 22:59

Law of large numbers

Ответить
sanjeev philip
sanjeev philip - 18.08.2021 22:32

def minSpaces(target, wordBank):
targetLength = len(target)
table = [-1 for _ in range(targetLength + 1)]

for i in range(targetLength + 1):
if table[i] != -1 or i == 0:
for word in wordBank:
wordLength = len(word)
if (wordLength + i <= targetLength) and (target[i: (i + wordLength)] == word):
newMinSpace = table[i] + 1
if table[i + wordLength] == -1 or newMinSpace < table[i + wordLength]:
table[i + wordLength] = newMinSpace
return table[targetLength]

Ответить
Tobechukwu Iheme
Tobechukwu Iheme - 18.08.2021 10:39

I'm not pro at algos but off the top of my head I'll use a sliding window to check through the string and get minimal substrings found in the array. It'll be o (n) too

Ответить
deathbombs
deathbombs - 18.08.2021 10:22

This is basically backtracking to try everything, but caching best result makes it a DP...

Ответить
okeyd
okeyd - 17.08.2021 14:54

Was it neccesary to show macbook and cover half of the screen. Its not a luxury nowdays ;)

Ответить
Yaswanth Ravuri
Yaswanth Ravuri - 04.08.2021 17:02

Pie = 3.14blablabla
thanks for the info, I can use this in tomorrows math test. I am sure that I will get A+ grade. Thanks once again.

Ответить
Trentox
Trentox - 10.07.2021 00:32

Ex Google Software Engineer using Apple Airpods Pro and Ex Microsoft Software Engineer using a Macbook. Whats this ;-;

Ответить
Zuubee ee
Zuubee ee - 17.06.2021 00:43

this video is so helpful I can sleep faster now 😂

Ответить
Sai Kumar
Sai Kumar - 14.06.2021 12:52

Work hard until your name will be added to algoexpert for discount 😀

Ответить
vishnu vyas
vishnu vyas - 14.06.2021 05:12

Bfs

Ответить
amitava mozumder
amitava mozumder - 11.06.2021 19:03

Can this be solved using a trie instead? just add the fav array in there, and then check the main string. ?

Ответить
Abhishek Chamoli
Abhishek Chamoli - 06.06.2021 21:02

Can someone tell me which language they are using to make code

Ответить
Saksham Singh
Saksham Singh - 14.05.2021 13:52

Hi, 2 questions:
1) where are u assigning the values to dp[] during memoization,
2) Also the statement should be: if ans!=UNDEFINED then return ans

Ответить
Srirama Nagaraj
Srirama Nagaraj - 09.05.2021 12:58

We can insert all the favourtie strings into a "Trie" data structure. And then while we pass thru the large string, we can check if that partial string exists in trie. If it exists, break it up.

Ответить
Chud Chadanstud
Chud Chadanstud - 07.05.2021 02:27

ex-Google: I'm gonna interview you.
ex-Microsoft: ok
[A few moments later]
ex-Microsoft: I'm afraid you didn't pass this interview ex-Google buddy. You can try applying again next year.

Ответить
Aniket Argade
Aniket Argade - 06.05.2021 14:42

I was asked the exact same question in the final round for SDE-2 role at Amazon. No price for guessing I was rejected ;)

Ответить
Shahnawaz Alam
Shahnawaz Alam - 05.05.2021 16:26

This is exponential algo, will this suffice for interviews? Optimal I suppose could be done using DP @rachit

Ответить
Hung Doan
Hung Doan - 05.05.2021 05:03

Created my own solution to this video and I think my answer runs in O(n^2) time. Could be wrong though.

def numbersInPi(pi, numbers):
numbersTable = {}
origNumbersTable = {}
for i in range(len(numbers)):
origNumbersTable[numbers[i]] = True

for i in range(len(pi)):
for j in range(i + 1, len(pi) + 1):
if pi[i:j] in origNumbersTable:
if i == 0:
numbersTable[pi[i:j]] = 0
continue

if pi[:i] not in numbersTable:
continue

if pi[:j] in numbersTable:
numbersTable[pi[:j]] = min(numbersTable[pi[:j]], numbersTable[pi[:i]] + 1)
else:
numbersTable[pi[:j]] = numbersTable[pi[:i]] + 1
if pi in numbersTable:
return numbersTable[pi]
return -1

Ответить
Carzy cults
Carzy cults - 01.05.2021 09:18

Hey anyone plzz tell and get me out ofit,
How he can check 314,once he get rid of 3 from string and get one space between 3 and 14.... once get away from one position how he can go back to the beginning of string to find the min spaces, Thank you !!!

Ответить
Leo Villacorta
Leo Villacorta - 26.04.2021 19:47

The decimals of pi are not random

Ответить
Tetrax
Tetrax - 15.04.2021 14:38

Why not sort the list of Clements favourite numbers and split the first string into an array?

Ответить
ansariBE
ansariBE - 02.04.2021 22:27

how long will it take to give an interview in DS&Algo if em a beginner.!?
and maybe em so late, this code "rachit" seems expired😎

Ответить
ranveer yadav
ranveer yadav - 21.03.2021 13:59

Bhai iski bandi se binary tree inversion sikhna hai

Ответить
Abhishek Pandey
Abhishek Pandey - 13.03.2021 19:29

How this would solve real production issues ? 😂 I would never prefer to have this in my production server. - "and you had to show that Apple logo yeah it's obvious 😂

Ответить
Pratik kumar
Pratik kumar - 08.03.2021 10:05

man now i am also becoming pro in python, i have successfully done hello world

Ответить
Aiswarya Jami
Aiswarya Jami - 04.03.2021 02:59

Since the question is asking for minimum number of spaces which is a minimization problem, we could maximize the substrings resulted by introducing spaces to given input string. Sort fav numbers array in decreasing length, check if largest number is a substring of input string. if yes, increment spacesTaken by 1 and now check if 2nd largest number is present in the input string. if yes, introduce space, else continue; .. if entire input string got split into substrings (base case where i reaches n-1) by greedy method of picking largest substring at each iteration , then in this way we could guarantee that spacesTaken will guaranteed to be minimum out of all possible answers. We could use rabin-karp style substring matching for efficient checks. I hope @Rachit/Clement would notice this comment and reply if my algo would work.

Ответить
SyamScetch
SyamScetch - 03.03.2021 12:23

Always yep

Ответить
Jay
Jay - 28.02.2021 03:06

Clement should be interviewee sometimes too. It would be a lot of fun.🤗

Ответить
미니선장
미니선장 - 20.02.2021 21:12

I feel like when you call tech support this guy answers

Ответить