Mock Google Coding Interview with a Meta Intern

Sdílet
Vložit
  • čas přidán 14. 05. 2024
  • 🚀 neetcode.io/ - Get lifetime access to all current & future courses I create!
    Checkout my second Channel: @NeetCodeIO
    Today I gave a mock google coding interview to @FryingPan who is a former intern at Meta currently studying for coding interviews as he finishes up school. He also recently interned at Meta in NYC.
    Btw this is the question I asked: leetcode.com/problems/insert-...
    We actually solved it on the channel here: • Insert Delete GetRando...
    🥷 Discord: / discord
    🐦 Twitter: / neetcode1
    📷 Instagram: / neetcodeio
    🎵 TikTok: / neetcode.io
    Time Stamps
    0:00 - Intro / Background
    1:45 - Interview Starts
    2:45 - Clarifying questions
    4:40 - Start coding
    7:40 - Hint #1
    11:15 - Suboptimal solution
    16:35 - LIGHTBULB MOMENT
    23:55 - Half time remaining
    25:30 - Test cases
    29:55 - Follow-up Question
    36:55 - Bug bashing
    39:13 - Disqualified for cheating
    42:05 - Interview Complete
    42:50 - Debrief
    45:40 - Final Results
    #google #coding #interview
    google coding interview
    coding interview
    google interview
    cracking the google interview
    meta software engineer
    facebook software engineer
    software engineer interview
  • Věda a technologie

