Time Based Key Value Store | Netflix Coding Question | Binary Search

  Рет қаралды 10,566

AlgosWithMichael

AlgosWithMichael

Күн бұрын

Пікірлер: 42
@wishimaunicorn
@wishimaunicorn Жыл бұрын
I swear no one, i mean NO ONE on the internet could have explain this question better than you. Please do more of these!!!
@sameer9368
@sameer9368 3 жыл бұрын
I am from India...you explain algorithm like a piece of cake..you definitely deserves a beer . May God bless you
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
So nice of you, thanks for the kind words!
@xueli5641
@xueli5641 3 жыл бұрын
When I search on youtube for a Leetcode question, I know I will definitely understand how to solve it when your video is in the result list. Thanks, Michael!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Glad to hear that haha. No problem, anytime!
@majellaphilokishore8115
@majellaphilokishore8115 3 жыл бұрын
This video definitely needs a shoutout. I was looking for the exact solution for this kind of problem. Thanks to Mike and the youtube algorithm for suggesting this gem.
@noextrasugar
@noextrasugar 4 ай бұрын
Wow!!! Are you my new fav LeetCode teacher?! Subscribed and saveddddd
@ubcomewhatublv
@ubcomewhatublv 2 жыл бұрын
7:49 Not sure if I understand this part correctly. I thought according to your binary search logic, since the mid point corresponding timestamp is 5. We should set left = mid instead of right = mid - 1. In that case, left = 1 and right = 1 which led to while loop condition ends (l < r). But this is just a small bug, this video is very informative. Thanks for your efforts!
@jiecheng.x1306
@jiecheng.x1306 2 жыл бұрын
I agree with that. The while loop will stop when left = right = 1
@vedantshinde2277
@vedantshinde2277 3 жыл бұрын
How did I not think about applying a binary search?! This is why it doesn't hurt to compare solutions!!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Haha very true!
@amaansiddiqui9985
@amaansiddiqui9985 4 ай бұрын
Thank you very much cat 🐈‍⬛. Much Appreciated.
@TiffanyNg100
@TiffanyNg100 3 жыл бұрын
best explain, slow and but surely
@nitanandsingh
@nitanandsingh 2 жыл бұрын
Well Explained. Will wait for more similar videos.
@hnkien
@hnkien 3 жыл бұрын
Awesome as usual. Thank you very much Michael.
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
My pleasure!
@indola3309
@indola3309 3 жыл бұрын
I was looking for this question yesterday and so needed you to explain it.. thank you so very much..you are the best!!!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Happy to help!
@IChowdhury01
@IChowdhury01 3 жыл бұрын
Could you do a video on what strategies you use to get interviews while on a job hunt? Stuff like cold emailing, cover letters, reaching out to recruiters on LinkedIn, networking (and how you do it), etc. Would be nice to know what works for you. Thanks. Love your Leetcode videos btw, the graphics help a lot.
@codestorywithMIK
@codestorywithMIK 3 жыл бұрын
I recently got 3 offers. All 3 I got from LinkedIn contacts
@IChowdhury01
@IChowdhury01 3 жыл бұрын
@@codestorywithMIK Did they reach out to you or you hit them up on LinkedIn?
@YashTrivedi21
@YashTrivedi21 3 жыл бұрын
Thanks for the awesome video, I have subscribed you from long time and I can see that your explanations are very crystal clear, thanks for that. Also can you attach question link in each of your video as you explain them? Just a suggestion
@indola3309
@indola3309 3 жыл бұрын
Leetcode 981
@YashTrivedi21
@YashTrivedi21 3 жыл бұрын
@@indola3309 thanks!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Good feedback, I will supply the problem in the description from now on
@YashTrivedi21
@YashTrivedi21 3 жыл бұрын
@@AlgosWithMichael appreciated!
@anuragtiwari3032
@anuragtiwari3032 3 жыл бұрын
Such a smart cat ❤️❤️
@johnchoe7625
@johnchoe7625 Жыл бұрын
In the binary search, where does the + 1 come from in the "mid = (l + r + 1) / 2" ? I'm only used to doing (l + r) / 2
@keepitsimplereal7859
@keepitsimplereal7859 2 жыл бұрын
Hey Michael, would you mind explaining while(l < r ) condition in binary search as you explained when l becomes equal to r, we stop binary seach and also what's the reason behind l = mid assignment after we discover data.get(mid).timestamp
@creativecubs3588
@creativecubs3588 2 жыл бұрын
Nice explanation. Which software you are using for animations?
@ameynaik2743
@ameynaik2743 3 жыл бұрын
Do you have a video on all the variations of a binary search tree?
@LeHoangTu
@LeHoangTu 3 жыл бұрын
Well done! Thank you.
@CreativeMining413
@CreativeMining413 Жыл бұрын
How do the lists become sorted so you can use binary search? I don't see them being sorted anywhere after we set a new value + timestamp.
@bobma1550
@bobma1550 2 жыл бұрын
can you please explain line 25 ? i thought if (data.get(mid).timestamp == timestamp, then we find the answer, and can return data.get(mid).key ?
@worldwide6626
@worldwide6626 Жыл бұрын
Nice video
@bluesteel1
@bluesteel1 Жыл бұрын
Just store the midpoint whenver there's a match and keep going backwards
@louischou6780
@louischou6780 3 жыл бұрын
why do we need to create a "Data" class? Can we just use another map and store it in the list?
@sadokchebil4391
@sadokchebil4391 3 жыл бұрын
haha I like the cat
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Hahah thank you :)
@Anubis10110
@Anubis10110 3 жыл бұрын
Why get(A,4) is B Not C ??
@xueli5641
@xueli5641 3 жыл бұрын
At timestamp 4, A was not set to C yet. C was only set at timestamp 5.
Solving Meta's 2022 Most Asked Interview Question
11:40
AlgosWithMichael
Рет қаралды 18 М.
Decode String | FAANG Coding Question | Stack
17:03
AlgosWithMichael
Рет қаралды 11 М.
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 13 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 111 МЛН
Amazon Coding Question - Insert Delete GetRandom O(1)
11:54
AlgosWithMichael
Рет қаралды 10 М.
Time Based Key-Value Store | Leetcode 981
21:13
Knowledge Center
Рет қаралды 1,7 М.
Longest Increasing Path in a Matrix (DFS + Memoization)
18:47
AlgosWithMichael
Рет қаралды 19 М.
Time Based Key-Value Store - Leetcode 981 - Python
17:16
NeetCode
Рет қаралды 111 М.
Time Based Key-Value Store: 981 - faang interview question
17:17
Destination FAANG
Рет қаралды 236
Google Coding Question - Making a Large Island (Hard)
25:11
AlgosWithMichael
Рет қаралды 16 М.
Airbnb Coding Interview Question - Koko Eating Bananas [LeetCode]
21:27
Coding Interview | Software Engineer @ Bloomberg (Part 1)
30:05
Keep On Coding
Рет қаралды 4,7 МЛН
[Java] Leetcode 981. Time Based Key-Value Store [Binary Search #7]
14:04