Mock Coding Interview with incoming SDE at Microsoft -

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • In this video, I tried something different to reflect how really interviews happen. Everyone makes mistakes and might needs hints but the point is thought process.
    In this video, I hope you enjoy seeing how ‪@NishantChahar11‬ explored the possibility of using DFS to DP and finally ended up using Greedy method.
    I hope you like the video.
    Here are the links of both the questions-
    www.geeksforgeeks.org/policem...
    www.geeksforgeeks.org/minimiz...
    You can get 𝐃𝐈𝐒𝐂𝐎𝐔𝐍𝐓𝐒 using code "KEERTI" -
    ➡️ On 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐑𝐞𝐚𝐝𝐲 - get.interviewready.io/?_aff=K...
    ➡️ On all 𝐆𝐞𝐞𝐤𝐬𝐅𝐨𝐫𝐆𝐞𝐞𝐤𝐬 paid courses - practice.geeksforgeeks.org/co...
    You can also connect with me on-
    𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 (for not so professional, chill side of my life) - keerti.purs...
    𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 Channel - t.me/keertipurswani
    𝐓𝐰𝐢𝐭𝐭𝐞𝐫 - KeertiPurswani?s=09
    𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 - / keertipurswani
    The video contains following parts-
    0:00-0:50 - Introduction
    0:50-33:20 - Question 1
    33:20-43:20 - Question 2
    43:20-43:06 - Feedback and conclusion