Komentáře • 698

  • @NeetCode
    @NeetCode  Před rokem +92

    🚀 neetcode.io/ - Get lifetime access to all current & future courses I create!
    Should FryingPan mock interview me next?
    Thanks to FryingPan for joining, check out his video here: czcams.com/video/bLk27-xKAD0/video.html
    Btw this is the question I asked: leetcode.com/problems/insert-delete-getrandom-o1/
    We actually solved it on the channel here: czcams.com/video/j4KwhBziOpg/video.html

    • @devstuff2576
      @devstuff2576 Před rokem

      Wait, Google docs aren't used anymore???

    • @alisonoz7219
      @alisonoz7219 Před rokem +2

      Yeah I'd like to see that 🤩

    • @zesanurrahman6778
      @zesanurrahman6778 Před rokem

      I became homeless. I am depressed

    • @slayerzerg
      @slayerzerg Před rokem

      yeees

    • @smtp_yurzx
      @smtp_yurzx Před rokem

      It seems only fair and right with the world. I mean if you prefer balance in the universe rather than chaos.

  • @Dulandor
    @Dulandor Před měsícem +128

    "If there is a problem, just throw a hashmap at it."
    - someone really smart

    • @subhrajyotisen7218
      @subhrajyotisen7218 Před měsícem +3

      Funny how true this is

    • @user-wo8kh7cw4k
      @user-wo8kh7cw4k Před 26 dny +1

      @@subhrajyotisen7218 why not Hashset here ? until follow up question

    • @subhrajyotisen7218
      @subhrajyotisen7218 Před 26 dny

      @@user-wo8kh7cw4kthe code in this interview seems to be more pseudo code. When writing actual code, they will mostly have to to use hashset since Set is usually an interface in many languages and HashSet is one of the implementations

    • @nile7999
      @nile7999 Před 21 dnem

      @@user-wo8kh7cw4k you need to store the index as the value.

  • @BTC500k
    @BTC500k Před rokem +825

    “In your real interviews, do you talk the same way..?” LMAO that is the question I wanted to ask lol

    • @pinecedar180
      @pinecedar180 Před 6 měsíci +21

      It was obviously a frank discussion between friends

    • @parvscripter
      @parvscripter Před měsícem +5

      @@pinecedar180 but you can be pretty frank just don't be unprofessional

    • @decomush
      @decomush Před 28 dny +2

      I'm 5 min into the video and I wanted to ask that

  • @nikhil_a01
    @nikhil_a01 Před rokem +591

    I find it funny that when he googled for how to get an arbitrary element from a set, he actually found Java code, and pasted it into his Python solution. And NeetCode is just like "great".

  • @tusharvyavahare9229
    @tusharvyavahare9229 Před rokem +460

    for python folks, removing an item from set, which isn't in the set , using remove() method will result in error, so use discard() method.

    • @danielsank2286
      @danielsank2286 Před rokem +66

      Just use pop

    • @yatintyagi4366
      @yatintyagi4366 Před 5 měsíci +3

      or just use an if statement

    • @youMatterItDoesGetBetter
      @youMatterItDoesGetBetter Před měsícem +3

      @@yatintyagi4366 wouldn't the if statement be more clear since the value isn't in the set to begin with? Thus if changed in the future... it'll still run correctly?

    • @sandeepreddy1286
      @sandeepreddy1286 Před 25 dny

      Agree smart move

    • @bit-learn
      @bit-learn Před 3 dny

      @@danielsank2286 pop removes a random value from the set, not the required one

  • @free-palestine000
    @free-palestine000 Před rokem +1095

    please record more of these google mock interviews!! this questions seem so easy initially, but watching how frypan is talking aloud and saying his thought process makes me realize how the little details he says is actually valuable to you (neet) as the interviewer. now i realize why i failed my interviews so much

    • @danielbrown7534
      @danielbrown7534 Před rokem +4

      Watch this i was thinking maybe we could store in an array..but wont store in array initially..we would then use a function to check the array if the value was already store there.. if yes then use the value position to store the new figure.. if no then use the new value as storage.. I would also use a function to get a random number using the array limitation then use that random number to return a value from set.

    • @ahsanmurtaza6185
      @ahsanmurtaza6185 Před rokem +7

      @@danielbrown7534 That wouldn't meet the time complexity requirements.

    • @stefannita3439
      @stefannita3439 Před 7 měsíci

      @@danielbrown7534 searching in an array is O(n). Unless the array is sorted, in which case you can use binary search and it becomes O(logn). But to be able to always search in O(logn) you have to maintain the sorted order of the array at all times, which means your insertion becomes O(n) (find the correct index to insert at to maintain sorted order: O(logn), insert and then shift all of the elements to the right of it: O(n)) and your removal is now also O(n) (typical array removal).
      The point of this question is to kind of juggle all of these limitations. Every time you choose a data structure to optimize one of the operations, something else becomes more expensive. Nothing is free. This is why the trick is to use different data structures simultaneously, each good at different operations, and figure out how to make them work together to create an interface where all three of the exposed operations are O(1). But even this isn't free, as you're now basically doubling the memory you use (still O(n) space tho).

    • @adolft_official
      @adolft_official Před 5 měsíci

      These interviews are Haram bro, start praying 5 times for FALSEtine and Stop using Jewish owned CZcams as it funds Israel against your Allah

  • @hariharanm9930
    @hariharanm9930 Před rokem +734

    Hey Neetcode! I got the exact same question on my Adobe interview two days ago. Luckily I have been practicing from your collection of questions last few months and never missed any of your videos. I bagged my offer today!! You have literally made this happen for me. Can’t thank you enough for this day!

    • @onkarsingh-vu1ds
      @onkarsingh-vu1ds Před rokem +11

      Hi, is adobe allowing remote work?

    • @chainsfr224
      @chainsfr224 Před rokem +21

      Congrats ma boi

    • @usa5450
      @usa5450 Před rokem

      Congrats nigg*

    • @dv-89
      @dv-89 Před 7 měsíci +5

      what collection of questions you are talking about? Neetcode 150?

    • @paultvshow
      @paultvshow Před 2 měsíci

      Hey man. I have been preparing for coding interviews for a month now. I am a self taught coder who is passionate about coding especially in AI and machine learning fields. I have just started coding for 3 months with hands on projects of over 50+ as I have quit my previous job and dedicated my full time learning coding. During the past weeks, I spent at least 4-5 hours a day on Leetcode and I have completed almost 100 problems. Now then I have started watching coding interview videos, and I feel that problems in most mock interviews seem a little too easy. So I just wanted to know from people like you who have already experienced real interviews that how difficult are there real problems?

  • @willboler830
    @willboler830 Před rokem +68

    Gah, what people watching this might be missing out on is the anxiety, and the difficulty between coding and talking through the code. I sat here correcting him as he went, but also remembered how much I stumbled over trivial stuff. It's so nerve racking.

    • @asagiai4965
      @asagiai4965 Před měsícem

      True, IMHO I think he should ask all the possible questions. To ease the doubt.

  • @Neilblaze
    @Neilblaze Před rokem +66

    Been watching Mock interview sessions for a long time, but this is by far the most enjoyable session for my all time :)

  • @Protocoding
    @Protocoding Před rokem +83

    Things I'm starting to realize every developer needs to do during an interview. Ask tons of questions before even thinking about coding, even if they seem obvious. If the easiest way to think of a question is in one-time complexity odds are they are hinting at the complexity they want in the description of the question.

    • @MichaelButlerC
      @MichaelButlerC Před 7 měsíci +9

      I just hate to ask questions for the sake of asking questions though...

    • @eesnehhil
      @eesnehhil Před 6 měsíci

      @@MichaelButlerC frfrfr

  • @SankarshanGhosh
    @SankarshanGhosh Před rokem +59

    This is the first time I watched a 40 minute video. Real fun, we want more of these!

  • @rajingale5776
    @rajingale5776 Před rokem +58

    The collab we waiting for..🔥
    The only 2 coding channels i subscribed and getting that collab is awesome..

  • @axaxaxaxaxaxax33
    @axaxaxaxaxaxax33 Před rokem +25

    the collab i didnt know i need 😂 frying pan is too funny lol. Great hint from Neetcode too, just enough to nudge him into revelation

  • @krovvidisupraja6822
    @krovvidisupraja6822 Před rokem +82

    Thanks so much @NeetCode for doing this. I think this video is pretty realistic (except for the way @FryingPan talks 😂) compared to the other mock interview videos online! Helped me relate a lot being an interviewee. Looking forward to more such videos!! Keep inspiring with your good work 😃

  • @supastazz
    @supastazz Před rokem

    That adding array to value for duplicate values was amazing, always had that doubt but I found the answer today. Thank you for the post

  • @MrPkmonster
    @MrPkmonster Před rokem +10

    That's cool. I've learned a lot during the Mock test interview. Understand deeply the way the interviewer asked the candidate and the way of thinking to solve the problem.

  • @srinadhp
    @srinadhp Před rokem +1

    Invigorating! Great questions all around, even greater thoughts and solutions!

  • @jasonswift7468
    @jasonswift7468 Před rokem +14

    This is a really inspring mock interview. Learn a lot from this standard mock interview. Please upload more similar interviews including system design mock interview.

  • @dacattilearnsenglish3141
    @dacattilearnsenglish3141 Před 4 měsíci +6

    There were 4 people in my coding interview a few months ago. They were quite friendly with me, though. I had to code C++ in MS Word, which was a pain the neck. Even the easiest questions become hard because of tension. In addition to that, time flies when you are under pressure because you are trying to come up with an answer in your head and trying to word it properly.

  • @MikeKm-hd1ve
    @MikeKm-hd1ve Před měsícem

    Priceless video!! Thank you so much!!

  • @atalaramadhan9313
    @atalaramadhan9313 Před rokem +3

    The collab I was waiting for years. You guys are prob my fav swe youtubers

  • @heatchecknyc2142
    @heatchecknyc2142 Před rokem

    Enjoyed this video so much i watched on both your channels. Can you make a series of this?

  • @atharvagupta9355
    @atharvagupta9355 Před rokem +7

    This interview made me realize that I can do it too. Thanks, Neetcode

  • @basma-ba
    @basma-ba Před rokem +4

    So useful and so fun session. thank you for this video, it relaxes me somehow while hearing the layoff news

  • @ztrixx3280
    @ztrixx3280 Před 5 měsíci

    this was really informative and fun at the same time. thanks NeetCode.

  • @house0795
    @house0795 Před rokem +1

    Awesome, more of that would be highly appreciated

  • @denhoward6438
    @denhoward6438 Před rokem

    Nice video, I can feel the pressure of the interviewee by his word and face

  • @davidkolesom
    @davidkolesom Před rokem +1

    Love this Mr. Neet Code!

  • @varshasingh1299
    @varshasingh1299 Před rokem +8

    Big fan of neetcode ❤️ just want to thank for all the amazing content you post in your channel... Thank you 🙏 love from India

  • @yitongxie6574
    @yitongxie6574 Před rokem +9

    the last part you ask 'do you talk like this in real interview?' and then 'nothing' really make me laugh

  • @TiagoDiass2
    @TiagoDiass2 Před 6 měsíci

    amazing content guys, loved it!

  • @karanbhatia2834
    @karanbhatia2834 Před rokem +2

    This was like actually really awesome. I felt like I was solving the problem with him!

  • @marspark6351
    @marspark6351 Před rokem +118

    Theres something neither of you caught. When you remove elements from the set that keeps track of indices and when there's only one element in the set, you are left with an empty set. What you want is to get rid of the map entry altogether. So you should check if it's the last element, and if it is, del that entry.
    Also, he mentions changing to a set instead of an array because when he chose the array first, he was using the first index and then he probably thought "wait.. now if I delete the first index I have to shift all the remaining ones to the left". Well actually you can simply use the last one instead of the first by using "pop", and so you can still use the array

    • @christiancepeda5457
      @christiancepeda5457 Před rokem +3

      excellent observation

    • @ProfessorQuality
      @ProfessorQuality Před 7 měsíci +4

      what if you want to remove the number first in the list, you can't use pop() instead?

    • @xingzheli7431
      @xingzheli7431 Před 6 měsíci +2

      It's remove by value, so it's worst-case linear time for an array.

    • @Biggyweezer69
      @Biggyweezer69 Před 4 měsíci

      @@ahmadelmassalkhi This actually isn't true. since we are only ever pushing values into the values array, the index of the last value in the value array will always be the last index in that values index array. This stays true whether there are duplicate last values or not. Using a set here isn't better really.

    • @ahmadelmassalkhi
      @ahmadelmassalkhi Před 4 měsíci

      ​@@Biggyweezer69 I realized I was digging deep, while even the obvious case of having a duplicate of the last element, it raises an error (in the final code of the guy in the video)

  • @creamymain7867
    @creamymain7867 Před 4 měsíci

    Love the "Now let me ask you another question" at the beginning haha. Very inciteful video btw

  • @RaghavRathi-qb8fr
    @RaghavRathi-qb8fr Před 10 měsíci

    This is prolly the best channel out there for ds algos!!!

  • @christianmorera4127
    @christianmorera4127 Před rokem +4

    I love this, frying pan makes coding interviews fun

  • @SankHar4
    @SankHar4 Před rokem +1

    Neet code Please do conduct whenever possible it helps the everyone a lot of Learning. Thank you so much...

  • @pokatana4130
    @pokatana4130 Před rokem

    Nice video. Love to see more so I can prepare.

  • @5pellcast3r
    @5pellcast3r Před rokem +5

    The collab I didn't know I needed ..... 🙃

  • @SanjanaSingh-mc6re
    @SanjanaSingh-mc6re Před rokem +24

    Can we get more interviews like this one? It was really helpful. Thanks!! 🙂

  • @koch9666
    @koch9666 Před rokem +9

    Omg that was so fun I really enjoyed the vid and it's perfect too because I have a final round coding interview later this week! You guys should collab more often, that would be such good content!

  • @cowaiicow8802
    @cowaiicow8802 Před rokem +6

    I never thought i needed this collab until now...

    • @zweitekonto9654
      @zweitekonto9654 Před rokem

      You never know what u need until its too late. Thats why ur broke.

  • @imbes64
    @imbes64 Před rokem +2

    pretty decent easy-med level q to ask, will use in my own new hire interviews as it makes for good discussion!

  • @chengyuanchang4000
    @chengyuanchang4000 Před rokem +7

    The code in follow up has a bug...
    In the remove function, when the size of self.map[value] equals to zero, we need to delete the empty set like `del self.map[value]`.
    Otherwise, next remove call for same element will cause an error.

  • @tedwoldeselassie5715
    @tedwoldeselassie5715 Před 7 měsíci +2

    I would implement the Get(bool random, Enum input) first, then when implementing the Insert, pass each iteration to Get() with random false. If it returns a value then dont insert it as its duplicate. To get random you jusst need to set random to true. Then the remove is straight forward.

  • @andreainvernizzi8510
    @andreainvernizzi8510 Před rokem +1

    So many headaches to end up in a cubicle Monday to Friday.
    May as well deploy this knowledge to develop independently and get all the benefits.

  • @CarInLot
    @CarInLot Před rokem

    Love this new content.

  • @negarvahid3429
    @negarvahid3429 Před rokem +3

    Bro why didn't you upload this sooner I had my interview yesterday :,)

  • @myrtiy
    @myrtiy Před rokem

    Neetcode’s code is neat! Thank you Neetcode!

  • @chenbi5258
    @chenbi5258 Před rokem

    OMG, very impressed by this solution.

  • @isaiahparadiso8044
    @isaiahparadiso8044 Před rokem +16

    Pro tip to people interviewing. Don’t talk like this guy. Don’t swear. Don’t quiz the interviewer. Finding the optimal solution is a must, but they’re also deciding if they want to work with you. Some crude banter can give the wrong signal, and there’s zero advantage to you in risking it. Be polite. Don’t be cocky. Every grading rubric has score around cultural and team fit. Just FYI.

  • @noomade
    @noomade Před 7 měsíci

    This was fun. Never seen someone so pleased to get the answer :P

  • @jose6378
    @jose6378 Před rokem +4

    Unironically got a very similar question for Amazon SDE position

  • @user-wd1yj6vq7t
    @user-wd1yj6vq7t Před 6 měsíci +1

    Funniest, energetic interview I have ever seen , I want confidence like this😅🤣

  • @utsabkhakurel9742
    @utsabkhakurel9742 Před 6 měsíci +3

    In the follow-up, you could have just chosen the last element from the list to swap self.map[value][-1] and used pop() to remove it after the swap.

    • @yosup7563
      @yosup7563 Před 29 dny

      There is no indexing in sets so self.map[value][-1] wouldt work and then he also pasted some wrong java code in

  • @brainesteven6365
    @brainesteven6365 Před měsícem

    in the 30:28, the follow up question is to allow array to store duplciate. The follow up seems to be simplified, in general, it may ask while allowing to store duplicate values, what is to make each number to has the same probility in getRandom(say 1,2,2,2,2,2,3), 1 and 2 and 3 has the same 1/3 probility to be returned.

  • @charminghostes
    @charminghostes Před 5 měsíci

    hey hey dude, thanks for the vidos!! now a cool mood for the whole day :)))

  • @harryshi1
    @harryshi1 Před rokem +6

    love the concept, if you need another person to mock interview I would be happy to do one. I am an ex Quant trader now studying for algo / CS jobs.

  • @mr.rodzhers8663
    @mr.rodzhers8663 Před 5 měsíci

    Well shown who is a front-end developer, thanks

  • @k.i.r.a_619
    @k.i.r.a_619 Před rokem +14

    This guy is total tech lead material

  • @cenchang3765
    @cenchang3765 Před 7 měsíci +1

    So funny. I am still struggling with leetcode by just finishing the first 200. And I did not have much interview experience. The video makes me feel like we are all human beings.

  • @ilovemeee21
    @ilovemeee21 Před rokem

    More of these please !!!!!

  • @MightyElemental
    @MightyElemental Před 15 dny

    got my first interview on wednesday and this video equally relaxes and terrifies me 😅
    Trouble is I cannot think aloud. I can think, then explain, but that takes more time. Hopefully not an issue, but we shall see 🤞

  • @jemanuelg99
    @jemanuelg99 Před rokem +9

    Im not sure if the rudeness was real or satirical. I’m not sure if being rude to the interviewer is a great strategy.

    • @tyeezy5460
      @tyeezy5460 Před rokem +1

      Language barrier maybe? But prob satire

  • @yskida5
    @yskida5 Před rokem

    Great collab!

  • @tune6000
    @tune6000 Před rokem +2

    Do more of these

  • @federicopessina974
    @federicopessina974 Před rokem

    very useful and well designed website NC!

  • @codealonewithGod
    @codealonewithGod Před rokem +1

    I am happy to know I almost guessed all the approach correctly!!

  • @Ripred0219
    @Ripred0219 Před rokem +9

    The snarky comments while Neetcode remained mute was hilarious

  • @chrisrey2516
    @chrisrey2516 Před měsícem +1

    i was able to come up with similar solution. I'm happy lol. I was thinking along with him

  • @GinjouArmy
    @GinjouArmy Před 11 měsíci

    Glad I could follow along with the code on the white Goggle Doc.

  • @JoaoPereira-if5jk
    @JoaoPereira-if5jk Před 10 dny +1

    Awesome video!
    Quick question:
    What's the point of changing the last item of the array to the value to be deleted if you're just going to pop it anyway? Can't we just remove that extra step?

  • @govindbanura3327
    @govindbanura3327 Před rokem +24

    I feel that moment when you said "do you really talk like this in real interviews" and he replied "what's wrong with how I talk"
    Your reaction was "nothing" 🤣🤣 I felt that man 🤣🤣

    • @grmn3564
      @grmn3564 Před rokem +1

      He should have been honest there!
      Judging from the comments he's kinda acting; but besides your ability to solve problems, it's also super important to be pleasant to work with. One can be funny and entertaining while staying humble and mindful.

    • @misterl8129
      @misterl8129 Před rokem +1

      like we say in chile, "que cagon eres" she should tell him with no fear of hurting him lol

  • @Khalid-fx9sm
    @Khalid-fx9sm Před rokem

    This is brilliant

  • @sajitullahkhan
    @sajitullahkhan Před 6 měsíci

    Bro please make more these kind of coding interview videos

  • @lilygranger6264
    @lilygranger6264 Před rokem

    OMG my two favorite youtubers!!!

  • @rjlacanlaled9419
    @rjlacanlaled9419 Před 6 měsíci

    I'm actually him during my interviews 😂😂 Its easy to figure out solution when you're not under pressure, but in actual interviews there's so many things that can happen and the anxiety can get to you and affect your performance.

  • @YSTYG
    @YSTYG Před rokem +147

    I thought we were about to get a face reveal 😂

    • @NeetCode
      @NeetCode  Před rokem +38

      Maybe on part 2... lol

    • @somakkamos
      @somakkamos Před rokem +11

      Seriously man..i so badly want to see neetcode.. in my mind he is like moriarty frm sherlock show... coz thats how brilliant neetcode is.😊😊😝

    • @josepha8415
      @josepha8415 Před rokem +8

      @@NeetCode Is Techlead in the thumbnail

    • @joshuabiyinzika2834
      @joshuabiyinzika2834 Před rokem +1

      Me too..neetcode, make it happen!

    • @skyhappy
      @skyhappy Před rokem +3

      Neetcode looks like an angel for sure

  • @qazyip
    @qazyip Před rokem

    More please!

  • @salvadorortiz449
    @salvadorortiz449 Před rokem +7

    Something important is the use of descriptive names for your variables, because in this case without any previous context you won’t figure out what’s the function of “map” or “values”variables.

    • @mannyb096
      @mannyb096 Před 10 měsíci +1

      thats actually a great point! I guess in this case what kind of variable names would you use? Bcuz i cant think of what to call them other than values either lol

    • @hydromaniac7117
      @hydromaniac7117 Před 3 měsíci

      @@mannyb096 removedInt

  • @jonTheDon28
    @jonTheDon28 Před 4 měsíci +13

    None of my coding interviews for internships have been anywhere near this easy

    • @harryzhu
      @harryzhu Před 3 měsíci

      but the mock interviews from faang are - its a mock not a real assessment- its used to get a feel for the format and UMPIRE application

  • @girrajjangid4681
    @girrajjangid4681 Před rokem

    Thanks you @NeetCode.

  • @showbhik9700
    @showbhik9700 Před rokem +7

    Hey, Neetcode!
    Lovely video. Just want to say your videos helped me a lot during my interview prep for Google. While I couldn't make it there, I definitely learnt a lot.
    PS: I work with Amazon now 😉

    • @von...
      @von... Před rokem

      regarding the large layoff rumors: based on your experience there so far (& especially with how its been recently), will new-grad hiring essentially be frozen & it'll be a moot point for me to go hard on getting an interview there?

    • @showbhik9700
      @showbhik9700 Před rokem +2

      @@von... Depends on the org for which you will be selected. There are specific orgs who are getting the axe because the leadership overestimated their growth. For orgs like AWS, Whole Foods, Prime, Go, which is commodity based and have real demand, the layoffs have not been done.

    • @showbhik9700
      @showbhik9700 Před rokem

      ​@@ashiqhussainkumar1391 I am sorry about that man. I hope you get your call soon

  • @protodimbo
    @protodimbo Před rokem +1

    42:27 i'm dead 🤣 Neetcode, thanks for the video, i want to be smart like you

  • @idontseeit
    @idontseeit Před 3 měsíci

    could you use 2 hash maps? one that maps values to indexes, and one that maps indexes values? that way we can just generate a random integer from the index hash map and use that to get the corresponding value from the value hash map

  • @paulofelipe2780
    @paulofelipe2780 Před 10 dny

    Another important question that could have been asked is the range of possible values to be inserted, it can influence a lot the final solution complexity!

  • @gnes04
    @gnes04 Před 2 měsíci +2

    Ngl I thought he'd do a lot better for a meta intern. The first question was easy as balls

  • @suri4Musiq
    @suri4Musiq Před rokem

    Loved the vibe!

  • @andso7068
    @andso7068 Před rokem

    Lol, you just gotta love stack overflow

  • @saveuyghurmuslims2354

    man plz do more and more hard and prefessional plz plz we need this.

  • @tylermurphy2764
    @tylermurphy2764 Před 4 dny

    Friendship is real lol Love it!

  • @bit-learn
    @bit-learn Před 3 dny

    please @NeetCode if your are watching .. so on the first part my approach was to solve everything through set as set gives everything like adding, remove with num and generating a random number from set (we can add it again on the next line) plus on the second part where duplicates are allowed .. we can change it to hashmap so that on removing if the values aren't zero we can just remove the iteration count of the numbers or pop the number otherwise when iteration count goes 0.
    need help in clarifying it .. thanks for experience though

  • @mpi3602
    @mpi3602 Před rokem +3

    I think the end solution doesn't consider removing a value from a map that has only one index

  • @Suraj-tz3oq
    @Suraj-tz3oq Před 4 měsíci +3

    "i have ocd and this is pissing me off"
    My interviewer: get tf out then 😊

  • @yulius5916
    @yulius5916 Před rokem +3

    39:37 “bet you didn’t know that!”
    LMAO 😂

  • @RohitMenon6899
    @RohitMenon6899 Před rokem

    set() doesn’t have iterator() attribute right so the way he gets the first value of the set in the remove function won’t work.
    Correct me if I’m wrong

  • @hikari1690
    @hikari1690 Před rokem +1

    I'll be honest I was expecting a harder question. Thank you for boosting my confidence 🤣.
    But then again he is a fresh graduate/intern so I shouldn't compare myself...

  • @anonymoussloth6687
    @anonymoussloth6687 Před rokem +1

    Can you explain the follow up with allowing duplicates. I didn't understand that

  • @eddyelamin9015
    @eddyelamin9015 Před rokem +1

    Do interviews actually go like that? i started solving in javascript following a long and was happy i did good

  • @sriharisrinivasan5108
    @sriharisrinivasan5108 Před 4 měsíci

    how did I get this recommended just before the daily leetcode question became this today