Тёмный

Implement String Class | MUST do Question for C++ round at Microsoft, Adobe, Intuit, Oracle!! 

Keerti Purswani
Подписаться 145 тыс.
Просмотров 94 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 216   
@vidhubhardwaj9672
@vidhubhardwaj9672 День назад
I dont know if you will read this in 2024, but this question alone cleared SO MANY concepts for me and helped me in many interviews, I wasasked this question in an HFT ( he loved the fact that I answered basic details), and LOL I learnt it from here !! Thanks to him and you.
@movvamanish1467
@movvamanish1467 2 года назад
C++ teacher to Life partner long journey ❤️❤️❤️
@Manojkumar-rq8hf
@Manojkumar-rq8hf 2 месяца назад
Thank you so much for made this video. I got the same question while giving interview very recently. But, I seen this video very long time back. Luckily, I'm able to come up with proper approach because of you guys made the concept crystal clear and your C++ series and design pattern videos helped me a lot. Fortunately, I got an offer from that company as well. Thanks again for your contribution to the community!!!
@jakesmith6853
@jakesmith6853 Год назад
Yes please, more of these c++ mock interviews would be really helpful. Thank you!
@shashankcool
@shashankcool 2 года назад
Really appreciate your effort in putting up this mock interview which covers plethora of c++ topics in 45 minutes. 👍👏
@Itsme1n1ly
@Itsme1n1ly 8 месяцев назад
Excellent video for C++ developers. Thanks to both. Back in the 20's, this question was one of the most frequently asked questions in an interview. I faced it between 2012 and 2015
@88anand1
@88anand1 2 года назад
Very comprehensive 👍 Couple of points I would like to bring to your notice. 1) Calling overload > operator for strings constructed using default constructor is problematic here as resource pointer is initialized with nullptr. 2) Move constructor will not have const rvalue reference as we are resetting the values here.
@AmitKumar-ph8wm
@AmitKumar-ph8wm 2 года назад
Not sure about first point. Second point correct.
@88anand1
@88anand1 2 года назад
@@AmitKumar-ph8wm Dereferencing the nullptr in both input and output i.e. cin and cout will crash the program. Am I correct?
@arjunprasad3945
@arjunprasad3945 2 года назад
Spot on!
@abhi4unme2002
@abhi4unme2002 2 года назад
One thing that we should always remember for production quality code , is to check any pointer for null before using strcpy etc as it will crash the program, this code will not pass a code review. Kudos for bringing in so much valuable content though.
@philosophers_wool
@philosophers_wool 11 месяцев назад
Hi Keerti, First of all good video. Secondly, some noticeable points: 1) The defined >> overloading will not work properly. 2) The Move Assignment should have been implemented as it would would have cleared few points like while making statements : Ex- S2 = std::move(S1) ; Copy assignment and Move Assignment both would have been a viable option. Hence compiler will report an ambiguity. 3) As others have already mentioned, use of const in Move Constructor. But happens :) 4) A great question could also have been an explanation on how compiler knows how many bytes to delete when calling delete[] . But above all, Great Work and Really Helpful for all. Thanks to Amit too.
@samarthbillore9485
@samarthbillore9485 2 месяца назад
@@philosophers_wool delete[] would know bcz of res points to an array, it would stop when the array is completed ? Just curious, new to cpp.
@kaus05
@kaus05 Месяц назад
@@samarthbillore9485 i think when allocating memory the compiler over allocates a few bytes to store the size not sure
@shameelgoldentrio2928
@shameelgoldentrio2928 Год назад
Why is this series ended with only 2 episodes. I would like to see more of the #C++ episodes and C++ mock interviews as well. Thanks for the content Keerthi.
@kshitizjaiswal6933
@kshitizjaiswal6933 2 года назад
Legends are here after kirti proposed him
@sii4492
@sii4492 10 месяцев назад
How you know?
@divyakarlapudi
@divyakarlapudi 7 месяцев назад
True 😂
@mainakghosh7496
@mainakghosh7496 2 года назад
Any one here after the proposal video?
@shristiprakash8026
@shristiprakash8026 6 месяцев назад
clearly the best single video covering so many points... thanks a lot
@JavedKazmi-e7x
@JavedKazmi-e7x 8 месяцев назад
This video was really insightful about C++ concepts. Please create more videos like this to cover all aspects of C++
@agrawalhimanshu
@agrawalhimanshu 2 года назад
Now i Understood why Amit Kumar is chosen for this interview 😅, Happy Marriage ❤️🔥
@itsrajsoni
@itsrajsoni 2 года назад
🤣😎
@Sandeep-el4gd
@Sandeep-el4gd 2 года назад
me too 😂😂
@ajaylearningcentre8898
@ajaylearningcentre8898 2 года назад
Super.. everybody must watch this video carefully don't skip any single word...good job
@harishrawat1205
@harishrawat1205 Год назад
Perfect...spot on....looking for something like this only! Would be really helpful if you could do similar kind of interview for C++ Multithreading and Process synchronisation. Really appreciate your efforts Kirti ✌️
@tusharamrit3331
@tusharamrit3331 2 года назад
Mock C++ interview se proposal video tk ka safar💯💯
@ram9523
@ram9523 2 года назад
Need more c++ mock interviews. TQ very much
@tomaskot9278
@tomaskot9278 5 месяцев назад
Two small remarks to this great video: 1. In 25:10 the length() member function really should be const, otherwise you will restrict it to only non-const objects. I personally would consider it a mistake and would try to steer the person into thinking about it and correcting it by himself. That would show whether this was just an oversight, or if he is not aware of this at all. 2. Making a class like this and leaving destructor to the very end is also not very good. You really should write one immediately when you write the first constructor that calls new. This is just a tip what to avoid not only in interviews, but also in everyday programming :)
@ashishnamdeo7096
@ashishnamdeo7096 2 месяца назад
Thanks Keerti and Amit with such an amazing video, the very same yet with a twist i was asked to implement grep function which we used to have in unix or linux that too with use of multi-threading at Nokia for Sr. Software Er. position.
@saurabhkulkarni2841
@saurabhkulkarni2841 8 месяцев назад
Nice video . If you refer this vide your half of interview is already clear !! One small correction in Constructor and in assignment operator this->res[len] = '\0'; //null termination character This must needed I think
@akhilesh59
@akhilesh59 Год назад
Thank you for this wonderful video. I had a C++ based Interview round few days back, and I wish that I had gone through it once. The Interviewer confused me at some concepts which got cleared through this video and forever :p. However, I was shortlisted :). But I'll make sure to go through this video every time I have a C++ Interview. Love your content. Thank you ❤
@shwetabansal2202
@shwetabansal2202 2 года назад
Kriti, you videos are great . I have learned a lot from them. :) :) Please make a separate video on multithreading concepts as well.
@amchourasia
@amchourasia 2 года назад
Amazing video. Can you please use a code sharing platform such as leetcode interview or any other platform that formats the code automatically instead of doc editors. That would be helpful to the interviewee as well as to the viewers. Thanks.
@mandeepsinghsoorma3080
@mandeepsinghsoorma3080 2 года назад
I had my C++ interview coming, so that's didi for these amazing insights for the interview!!
@keshavsingh2225
@keshavsingh2225 11 месяцев назад
Very nice explanation... I found one bug, that is before inserting the value we should assign some memory to the pointer, else it will lead to segmentation fault. Please take it positively. Thanks you guys...
@daisymodi3099
@daisymodi3099 2 года назад
I think I recognize him from your recent video now 🤔
@rajgash
@rajgash Год назад
Good one Keerthi !. But few issues in this .1. Inside string one arg constructor you are using strcpy and copying ch . What if ch dangling and tempting to copy ch to res will be issue .2.also strcpy is not safe function can cause buffer overflow. 3. Towards the end he did made pointer as null and after that he tried to initialize a member var as 0 :) may be overdoing in interview . Overall good job explaining move ctr . You can also ask him what will happen if you execute move constructor before assignment operator 😊
@santanupradhan5017
@santanupradhan5017 2 года назад
👍 Nice one,need more sessions with advance C++ concepts,.thank you.
@rosansenapati-pl5hr
@rosansenapati-pl5hr Год назад
Actually the difference between copy assignment operator and copy constructor is clear now.... Great content 🔥🔥🔥
@shriramwarrior8936
@shriramwarrior8936 Год назад
Hi..please do more videos on C++ jobs and interviews. What kind of projects are done in C++ ?
@jitendraraghuwanshi1365
@jitendraraghuwanshi1365 2 года назад
There couldn't be better time for such an informative video, I have a Cpp interview coming. :D , really needed to go over the core concepts.
@KeertiPurswani
@KeertiPurswani 2 года назад
All the best Jitendra. Hope you will rock the interview 🔥🔥
@jitendraraghuwanshi1365
@jitendraraghuwanshi1365 2 года назад
@@KeertiPurswani Thanks a lot!
@junaidahmad9105
@junaidahmad9105 Год назад
The video is great with great details to concepts. One suggestion would be to not add the suggestion box exactly where he is typing ex: 24:58 . It really blocks the view and prevents us from following what is being explained. This happened many times during the video.
@JacksTravelWorld
@JacksTravelWorld 2 года назад
In case of inheritance, initializers are used to initialize base class members also
@GK-rl5du
@GK-rl5du 2 года назад
Haha.. I'm proud of my stalking skills. But in all honesty this is an excellent video, maybe you should do more collabs with him :))
@bodasumannayak1588
@bodasumannayak1588 2 года назад
Can I tell you a secret, he is her fiance 🙂
@GK-rl5du
@GK-rl5du 2 года назад
@@bodasumannayak1588 yep.. I saw that vid. Tabhi stalk krne ke baad ee vid mili thi
@GeneralistDev
@GeneralistDev 2 года назад
@@bodasumannayak1588 his LinkedIn pls ?
@gta6515
@gta6515 2 года назад
..
@rajputbharat85
@rajputbharat85 Год назад
Please Create more such Mock C++ Interview which consist topics from basic C++ to Modern C++.
@shashankagrawal3171
@shashankagrawal3171 Год назад
One mistake, in the move constructor, he used const for str, which cant be done as we are changing it inside the ctor.
@misssymone4011
@misssymone4011 2 года назад
Love this video. The text boxes with comments are really helpful
@KeertiPurswani
@KeertiPurswani 2 года назад
Thank you! Means a lot! 😇
@utkarshranjan7903
@utkarshranjan7903 Год назад
Please add more interview centric videos, This playlist is very good
@ByChris
@ByChris 3 месяца назад
Thanks!! I am preparing for an interview at Epic Games
@ravigoel4209
@ravigoel4209 Год назад
Please do continue with this C++ important concept series
@KeyserTheRedBeard
@KeyserTheRedBeard 2 года назад
wonderful content Keerti Purswani. I shattered that thumbs up on your video. Always keep up the high quality work.
@shruthakeerthis4549
@shruthakeerthis4549 Год назад
Good one guys ! Keep up the work.
@frequencyspectra1
@frequencyspectra1 Год назад
very good video. Covered lot of difficult concepts in just a single problem.
@AnkitKumar-pu2gl
@AnkitKumar-pu2gl 2 года назад
Kudos Ma'am ,it will be helpful if you make more such videos. so much concepts in one video great. 👍👍
@mayankkumarrana8942
@mayankkumarrana8942 7 месяцев назад
While righting the move copy constructor you used const reference as parameter and then assigned null values to res and length. That would not be allowed I guess as you trying to change values of a const reference. Any comments will that work?
@sharatpaul
@sharatpaul 2 года назад
move constructor should have NON constant arguement -- String(String&& str)
@amanasati5198
@amanasati5198 Месяц назад
Thanks thanks, keerti and Amit
@basawarajshivashetty5232
@basawarajshivashetty5232 2 года назад
Nice one...need one more session with more advanced oops concepts 👍👍👍👍 thank you
@colinmaharaj
@colinmaharaj 2 года назад
have you heard of c++ builder? it allows you to do rad development for windows and numerous other o/ss and new CPUs. it's native compiler and the compiler is based on CLANG.
@sophiejena5499
@sophiejena5499 2 года назад
Very very useful indeed for a C++ Developer.
@mqtlearn-kc7iy
@mqtlearn-kc7iy 3 месяца назад
Thank you for this session..it was very nice
@rajivranjan1563
@rajivranjan1563 2 года назад
Thanks Keerti !! Please make more videos on C++ Mock Interview.
@ram9523
@ram9523 2 года назад
Thank you . Wonderful video . Waiting for more of C++ related videos
@codewalalove8783
@codewalalove8783 2 года назад
Wow di amazing content. I really like the way you explain. You are an OP and my ideal. Di I request you to make similar kind of video on oops concept too.(mush in need) concept tho paad liya, but interview ready hai ya nhi ya nhi pata. Di you are our ideal please keep posting such type of content much in need. English jaad acchi nhi hai.. esliye koi flowery statment nhi likh payi.. plz ignore...
@svishnu6362
@svishnu6362 2 года назад
C++ is used in a lot in Hft forms for more execution speed. Didn’t know that it is used in non hft firms also
@NishantSharmaddn
@NishantSharmaddn 2 года назад
Very detailed explanation and use cases description. THANKS FOR MAKING THIS.
@KeertiPurswani
@KeertiPurswani 2 года назад
So glad you liked it Nishant! 🔥❤️😇
@mritunjaysingh1527
@mritunjaysingh1527 2 года назад
For str1 we don’t really need to use any initializer list or initialising vars in body. Just give default values to private members and your compiler will be happy :)
@husseinmdeihly6465
@husseinmdeihly6465 2 года назад
Hi Keerti, in overloading operator "istream& operator>>", the argument must be ONLY a String object by reference, it should not be constant. Also in the move constructor, it should not be (const String&& str) but only (String&& str). What do you think? Thanks
@stuti_ajmera
@stuti_ajmera Год назад
coming here to understand this video ,after getting the same question in interview :D
@vishvanathshintre3774
@vishvanathshintre3774 Год назад
Hi Keerti Thanks for such a nice and detailed video. It really helps, we don't get such material easily on net. It will helpful if you create such more videos on C++. Thank you again.
@26411bapul
@26411bapul 2 года назад
Wonderful mock interview 👏 👌
@TheMkools
@TheMkools 2 года назад
Very useful, thank you. Need more 😀
@chandanbhagat6584
@chandanbhagat6584 2 месяца назад
Thank you, It is very helpful :)
@Itsme1n1ly
@Itsme1n1ly 7 месяцев назад
Hi Keerthi, did you get selected for Atlassian with C++? Their JD always looks for Java spring for the backend. How to get into it as a C++ backend engineer?
@akpradhan1
@akpradhan1 2 года назад
Helped me to recall lot of concepts in a very short span
@theprofittrader4923
@theprofittrader4923 Год назад
initiliazing using move ctor, move assigment can be added as well
@ADNANAHMED-eo5xx
@ADNANAHMED-eo5xx 2 года назад
Thanks a lot for this video!!
@varunoyal87
@varunoyal87 9 месяцев назад
could you please prepare one video where can explain rvalue and lvalue with diagram or example
@m1rac1e
@m1rac1e 2 года назад
another use case would be concatenating strings(overloading + operator)
@art4eigen93
@art4eigen93 7 месяцев назад
Don't you need to call std::move() inside the function body again after passing via String&& ?
@tech_wizard9315
@tech_wizard9315 2 года назад
You seem to be such a sweet person keerti! ❤️❤️ Sending love! ❤️ - Rahul Balani
@KeertiPurswani
@KeertiPurswani 2 года назад
Thank you so much Rahul. You seem to be great too, have been supporting my content since quite some time! Thank you!!❤️❤️😇😇
@tech_wizard9315
@tech_wizard9315 2 года назад
@@KeertiPurswani yaar mai toh tumhe 1k subscribers se follow/support kr rha hu 😂 not from some time 😅 i appreciate your efforts in ur videos! 🤗
@KeertiPurswani
@KeertiPurswani 2 года назад
Hehe. I said quite some time. Iska matlab bahut sara time 🤭 And thank you. Forever Grateful ❤️😇
@tech_wizard9315
@tech_wizard9315 2 года назад
@@KeertiPurswani there is a concept of "rule of 3" in cpp….. Can I skip it or should I do it for tech interviews?
@jitendraraghuwanshi1365
@jitendraraghuwanshi1365 2 года назад
@@tech_wizard9315 it's quite important concept, not that difficult imo if you have an understanding of copy constructors and copy assignable . Good Luck
@gopisanskar
@gopisanskar 2 года назад
Very helpful. Please bring more such videos
@santanagopalasubrahmanyamy7473
@santanagopalasubrahmanyamy7473 2 года назад
at 18:09 the question is valid as len is private can't be used directly by objects
@santanagopalasubrahmanyamy7473
@santanagopalasubrahmanyamy7473 2 года назад
@Keerti Purswani I guess it should be str.length() function call. Correct me if I'm wrong
@KeertiPurswani
@KeertiPurswani 2 года назад
It is being used by object of same class and it’s a private member. That’s why it can be used
@santanagopalasubrahmanyamy7473
@santanagopalasubrahmanyamy7473 2 года назад
@@KeertiPurswani str is another object and str.len, str.res are private. We are using these inside constructor of class. May be I'll code it to get some clarity. Thanks for making this video it really gave some sparks to my brain. It has been years since I have used a friend or operator overloading.
@SK-ud3eg
@SK-ud3eg Год назад
Can you assign a const rvalue String&& str to nullptr?? passed inside the move constructor?... even when you do it some how making it non const would you be able assign 0 to the str.len after assigning str to nullptr?? ..... at 40 to 45 minutes in the video.... not sure if its a mistake or if I am wrong... I appreciate the great content though.
@sravs8155
@sravs8155 2 года назад
Wonderful , just wished such video was made earlier 👍
@revankumargnanavel64
@revankumargnanavel64 6 месяцев назад
I have a doubt with respect to the implementation. Why is it that we are trying to use the string functions like strlen and strcpy when we are trying to mimic the string class itself? It looks like monkey patching to me. I would really love if anyone could clarify this.
@pavan_talluri6540
@pavan_talluri6540 6 месяцев назад
Thanks for the video
@jenrrytan4928
@jenrrytan4928 11 месяцев назад
There's a problem,swap passed first param with this which is pointer not a references
@shankarBinnar-xl8en
@shankarBinnar-xl8en Год назад
very helpfulll!!! thanks!!
@whatismynamew
@whatismynamew 9 месяцев назад
In move constructor how are you setting str = nullptr when str is of type String and not a pointer.
@premanshdewangan8695
@premanshdewangan8695 2 года назад
Can you please complete the design pattern series. It's been quite a time u have not uploaded any video on it. Btw really find this video helpful. Thankyou 😊
@KeertiPurswani
@KeertiPurswani 2 года назад
I was planning to finish in jan but something came up. Left Intuit also. Need another 10-15 days. Everything is ready. Just need to find time to record. Sorry for the inconvenience caused but I promise, I will finish it for sure!
@premanshdewangan8695
@premanshdewangan8695 2 года назад
No problem 👍 Take your time 😊@@KeertiPurswani
@shreeniwasdaulatabad3373
@shreeniwasdaulatabad3373 6 дней назад
Where is the interview?
@--------------------------2792
@--------------------------2792 2 года назад
a dsa video here or there wont hurt i guess i subscribed cuz i wanted that not so many mock interviews.
@vimleshkumarkanaujiya
@vimleshkumarkanaujiya Год назад
At the end of your description block, make sure to put the LinkedIn profile of those who have interviewed with you.
@nagrotte
@nagrotte 8 месяцев назад
String concatenation- + overload?
@art4eigen93
@art4eigen93 2 года назад
This vid needs more views/likes
@1anuragmishra01
@1anuragmishra01 20 дней назад
Best Video on C++ class and all related concepts, std::cout
@interested_in_everything
@interested_in_everything 2 года назад
Make more of these C++ interviews.
@utkarshpatki7069
@utkarshpatki7069 2 года назад
Thank you...!! 💯🔥🔥
@KeertiPurswani
@KeertiPurswani 2 года назад
Glad you liked the video Utkarsh ❤️❤️
@RAMANKUMAR-xl4pr
@RAMANKUMAR-xl4pr Год назад
Hi Keerti, C++ related quality content is not available on youtube, If you will create it would be helpful. Thanks for videos.
@purviparmar8649
@purviparmar8649 Год назад
If we use move constructor, then the original objec tis deleted and the same vakue assigned to new object. So my question is if we are using the same value for the object then why can’t we use the old object?
@root8686
@root8686 2 года назад
I have a question here. I hope you won't mind. When an interviewer says implement "your" string class, doesn't that mean that we have to implement our actual class? Like for the 'length' function we have to do the parsing and find out the length instead of using a predefined function, for copying we have to copy character by character instead of using strcpy. I mean it doesn't make sense for me to use predefined functions in our functions and call it "our class". @Keerti Purswani
@SK-ud3eg
@SK-ud3eg Год назад
If you know how much time costly a for loop or any loop is for copying individual characters ... you would not say that... yes we can use user defined implementations for them instead of standard lib functions... thats our choice to use the best in that scenario...
@shriramwarrior8936
@shriramwarrior8936 Год назад
Seimens C++ interview: Implement array from scratch 😢
@santanupradhan5017
@santanupradhan5017 5 месяцев назад
str3 = "hello"; // first parameterized constructor will called then copy assignment operator will get called
@aswathysanil748
@aswathysanil748 Год назад
Very good class
@vaibhaves
@vaibhaves 2 года назад
The text blocks the code at times and its a bit distracting...it would be better to hide the faces and put the text there
@KeertiPurswani
@KeertiPurswani 2 года назад
Will do that Vaibhave. Thank you for your feedback! 😇
@bruvhellnah
@bruvhellnah 2 года назад
At what yoe will you expected to solve such a question in the interview? Like straight up be asked to impliment a string class itself.. I thought I had a good grasp on cpp but now i feel very demotivated lol
@utkarshsahu6572
@utkarshsahu6572 2 года назад
Great work di!!
@KeertiPurswani
@KeertiPurswani 2 года назад
Thank you! Hope you like the video 😇
Далее
31 nooby C++ habits you need to ditch
16:18
Просмотров 803 тыс.
Software Engineering Job Interview - Full Mock Interview
1:14:29
how Google writes gorgeous C++
7:40
Просмотров 914 тыс.