ความคิดเห็น • 425

  • @codingessential91
    @codingessential91 2 ปีที่แล้ว +420

    Successfully cracked my MS interview today. Feeling great. Work hard guys it is worth the effort

    • @whatis962
      @whatis962 2 ปีที่แล้ว +6

      Ms from iit or somewhere abroad

    • @khushiswaradityaghidode4629
      @khushiswaradityaghidode4629 2 ปีที่แล้ว +40

      @@whatis962 he said Microsoft not masters 🤦‍♂️

    • @PinkiKumari-bt1ei
      @PinkiKumari-bt1ei 2 ปีที่แล้ว +2

      Can u plzz give some tips from where to start and end and when Application comes out for MS recruitment 🙏🏻🙏🏻

    • @animeshanandcool
      @animeshanandcool 2 ปีที่แล้ว +2

      Hii..So they only ask coding logic or theory also in interviews....I am curretly in testing from 2 years and learning DSA

    • @terra3673
      @terra3673 2 ปีที่แล้ว +15

      No one cares

  • @abhishekgarg0304
    @abhishekgarg0304 2 ปีที่แล้ว +14

    Hi Keerti, thanks for putting this type of content out. You actually looked like one of the interviews who are serious as well as 'nice' and helpful' at the same time giving space to the candidate to express themselves.
    The way you have edited the video giving references to what needs to be done when and the approach to be followed is also very helpful !
    Thank you Keerti !

  • @anshusinha2135
    @anshusinha2135 3 ปีที่แล้ว +61

    Please do such more mock interviews.Thanks for doing such videos :)

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +7

      For sure. I hope the videos help 😇😊

    • @aniketprasad1889
      @aniketprasad1889 3 ปีที่แล้ว +1

      Yes mam please make more videos

  • @ratulc
    @ratulc 3 ปีที่แล้ว +56

    This is the most realistic mock interview I have seen honestly. More like this is really helpful!!

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +2

      Thank you so much Ratul. Means a lot. Hope you like rest of the videos as well 😇

  • @mohammedmustufa9928
    @mohammedmustufa9928 3 ปีที่แล้ว +17

    Love the way how you also provided what the expectation of the interviewer at that particular time was. Really helped in understanding how an interviewer thinks. Thank you :)

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +3

      Thanks! Hope you like rest of the videos as well 😇😇

  • @yashlearnscode5502
    @yashlearnscode5502 3 ปีที่แล้ว +55

    I've never seen Nishant this serious, lol. Great job, you guys. Keep the good content flowing.

  • @shaileshbharti1026
    @shaileshbharti1026 3 ปีที่แล้ว +238

    Productive one 💯
    More mock interviews like this ...pls
    At least we freshers will get an idea what will have to do and not to do😅

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +45

      Yup. That's the purpose. Entire playlist will be there. Stay tuned! 😊😊

    • @abhishekhorton79
      @abhishekhorton79 3 ปีที่แล้ว +2

      @@KeertiPurswani thankyou dii

    • @shaileshbharti1026
      @shaileshbharti1026 3 ปีที่แล้ว +4

      @Satish Sutar thanks to YT and especially Jio 😂

    • @shaileshbharti1026
      @shaileshbharti1026 3 ปีที่แล้ว +2

      @@KeertiPurswani Yes ✌️

    • @sanujitmajhi4232
      @sanujitmajhi4232 8 หลายเดือนก่อน

      can u bring hitesh choudhary and some foreign coder@@KeertiPurswani

  • @shehzadahmed693
    @shehzadahmed693 3 ปีที่แล้ว +14

    Thanks for sharing the tips as an interviewee! Please make such content in the future Keerti!

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +2

      For sure Shehzad. So glad you liked it 🙏😇

  • @sraynitjsr
    @sraynitjsr 3 ปีที่แล้ว +122

    Great , specially awesome from Nishant, very few people will have the courage to give mock interviews publicly, that too after being selected at Microsoft, shows that he is ready to accept his mistakes and keep learning from whatever opportunity he gets.
    And interviewer was really helpful 😅

    • @NishantChahar11
      @NishantChahar11 3 ปีที่แล้ว +41

      😁❤️

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +22

      Exactly. It takes a LOT of guts and he agreed in once and was a great sport. More power to him❤️

    • @abhigyansharma9108
      @abhigyansharma9108 3 ปีที่แล้ว +2

      @@NishantChahar11 Bhai Yh questions ko itna logically reach krna leetcode se aa paega yaa cp bhi krni hi pdegi... Please answer

    • @niteshnareshnarwade321
      @niteshnareshnarwade321 3 ปีที่แล้ว +1

      @@abhigyansharma9108 cp must ..... do on codeforce

    • @harshpanwar8205
      @harshpanwar8205 ปีที่แล้ว

      @@niteshnareshnarwade321 not mandatory

  • @rajdeepnagar7845
    @rajdeepnagar7845 3 ปีที่แล้ว +4

    video is to the point,the best thing i like,no unwanted discussion in starting and last ,they just start a video by solving questions and end up with conclusion.👍👍
    keep it continue !

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      Thanks Rajdeep. Means a lot 😇😇

  • @chandrachudpati902
    @chandrachudpati902 3 ปีที่แล้ว +3

    These videos are so informative and insightful. Just one thing after 2 months into leetcoding, whenever there is a term/relation to maximize the minimum or minimize the maximum, the first approach should be to solve using Binary Search! I guess it would even work in the second problem.

  • @arihantjain8559
    @arihantjain8559 3 ปีที่แล้ว +25

    His approach for the second question was wrong, he should have divided the number in 2 equal parts for even and (x-1/2, x+1/2) in case of odd.
    His approach will fail for A = [1, 100] k =1.
    he will give 99,
    but answer is 50

    • @arihantjain8559
      @arihantjain8559 3 ปีที่แล้ว

      @UCpm7NOlzwUeehNpbBY8GAcg ur logic fails for the case that I have provided above lol 😂

    • @saksham2091
      @saksham2091 3 ปีที่แล้ว

      I noticed that too! Also the second question was too easy and such questions rarely come up in an interview

    • @isharthrastogi782
      @isharthrastogi782 2 ปีที่แล้ว

      @@saksham2091 can you tell me the solution with priority queue?

    • @sayandeepghosh2911
      @sayandeepghosh2911 2 ปีที่แล้ว +2

      I think it can be solved using binary search

  • @dhruvpurwar6642
    @dhruvpurwar6642 3 ปีที่แล้ว +75

    This is absolute gold. I urge you to please make an entire playlist with different incoming SDE's so we can see how different people handle the process . ❤️❤️

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +13

      For sure Dhruv. Stay tuned 😇
      And please do share the videos with your friends 🙏

    • @TheArchit1
      @TheArchit1 2 ปีที่แล้ว +5

      There is no gold in this. The first question was a failed attempt to display irrelevant graph and backtracking approach before finally doing a greedy solution which he couldn't even explain , the second question was just plain wrong, the solution was to use binary search. Gold my a**.

    • @k9killer
      @k9killer 2 ปีที่แล้ว

      bro same , i didn't even not get clear understanding of 1st ques and solution he does , finally sigh of relief , that it is not possible to attempt best in interview everytime

  • @sakshamvijay7451
    @sakshamvijay7451 3 ปีที่แล้ว +44

    Me:- Concentrating on the code and explanation
    Also Me:- Bhai Thief ki spelling galat h......

  • @acousticIndie
    @acousticIndie 3 ปีที่แล้ว

    Thank you, ma'am, for those tips you flash in between also help us greatly as to how the interviewer might be thinking. Very helpful, thank you!

  • @rydham8252
    @rydham8252 3 ปีที่แล้ว +40

    Wow . This was an amazing mock interview. I myself really have come to know about lot things by watching the whole video which would not be possible if I would just had read some interview experience. Your videos are literally good . Keep uploading this kind of content 😊

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +4

      Thanks Rydham. So so glad you liked and learnt from it! 😇😇

  • @harshavardhanragi6838
    @harshavardhanragi6838 3 ปีที่แล้ว +4

    Thanks for this video keerti. It would be grateful if u could upload this type of content frequently. I am also from NIT CALICUT and as your junior i am really proud of you

  • @ashutoshsingh5568
    @ashutoshsingh5568 3 ปีที่แล้ว +7

    Good one. this kind of interviews will give us path to focus more on problem solving skills.
    Thanks for sharing.
    I also follow Nishant channel so I also wanted to see how he performed here. 😅

  • @soumyadiptabanerjee8256
    @soumyadiptabanerjee8256 3 ปีที่แล้ว +22

    Even I overlooked the 2nd test case . It changes the whole situation.

    • @tarunbisht8016
      @tarunbisht8016 3 ปีที่แล้ว +3

      but if in 2nd test case k would be onw then a-b approach is wrong ig

  • @jashanbansal2613
    @jashanbansal2613 3 ปีที่แล้ว +10

    First time I have seen that much long video completely. Great Interview Keerti, Good job Nishant :)

  • @deadpool_0077
    @deadpool_0077 3 ปีที่แล้ว +2

    This was great, I was coming up with the solution myself, and was applying my approach on docs.. please do more of these. :)

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      That's exactly how you are supposed to watch these videos. More power to you ❤️
      Hope you are liking rest of the videos as well 😇😇

  • @omkarshendge5438
    @omkarshendge5438 3 ปีที่แล้ว +15

    Wow this was definitely one of the best mock interviews I've seen so far. 😂 I was pausing just before Nishant bhai and was trying to answer the question given by mam and lol even I did the same mistake of not properly reading the 2nd point. 😅😂
    Yes mam, actually she even gave the time to read the question and also explained it a bit also told us that we didn't read the second point I don't think some Interviewers will be this patient and supportive tho

  • @rakshitsahu3417
    @rakshitsahu3417 3 ปีที่แล้ว +11

    Sliding window is a good approach for the first one. We can solve it in one pass

  • @ravishasharma1219
    @ravishasharma1219 3 ปีที่แล้ว +7

    I am a second-year student. I kept trying it alongside and taking hints whenever you gave. I really enjoyed this. Please upload more such mock interviews.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +2

      More power to you Ravisha. If you are already doing this in second year, I am sure you are gonna do just amazing in future. Keep going ❤️

    • @ravishasharma1219
      @ravishasharma1219 3 ปีที่แล้ว

      @@KeertiPurswani Thank You♥️

    • @palashagrawal2343
      @palashagrawal2343 3 ปีที่แล้ว +2

      @@KeertiPurswani 😁 BTW I am doing it in 1st year(Non- CS branch though)☹️

  • @GauravSingh-lo4jv
    @GauravSingh-lo4jv 3 ปีที่แล้ว +28

    This was an amazing video, shows how things actually goes in a real DSA round. I think it will be helpful for those who are new and unaware of this. Also, will help as a guide to boost confidence before any actual DSA interview.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +4

      Thanks Gaurav. That's exactly what I was hoping for. Many videos coming up soon! 🙂🙂

  • @helloworld6653
    @helloworld6653 3 ปีที่แล้ว +36

    He definitely didn't answer the first question properly... As it's a straight forward greedy problem and he is thinking of doing graph, backtracking and all. If this is a interview he will be definitely rejected!!!

    • @ritwikchakraborty1702
      @ritwikchakraborty1702 3 ปีที่แล้ว +3

      yes it is greedy bro i also think ... simple maniplutaion with index

    • @harshavardhanranger
      @harshavardhanranger 3 ปีที่แล้ว +2

      how can u directly conclude its a greedy prob, unless u first brainstorm the solutions possible and understand the core of the problem. He was really good to do that.

    • @helloworld6653
      @helloworld6653 3 ปีที่แล้ว +6

      @@harshavardhanranger yes you need to think for a while, but not 30 minutes to come up with the approach after so many hints... I am not opposing nishant bhai, ppl sometimes may stack with the problem, but just want to say it was not up to mark performance to clear interview if it was an actual interview...

  • @ankita8199
    @ankita8199 3 ปีที่แล้ว +1

    Awesome video, get to know about really good perspective of how to approach solution and communicate with interviewer.
    Please make more videos like this!

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      So glad you liked it Ankita. Thank you❤️🙏😇

  • @SonuKumar-sf1ch
    @SonuKumar-sf1ch 3 ปีที่แล้ว +3

    This is Amazing!
    Taking more mock interview for helping people.

  • @gomzysharma
    @gomzysharma 3 ปีที่แล้ว +4

    this is so amazing that you have embedded comments for us... Thanks for your time :)

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      So glad you liked it. Thank you ❤️😇

  • @rishabhkalra9505
    @rishabhkalra9505 3 ปีที่แล้ว +31

    honestly, i was surprised with this approach. I initially came up with the optimised approach but then after following the video for first half, i was like, maybe this approach is better and the moment you guys came to the optimised version, i literally paused the video and gave a pat on my back :p Good content. Learnt a lot from this.

  • @shashankprabhu4126
    @shashankprabhu4126 3 ปีที่แล้ว +6

    This video was soo good ma'am. Me as a 1st year student of CS, i have an idea of how mock interview would be and how we can talk and prepare for it. More mock interview and more questions plz would love it

  • @anaranyabose
    @anaranyabose ปีที่แล้ว +3

    Solved both in 20 mins 😁thankyou

  • @AmanSharma-vb5jl
    @AmanSharma-vb5jl 3 ปีที่แล้ว +6

    Mam it is the one of the best interview with tips , thanks mam ,,it taught me a lot that i could not able to learn in 4yrs of my college.

  • @littlemaster7426
    @littlemaster7426 3 ปีที่แล้ว

    Seeing this ,I learnt a lot ,thank you very much Mam . Please upload more these types of mock interviews

  • @hrishikeshnikam1584
    @hrishikeshnikam1584 3 ปีที่แล้ว +16

    This was amazing!
    Could you have students from TIER 3 COLLEGES who have cracked product based companies or FAANG . That would be great!

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +4

      Sure, noted 😊

    • @hrishikeshnikam1584
      @hrishikeshnikam1584 3 ปีที่แล้ว +3

      @Satish Sutar I am aware of that. And I'm a third year student from a Teir 3 college and I'm trying my best to change the fact that product based companies overlook Tier 3 college students.

  • @vishakhasinghal1652
    @vishakhasinghal1652 ปีที่แล้ว +5

    it was a fantastic interview given by nishant to u his concept clarity is outstanding and as an interviewer urs as well . i liked the way u r connecting with him in between the time when he was answering . superb guys .keep going keerti and nishant

  • @prashantprogrammer8699
    @prashantprogrammer8699 3 ปีที่แล้ว

    more mocks like this would be great!!

  • @salvo9696
    @salvo9696 3 ปีที่แล้ว

    Can you do some frequently asked leetcode or hackerrank questions and the approach to solve them, what data structures should one use and why. Also some problems do not have a straightforward time and space complexity, so how do we tackle those. And keep going this is absolutely great and very helpful.

  • @GeniuslyTensai
    @GeniuslyTensai 3 ปีที่แล้ว

    Ma'am just wanted to know that during coding interviews are usage of STLs prohibited or are asked not to use them?

  • @shivammishra-sj8jo
    @shivammishra-sj8jo 3 ปีที่แล้ว +12

    Kindly organise such interveiw often so we can get an idea

  • @kanishkanand1555
    @kanishkanand1555 3 ปีที่แล้ว +1

    Mam how do you select questions there is so much on gfg that it seems difficult to find good qs like these .

  • @mano3680
    @mano3680 3 ปีที่แล้ว +1

    Gud work! Please do more mock interview like these...Thank you!

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      One more is up today. Hope you like it ❤️😇

  • @Smile2021
    @Smile2021 ปีที่แล้ว +1

    Pahli baar hasi udi hai chahar bhai ki🫡🫡

  • @prasantharavindramesh1078
    @prasantharavindramesh1078 3 ปีที่แล้ว +2

    Awesome video.Itll be very useful for us if you can make more mock interviews especially for Amazon

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      Yup. Hoping the videos will help 😇😇

  • @timetoknow3171
    @timetoknow3171 ปีที่แล้ว

    Hi , I came across the video after watching the striver mock interview . Worth it .

  • @ShubhamKumar-pv8pj
    @ShubhamKumar-pv8pj 3 ปีที่แล้ว +4

    I don't know why I am getting nervous while reading the questions 😄
    Thank you for giving us Idea what to do and not to do ❤️

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +4

      Happens with everyone Shubham! Hoping the videos help 😇🙏

    • @ShubhamKumar-pv8pj
      @ShubhamKumar-pv8pj 3 ปีที่แล้ว +3

      @@KeertiPurswani definitely it help ma'am for student like me who just get admission in college 😊

  • @deepanshupratik2595
    @deepanshupratik2595 3 ปีที่แล้ว

    I wanted to ask one thing that in interview they ask this way or at some platform like hackerrank where we have a lot of test cases including edge cases as its really difficult to detect every edge case by our own?

  • @souravsinha4173
    @souravsinha4173 2 ปีที่แล้ว +2

    I think Nishant bhaiya's approach for the second question will fail for the testcases like 2,100 and k = 1. Here Max(A) = 100 , Max2(B) = 2 ; So , C = 100 - 2 = 98 ; after inserting in priority queue we get {98 , 2 , 2} in priority queue. Since we have already exhausted our k(k was 1), our max answer will be 98 , but ideally it should have been 50.(If we had simply divided it by 2).

  • @SaurabhSharma420
    @SaurabhSharma420 3 ปีที่แล้ว +7

    The first question was very simple, 2 iteration (forward and backward) would have done the task. The question would have been solved for not more than 20 mins.

    • @nikunjkhakhkhar1030
      @nikunjkhakhkhar1030 3 ปีที่แล้ว +1

      That seems to be a greedy approach which won’t work in second case since if P at index 2 catches T at index 1 then P at index 3 won’t be able to catch T at index 0 since distance is larger than k=2, so I don’t think it will work.

    • @SaurabhSharma420
      @SaurabhSharma420 3 ปีที่แล้ว +1

      @@nikunjkhakhkhar1030 why would P at index 3 need to catch T at index 0.. T at index 0 will be taken care bt P at index 2, for K=2

  • @aayushpatel792
    @aayushpatel792 3 ปีที่แล้ว

    Very helpful session done by you and Nishant Bhaiya.Thank you

  • @Kavishkhullar
    @Kavishkhullar 3 ปีที่แล้ว

    I liked the questions. There are lot of mock interviews floating around using the easily available/popular questions.Definately that's not the case here. Where you got these questions?

  • @prakashg1944
    @prakashg1944 3 ปีที่แล้ว

    Really good one, keep going..... You finally smiled at 32:04, till then you kind of giving a confused look :) ... I also can hear some background noise/feedback, it could be a fan sound or something.. not sure..

  • @firdoushsiddique1280
    @firdoushsiddique1280 3 ปีที่แล้ว +4

    #Keerti Purswani
    thanks for letting us to have Idea about interview session and also to expand the horizon.
    a humble request to you to share your knowledge with us regarding learning d s algorithm and programming questions so that we can take start early
    Doing the great work keep it up 👍👍

  • @SaiKumar-kt7cc
    @SaiKumar-kt7cc 3 ปีที่แล้ว

    Explaining the question looks great. coz it gives better understanding and can get more hints😂

  • @vibhubhatia8992
    @vibhubhatia8992 3 ปีที่แล้ว

    I think we can do it using 2 queues one to stores police indexes and one for thief indexes and while inserting we will check whether there is an index in the other queue which can cancel this index or not

  • @shivabansfore7510
    @shivabansfore7510 3 ปีที่แล้ว +4

    the approach for first program is very simple it is a greedy problem where you just need to catch the theif to your leftmost in range
    so that the distance between theif and police decreased and you can catch maximum thiefs.

    • @darshanmukadam
      @darshanmukadam 2 ปีที่แล้ว +1

      Or check left and right both?

  • @vivekkumar-ix8wc
    @vivekkumar-ix8wc 3 ปีที่แล้ว +2

    We can solve the first question using sliding window technique by take the window size = k and checking the ith and kth position for T and P. If ith and kth index is T and P, increment the count and move the window to right.

  • @rajatprakash7355
    @rajatprakash7355 3 ปีที่แล้ว

    After reading the question, I got an idea. We can keep track of leftmost theif we can catch using ith policeman using two pointers moving forward.

  • @AnkitKumarCoder
    @AnkitKumarCoder 3 ปีที่แล้ว

    I'm so amazed THank you so much

  • @code6233
    @code6233 3 ปีที่แล้ว

    thank you ma'am for this video.
    Please make more videos like this.

  • @ranvijaysinghchauhan5952
    @ranvijaysinghchauhan5952 3 ปีที่แล้ว

    It is very good. I learn a lot about do's and don't in interview. I am looking for more such mock interview. Thank u so much.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      Thanks Ranvijay. More coming up! 😊😇

  • @omkarkumbharkar906
    @omkarkumbharkar906 3 ปีที่แล้ว

    Thank you so much such a helpful vedio and inspiring
    Tysm kerti di👍🎉

  • @sushantsingh5689
    @sushantsingh5689 3 ปีที่แล้ว

    One genuine thing was..it was not scripted. Most of the times in such playlists interviewer already know the soln and act first 10-15 min and then come to brute with 100% confidence ..This one was completely done by him at instant ! Nice work guys .

  • @m.vineeth9724
    @m.vineeth9724 3 ปีที่แล้ว +1

    This was the best learning experience so far. Please make more such videos, it really makes me feel as if I am giving the real interview.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      For sure Vineeth. Glad you liked the video 😇

  • @pgigamingtelugu3505
    @pgigamingtelugu3505 8 หลายเดือนก่อน +1

    Used the concept of Stack to solve this. Like I used a police stack to store the indices of Police and another stack for theif. I used this because the condition states that each police can only catch one theif which indicates popping both the indices from each stack because they are of no use later. So the time complexity would be O(n) and Space complexity is O(n).

  • @tlasyashree7590
    @tlasyashree7590 2 ปีที่แล้ว

    In the second question given was we have to split into two numbers equal to their value but in the second example 7,17 why did he split 17 into 8,9 8 is not equal to 9 right why did he do that. Can someone answer?

  • @caimgeo5009
    @caimgeo5009 2 ปีที่แล้ว +1

    From my experience with micosoft. Don't think and find solutions yourself. Those interviewer wont accept your own solution. They want exactly what is on the internet. Spend time in look all the websites and Better memories them as they are in Internet. 90% percent you will succeed.

  • @mahaksaxena1401
    @mahaksaxena1401 3 ปีที่แล้ว +1

    This is very informative . I have been practising dsa from a long but yet not sure if i am ready for interviews or not. But this video really help to realize where i stand now. Thank you di ❤️

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      So glad it helped Mahak. Thank you 🙏❤️
      All the best for your interviews 😊😊

    • @y17t90
      @y17t90 3 ปีที่แล้ว

      so are you ready

  • @rohansingla3508
    @rohansingla3508 9 หลายเดือนก่อน

    2nd question would give TLE and SLE for priority_queue for large K, so binary search would always be preferred instead, wouldn't it?

  • @VikramSingh-mj2ug
    @VikramSingh-mj2ug 3 ปีที่แล้ว +1

    I feel the second question is solved wrongly. It will fail for a simple TC as arr = {2, 17} and k = 2.

  • @animeshkumarjha4069
    @animeshkumarjha4069 3 ปีที่แล้ว

    Mam please Do more mock videos like this . Thank you mam for making such videos.

  • @studyminutes_com
    @studyminutes_com ปีที่แล้ว

    Brute force will be O(n*k) for each policeman check from kth distance at left until there is thief.
    Optimal O(n) use queue for thieves.

  • @Marvelous_maverick
    @Marvelous_maverick 9 หลายเดือนก่อน

    For the first question how did he came up with depth first search algorithm im still learning so..😅

  • @shubhamsingh-gb5zh
    @shubhamsingh-gb5zh 3 ปีที่แล้ว

    It is really very helpful.
    Please keep making such type of videos keerti❤️

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      So glad toy liked it Shubham. More videos coming up 😇😇🙏

  • @vikashmishra5210
    @vikashmishra5210 ปีที่แล้ว +1

    0:06 now he got 200k+ subs..!! gone a long way

  • @suryanshsinghchauhan5750
    @suryanshsinghchauhan5750 ปีที่แล้ว

    An Optimized solution for the second question would be to use binary search.
    the range of possible answers would be [1 - max number in given array] .
    we can just apply the binary search on this range and for each mid which we encounter we will just check whether or not it is possible to get that mid as the max number. If it is possible to get the mid as max we will check in the left part of the array and store the mid as ans, and if it is not possible for us to get that mid as max in given array we will check in the right part. we will do it until low < high. If low >=high we will come out of the loop.
    I hope it does make sense 🙂🙂

  • @nikcsm
    @nikcsm 3 ปีที่แล้ว +1

    A very simple solution is For each policemen, tabulate every element at k distance from him thus their positions are already known as index_of_police + or - k . And then for each of them , try marking the left thief first and then if left DNE, then mark the right one. Once a T is marked, don't touch him again.

  • @tech_non_tech9803
    @tech_non_tech9803 3 ปีที่แล้ว

    maam can i use stack to solve this problem?(I am talking about first one question)

  • @siddharthkeshri5649
    @siddharthkeshri5649 3 ปีที่แล้ว +2

    The second was Based on Binary Search I guess It was like allocate Minimum no of Pages

  • @abhi4unme2002
    @abhi4unme2002 2 ปีที่แล้ว

    I was surprised when he told exponential complexity without thinking much about array iteration. Not expected such quick awnsers without thinking much. I think it can be max n*2k complexity in brute force.

  • @sarhadchoudhary848
    @sarhadchoudhary848 3 ปีที่แล้ว +2

    Can it be solved using a deque and two traversals -- once from L to R and another from R to L?

    • @mamtachahal1277
      @mamtachahal1277 2 ปีที่แล้ว +1

      Exactly, for left to right we will only consider the thief on the left of the police and for the right to left we will only consider the thief to the right of the police.

  • @Ji-yoon
    @Ji-yoon 3 ปีที่แล้ว +1

    Nice.....Do more videos of this kind.....

  • @chirag7694
    @chirag7694 3 ปีที่แล้ว

    very good content, i did solved first question but got stuck at 2nd, there are 3 years of my btech left so maybe i will improve.

  • @shubhamtiwari9611
    @shubhamtiwari9611 หลายเดือนก่อน

    Really Helpful!

  • @iseeflowers
    @iseeflowers 8 หลายเดือนก่อน

    Why can’t I turn on the subtitle cc for your video?

  • @shambus3477
    @shambus3477 3 ปีที่แล้ว +1

    🙏🙏please.reply sister🙏🙏
    Can we write on a paper while solving questions in interview s???

  • @ytfriends7448
    @ytfriends7448 11 วันที่ผ่านมา

    for the first question i think two pointer approach would work pushing all index of thiefs in a vector and separate vector for police then try to give a thief who is as left as possible and if you cant then go for next atmost k difference of distance from the current police is that it works or not mam

  • @ABHAY-hu9kw
    @ABHAY-hu9kw 3 ปีที่แล้ว +1

    subscribed :)
    thanks for making this type of video.
    came from nishant bhaiya's channel.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      Welcome to the channel. Hope you like rest of the videos as well. I will keep creating 🙏😇

    • @ABHAY-hu9kw
      @ABHAY-hu9kw 3 ปีที่แล้ว

      @@KeertiPurswani yaa i had watched rest of the videos on your channel 😇

  • @5590priyank
    @5590priyank 3 ปีที่แล้ว +3

    His approach won't wok for [7,17], K = 2 as per his ans, we will do [7,7,10] then [7,7,7,3] and it ends. But we can get [7, 6,6,5] then [3,4,6,6,5] and we will have 6 as ans

    • @Shivamkumar-xu6hu
      @Shivamkumar-xu6hu 3 ปีที่แล้ว

      We can divide a number into 2 numbers ... You did [7,17] = [7,6,6,5]
      It will take 2 steps to do that.

  • @soumyadiptabanerjee8256
    @soumyadiptabanerjee8256 3 ปีที่แล้ว +7

    The second answer would fail for 18,17 and k=2.

    • @namantewari7586
      @namantewari7586 3 ปีที่แล้ว +1

      yes. even with 7, 17 and k=1

    • @tarunbisht8016
      @tarunbisht8016 3 ปีที่แล้ว

      @@namantewari7586 yeah dude i was thinking same that will work only if k is greater than 2 ig

  • @kartikeyshrivastava5178
    @kartikeyshrivastava5178 2 ปีที่แล้ว

    Would love to be part of such mock interview as well

  • @SoloScholar0202
    @SoloScholar0202 2 ปีที่แล้ว +2

    Personally I feel that if the interviewer is explaining the question, he would sometimes hint the solution or maybe an approach to solve which can be a boon for the session. Corrections are always appreciated.

  • @ashutoshsingh5568
    @ashutoshsingh5568 3 ปีที่แล้ว +1

    Max thief count problem solution has been made a little complicated by Nishant as I solved it with simple nested for loops and one Boolean array which will set an index to true whenever a thief is caught and based upon that Boolean value of thief index I can move forward.
    Finally I can count the total true values and that is the total count of thieves caught.

  • @abhishekshrivastava9895
    @abhishekshrivastava9895 3 ปีที่แล้ว +5

    second question approach will fail for tc
    [ 8 , 12 ] and k = 2
    According to his approach answer will be [ 8 , 8 , 4] -> [ 4 , 4 , 8 , 4 ] so it is 8
    whereas answer will be 6
    [8 ,12] -> [ 8 , 6 , 6] -> [4,4,6,6]

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 3 ปีที่แล้ว

    Nice Keerti maam you are doing awesome job your every video is helpful and always gathered something new, waise maam intuit off-campus Fresher ko hire karti h kya if (yes) -> then when?? Just a little doubt if any fresher wants to join intuit then how to apply for that?🤔🤔

  • @AshutoshPandey-se8vt
    @AshutoshPandey-se8vt 3 ปีที่แล้ว

    amazing work, thanks a lot

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      Thanks Ashutosh. Means so much! ❤️

  • @harwinderjit5903
    @harwinderjit5903 ปีที่แล้ว

    the best and worst time complexity of Nishant approach is O(2*n) as each index is covered 2 times(One when creating Thief and Police array and then iterating over them)
    I have coded this problem with queue and its worst time complexity is 0(2*n) as each index is covered atmost 2 times.

  • @hsekar6701
    @hsekar6701 2 ปีที่แล้ว

    Can you help me to find the best programming language for DSA?

  • @rajpriyam3065
    @rajpriyam3065 ปีที่แล้ว

    In first question, bhai kahaan chale gye the recursion dp pe. My approach was first to try simple greedy solution. And I came up in 10 mins only. Personally, I prefer if greedy is not working, then only move to trying all possible combinations.

  • @vaibhavgupta973
    @vaibhavgupta973 3 ปีที่แล้ว +2

    i am your new subscriber .
    it would be helpful if could upload more Mock coding interviews.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +1

      Welcome to my channel Vaibhav. Hope you like rest of the videos as well. More mock interviews coming up 😊😇