Hey @NeetCode thanks A TON!! I couldn't have cracked FAANG interviews without your help. I interviewed with 3 FAANG companies and got offer letters from 2. This is the biggest milestone of my life and yes a dream come true. So thank you very much for all the great work you're doing :) You THE G.O.A.T. !!!!!
@NeetCode2 жыл бұрын
Congrats, you deserve it!!! 🎉🎉🎉 And thanks for the kind words.
@rideraff2 жыл бұрын
@Aman Daredi Hi, I split my preparations into 3 parts. 1. Coding, 2. Behavioral, 3. System Design. Let me explain in fewer words as possible, 1. Coding: I solved around 130 leetcode questions -> Blind 75 + Top questions from leetcode (I skipped some ofc :D ). Despite doing that I still got questions in the interview that were not available on leetcode or any other forums. I didn't completely bum out on those, I was able to implement 75% - 90% of the problem in the interviews. So, It's not about how many problems you solve, It's about understanding the common patterns and implementing them. Neetcode explains it so well in this video: kzbin.info/www/bejne/l5KVmp2vjKd1f8U&ab_channel=NeetCode . Note: In the interviews, make sure you talk through your logic before coding. Mention the time and space complexities even before they ask. Also, explain how you measured time and space complexities for your logic. Quick Tip: Before jumping into leetcode, get better at basics. Data Structures, Common search and sort Algorithms, common Traversals, complexities, etc. Spend some time on this. Sometimes the interview problems may be so easy to implement but your lack of knowledge in the basics would fail you under the pressure (Trust me you do not want be in such situations) For example, instead of memorizing that Dictionary lookup is O(1), you should know what "lookup" is and how it works for a dictionary. Then you'll be able to calculate the complexity for any given data structure or algorithm easily. 2. Behavioral: Amazon leadership principles cover most of the behavioral questions asked in any interview. I have a list of questions here - github.com/chickenwingstossed/behavioralquestions . This list has amazon questions and additional questions which I have gathered from my experience. 3. System Design: This really comes down to the title, the company, and the job description of the position you have applied for. The recruiter may or may not give you details about the team but you can still ask them. Just make sure you learn the common System Design questions and Design Patterns. I hope the above helps. Best of luck to everyone. Never. Give. Up. Keep grinding \m/ Thank you @NeetCode for giving me this opportunity to share my experience.
@leeroymlg4692 Жыл бұрын
congrats!
@maheshtiwari-yo8ux10 ай бұрын
Hey @rideaff, I am also preparing for FAANG would like to connect and discuss . Please provide your linkedin profile.
@uditsharma56882 жыл бұрын
Direct swap and stack solutions were intuitive for me but didn't notice that we could also use recursion. Thankyou for showing multiple solution instead of giving just the most efficient one. 👍
@gianniprocida33322 жыл бұрын
This channel is extremely undervalued. It should have at least 500K subscribers.
@floydian25 Жыл бұрын
Incase someone is looking for a solution for a string: def reverse(s): if len(s) == 0: return s return (reverse(s[1:]) + s[0]) Here is how it works: Input: "hello" reverse("hello") reverse("ello") + "h" reverse("llo") + "e" reverse("lo") + "l" reverse("o") + "l" reverse("") + "o" => "" + "o" => "o" + "l" => "ol" + "l" => "oll" + "e" => "olle" + "h" => "olleh"
@NeetCode2 жыл бұрын
A big change from yesterdays Hard to todays... reverse a string
@__________________________69102 жыл бұрын
😏
@clashgamers40722 жыл бұрын
They changed it to weekly .I guess this week is two pointers.
@Cloud-5772 жыл бұрын
Please I need an advice. I have been doing leetcode questions for over 3 months now (this is my first time. I’m new to this). I have definitely improved but I don’t think I’m ready for technical interviews yet. How do I improve quickly? I really need to find a job asp for my own mental health wellbeing
@CoolerJ0k3r2 жыл бұрын
If you aren't already then you'll want to apply to any position you believe you are somewhat qualified for. The best practice you can get is actual technical interviews. You just need to be prepared to receive rejection emails or no response at all. Apply to the jobs you actually want once you feel a bit more comfortable with the technical interviews.
@Cloud-5772 жыл бұрын
@@CoolerJ0k3r thank you for the advice. I appreciate it. You are right. I will never know until I try
@marcus22245 ай бұрын
Heyy buddy,which position did you get?
@triggeredcomments40092 жыл бұрын
Why is stack faster? According to me both of them are pretty much similar interns of no.of operations and loops
@shakhaoathossain5032 Жыл бұрын
Slicing works but Incase interviewer doesn't allow us to use built in functions then swapping is great
@__________________________69102 жыл бұрын
No way, I love you because you upload videos everyday.
@NotKevinNguyen2 жыл бұрын
Isn't s.reverse() also works for this problem?
2 жыл бұрын
I think the biggest reason the input is a "char[]" instead of "string" because in most languages strings are immutable. That means, you can't change them once you create it. Even if you think you change them, you actually create a new string object which automatically means that you need an extra memory. en.wikipedia.org/wiki/Immutable_object
@ahmadtarawneah2 жыл бұрын
Thank you for your amazing videos
@kritikabhateja1102 жыл бұрын
Why s=s[::-1] is not working? Could you please tell.
@issamuhsen1245 Жыл бұрын
F
@nikhil_a01 Жыл бұрын
The problem requires you to modify s in place. What s=s[::-1] does is create a new reversed list and then assign it to s. If you do s[:] = s[::-1] it will actually copy each element of the reversed list into s. More in-depth explanation: Imagine you have a list and a variable arr which points to it. arr -> [1, 2, 3, 4] When you call reverseString(arr), inside the function the variable s is ANOTHER pointer to the input list. arr -> [1, 2, 3, 4] [1, 2, 3, 4] s -> [4, 3, 2, 1] But when you return from the function, s goes away since it's a local variable. LeetCode checks the value of arr and sees that you haven't reversed it.
@harveylesterarcilla93292 жыл бұрын
using slice trick print(s[::-1]) should work as well
@juansymontano6 ай бұрын
and you won't get hired, this problem is not a test of your syntax
@christinaphan51242 жыл бұрын
thanks for the videos! also, what software are you using to draw?
@NeetCode2 жыл бұрын
I use Paint3D
@fieryfeather2 жыл бұрын
Would the space compexity of the recursive solution be O(1) for languages that support tail recursion?
@vdyb7452 жыл бұрын
Great going !!!!
@pauljones91502 жыл бұрын
Love your stuff
@lymphtics92182 жыл бұрын
Could someone explain what would be the space and time complexity of reversing a string in JS using built in methods like str.split(‘’).reverse().join(‘’)
@omkarbhale442 Жыл бұрын
Asymptotically O(n), but much slower.
@anatoliy-gr Жыл бұрын
thanks for help!!!
@saraex85582 жыл бұрын
Thanks
@dandendrasingh73262 жыл бұрын
Aren't the first solution is n/2? And why the stack solution is faster then the first one.
@CoolerJ0k3r2 жыл бұрын
Big O notation doesn't care about the insignificant values. The only thing that matters is the part of the notation that is most significant. For example if you had an algorithm that took 3n^2 + 6n + 1 to run then the big O would be O(n^2) because n^2 is the most significant part. It would also not be n/2 because you access each element within the array once and there are n elements. Sorry if I didn't explain it very well.
@derekyoungman38952 жыл бұрын
No big O notation disregards constants, and runtime is inconsistent, the second solution might not actually be faster on average
@derekyoungman38952 жыл бұрын
The definition of big O notation is as follows: Consider 2 functions f(n) and g(n) f(n) is in O(g(n)) if there exists constants a and c such that for all n >= a, f(n)
@algorithmo1342 жыл бұрын
What software do you use to record your videos?
@domeshsinha76702 жыл бұрын
if possible to use nodeJs then please solve problem on nodeJs
@_sam_ael9 ай бұрын
I used a while loop, then i start print with the last index the ... Until the index 0
@weishin2 жыл бұрын
are you using your mouse to draw?????
@NeetCode2 жыл бұрын
perhaps
@weishin2 жыл бұрын
@@NeetCode what a boss
@numberonep54042 жыл бұрын
Two other solutions, first another even less efficient stack solution: class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ stack1,stack2 = [], [] while s: stack1.append(s.pop()) while stack1: stack2.append(stack1.pop()) while stack2: s.append(stack2.pop()) then another iterative solution : class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ n = len(s) for i in range(n//2): s[i], s[n-i-1] = s[n-i-1], s[i] Making it 5 more or less efficient ways to do the same thing xD coding is fun
@tanoybhowmick8715 Жыл бұрын
Oh great!
@rajatagrawal70162 жыл бұрын
Java class Solution { public void reverseString(char[] ar) { int i=0; int j=ar.length-1; while(i
@JimmyBrock Жыл бұрын
What about... return s[::-1] ???
@juansymontano6 ай бұрын
You need to reverse it in place, the s is still in the same order
@vineethnc89342 жыл бұрын
Please solve Leetcode 321 ..
@gonzalochacaltana2735 Жыл бұрын
Other way: new_str_list = [] new_str_list[:0] = "".join(str_list)[::-1] return new_str_list
@ericlefort2 жыл бұрын
Just came here to say [::-1]
@kritikabhateja1102 жыл бұрын
I was also thinking this. But in leetcode it didnt work. I dont know why