Thanks for having me on the channel! Advice to viewers: Use this video to understand how to express your ideas, how to clarify the corner cases and confusions, how to communicate with the interviewer etc. It doesn't matter even if you say something wrong or get stuck for a bit, as long as your explanation and thought process is crystal clear. Best of luck guys!
@utkarsh what should be the rating of this problem on Codeforces? Also thanks alot for refreshing my Bitmask DP concepts :p. Thanks for putting out really valuable resource!!!
I am watching this video from 1 hour , I really loved it , ek ghanta kab nikal gaye pta hi nhi chala , Thanks Keerti & Utkarsh , It's really nice to watch him doing complex stuff in a simpler way .
🙂utkarsh didn't solve this hard question within an hour , as he told it took him 3 years to reach this position where he can solve these kind of questions within an hour , this was really inspiring , thanks for the amazing content 😃
Haha correct. But I would like to point out that I'd have done it in 10~15 minutes if I didn't have to explain it and write the code on google doc which doesn't even have indentation 😂
You are very humble and polite.Watching your videos helps me to be positive and believe in myself and to continue strengthen my coding skills.Keep making videos,we love it.
Mazak mazak mei hi nahi bana jata India ka top coder, there are hell lot of frustrating moments behind the scenes ! Kudos to Utkarsh 🥂🥂 And keep coming with more such mock interviews 🔥
wtf man !! this video i mean watching this interview its like depression(not like in bad way its like motivation now have to do more ) man like so much talent and so much to learn ...thnks to both n i think i have to study more ...
Please make hard mock interviews more...because people like me couldn't understand the solutions of hard problem even by reading, and this guy really made me understand a hard problem....
This problem is a classic problem of dp with bitmasking similar to assignment problem or travelling salesman. This guy's a red coder, so he obviously would have gotten it at the very site of it, but the way he explained and solved it made all of us and also the interviewer believe that he arrived to the solution at that very moment. Kudos to that. 🎉
The question may be hard, but it's also a very standard bitmasking question. If someone has ever practised bitmasking, they are very likely to have solved this before. Would've been cool to see how Utkarsh handles not only a hard question, but a question he hasn't seen before, in an interview.
true..and hearing them talk about its difficulty in the end has shot my confidence to the roof..until tomorrow when a leetcode medium will humble me back
Thanks for making this type of videos on youtube and that's why we can know how ask problem in coding like stuff....... It's helping us a lot... Thanks you so much ❤️❤️
Great video and nice explanation but I would classify this problem as a Medium-Hard level instead of Hard level for competitive programming. But yes, for interview purpose this is considered hard.
Correct me if I misunderstood the question. Total number of unique caps are 100. Each person having a collection of these 100 caps. Total number of arrangement will be 100*99*98*97*....*(100-n).
The number are not flexible they are fix in this setting create objects like selection(string p, int i) string person[p] int cap [i] raw_input(p) i = 100 and then populate both arrays through loop then assign with random and match function to if matches random loops again till all 10 person are assigned a cap finishes the loop, then displays the result of assigned cap along with persons name with print()
3 years into devlopment I hate those time complexity questions My point is u have alorithms in Internet Then y u need to spend time in learning them Learning framework Web frameworks or mobile development Devops Really I don't understand why PPL go after time complexity and algorithms Bt u guys are really great, doing things that I can't imagine to do. After watching this video I'm scared to hit that subscribe. Bt I wanna follow u U gave me inspiration today to lean towards DS and algorithms
But frameworks can only do the frontend thing who will optimize the computations in the backend. Algorithms can be found on the internet but first you have to know where to use which combination of algorithms that can optimize the computations needed.
Please also bring jeel vaishnav on your channel. He has qualified google hash code world finals and currently a USC student and a codeforces grandmaster
I was just thinking that its not possible to store information for 100 caps, and that very moment he reversed the question and I understood what he is up to.
I just wanted to know if my approach would also work for this problem. I will count total number of arrangement which will be the product of number of caps owned by each people and then subtract duplicates from the total. The main challenge here is to count total duplicates. For each cap id (1 to 100) I would go through each people and find how many duplicates are there and knowing cap counts for every other people, I would know how many duplicates can be formed.
Where can I get this question to practice? Please provide some link to leetcode, gfg, interviewbit or codeforces or others (for practice and trying out different approaches).
i am in class 11 and a chapter named permutation and combination can solve this question n people with 100 caps of 1st person has 100 option to wear the 2nd would have 100-1 option of to wear unique caps then n th person will have 90 option if n=10 other wise 10 cases will be formed ranging n form 1 to 10 with n=1 person having 100 options
if all person have each (1 to 100) caps in their collection then why my answer is not 100* 99* 98*.........upto*(100-n+1). because select n caps out of 100 (100 c N) ways and arrange these caps for all n person( n!). so final answer is (100 c N)*n! which is {100* 99* 98*.........upto*(100-n+1)}.
I am on a bench in a company for almost 1.5 years. So zero real experience. I tried doing some small MERN projects but those projects are very easy. But these small projects are the only things which I am able to put in my resume. So how can I handle my experience situation with the interviewer?? Should I be honest or should I try to talk my way out of it. It would really help if I can get your opinion on this. Thanks and sorry because I might copy this comment in your other videos comments so that you can notice this sooner :'(
Problem very similar to travelling salesman problem and he is grandmaster it would be kpop for him 😂 but the way he came up with soln and just code it with no problems .. i mean thats incredible
Hi kreeti Didi , I am a software developer in Cognizant and preparing for Fang Company. I am passionate about teaching DSA and Algorithms and web development. Can you give me change to teach on your tube channel, So that It will become bigger Community.
Can someone explain to me why this isnt just combinatorics? For example 10 people 20 hats the first person has 20 options the second person has 19 choices the 3rd has 18 so 20×19×18×17...
Codechef pe same problem "Little Elephant and Tshirts" ke naam se hai , wo maine nhi kiya hota to ,It would have been very difficult for me to comprehend this question.
@@KeertiPurswani not everything as such but i saw many interviews where the interviewers ask again and again if we are missing on anything in question and clear that out. As i appeared all faang interviews. We should also ask everything before starting any solution. but in case we miss. But yes i someone is highest rated in codeforces then probably not
Question is vauge. I don't undestand why is this considered question hard. This is a simple combinatorics question. No wonder we will get bad lot of programmes in future. I can't expect an int to float evil bit hack followed by newton rahpson iterations to get inverse square root quickly from someone who calls this problem hard. You could have at least added a constrain where ith person is not wearing ith cap to make it a little more interesting. Please change thet title of the video, don't lower the bar by calling it hard.
I havent went thru all comments...but its a very basic question of permutation and combination. its like how many ways can you choose n =10 numbers out of 100 without repitition ? I wonder why ppl do lack this mathematical mind.
Madam i am in third year i am inteovert and i am getting too much presuure which i am not able to handle now getting panick attacks i am suffering a lot didi any suggestion please
Hi Nikhil , the videos on my channel for majorly for interview prep. 1. CP experts might be able to do quest but the video also shows how to express yourself in interview, his structured approach and a few pointers from my end as well. 2. There are many who aren’t CP experts and prepare for interviews. For people like us, this is definitely hard level. Copied the LinedIn reply since you copied half comment🤷🏻♀️
@@KeertiPurswani no need to get offended though on LinkedIn comment, sharing approach isn't bad when someone can get hint from it instead of watching 1hr video to get the crux. Nevermind :)
The simple way to look at this problem is selection of n different caps out of 100 caps. The solution is 100*99*...(100 - (n-1)). Think in permutations & combinations, like nCr
No no, go through our discussion in the end. Most of the companies won’t ask question of this difficulty level but it’s a great learning. The way he has handled everything is just amazing!!
Thanks for having me on the channel!
Advice to viewers: Use this video to understand how to express your ideas, how to clarify the corner cases and confusions, how to communicate with the interviewer etc.
It doesn't matter even if you say something wrong or get stuck for a bit, as long as your explanation and thought process is crystal clear.
Best of luck guys!
I am sure your advice and this video will help many ❤️❤️
@utkarsh what should be the rating of this problem on Codeforces?
Also thanks alot for refreshing my Bitmask DP concepts :p.
Thanks for putting out really valuable resource!!!
@@anktrj around 1900 i think maybe 2000, idk
@@utkarshgupta9858 got my answer, thanks
Orz
Most important part , make the interviewer believe you have not solved this question before, even if you ate up half the codeforces and leetcode.
😂
Haha 😂😂
jor jor se bolke scheme btade 😂
Lmfao "ate up" 🤣
😂😂
I am watching this video from 1 hour , I really loved it , ek ghanta kab nikal gaye pta hi nhi chala , Thanks Keerti & Utkarsh , It's really nice to watch him doing complex stuff in a simpler way .
Hope you like other videos as well Madhur. Thank you! Means a lot 😇😇
🙂utkarsh didn't solve this hard question within an hour , as he told it took him 3 years to reach this position where he can solve these kind of questions within an hour , this was really inspiring , thanks for the amazing content 😃
Haha correct. But I would like to point out that I'd have done it in 10~15 minutes if I didn't have to explain it and write the code on google doc which doesn't even have indentation 😂
@@utkarshgupta9858 For ur level this question is easy-medium categories. Btw big fan of ur problem solving skills
@@utkarshgupta9858 helooooooooooo
@@rishabhchoubey3569For him it's easy an Expert in Code forces can also solve this i think
Look at him, so inspirational. Really impressed how you thought of the solution with continuous talking.
You are very humble and polite.Watching your videos helps me to be positive and believe in myself and to continue strengthen my coding skills.Keep making videos,we love it.
Thank you so much Prathamesh. Means a lot to me❤️❤️😇🤦🏻♀️
Mazak mazak mei hi nahi bana jata India ka top coder, there are hell lot of frustrating moments behind the scenes !
Kudos to Utkarsh 🥂🥂
And keep coming with more such mock interviews 🔥
sach pravachan !
True Rohit! There’s a long journey behind this one Interview ❤️
wtf man !! this video i mean watching this interview its like depression(not like in bad way its like motivation now have to do more ) man like so much talent and so much to learn ...thnks to both n i think i have to study more ...
We always have to study more😅😅 But hoping the video is a good motivation ❤️
Really amazing!
Didn't understood anything but liked the way he explained.
🤣same here
Same 💀😂
Same 😂😂😂😂
Understand*
Please make hard mock interviews more...because people like me couldn't understand the solutions of hard problem even by reading, and this guy really made me understand a hard problem....
Dude is so comfortable doing this. I would start to shiver at the sight of such a problem.
Awesome work Utkarsh
I would also be extremely scared 😂
@@KeertiPurswani helooo
Gghjkk
This problem is a classic problem of dp with bitmasking similar to assignment problem or travelling salesman. This guy's a red coder, so he obviously would have gotten it at the very site of it, but the way he explained and solved it made all of us and also the interviewer believe that he arrived to the solution at that very moment. Kudos to that. 🎉
Red coder in red hood in the house🥳 Amazing mock interview!!
Proud that utkarsh bhaiya is from my college. Me along with many others at iit bhu, are heavily inspired by him ❤❤
Thanks @Keerthi for conducting this mock tests it cleared many doubts for me☺️
So happy to know. Hope you like other videos and interviews as well ❤️😇
Best I could come up with is the brute force solution... The part where he reversed and derived the DP solution is absolute genius.
We learn with time and practise 💪💪
Lol it was like a Uno reversal card
41:58 utkarsh be like, let's just test sample case and submit it. Dry run? feels weird 😂😂
Please provide 4-5good resume templates for freshers to apply at tech giant's.its need of so many people
- Rahul Balani
He is a prodigy from my college !
Kudos man 🙌
hes an iitian lol
many thanks for having this great mock... this is helpful in guiding on how to proceed with such problems.
The question may be hard, but it's also a very standard bitmasking question. If someone has ever practised bitmasking, they are very likely to have solved this before.
Would've been cool to see how Utkarsh handles not only a hard question, but a question he hasn't seen before, in an interview.
true..and hearing them talk about its difficulty in the end has shot my confidence to the roof..until tomorrow when a leetcode medium will humble me back
Thanks for making this type of videos on youtube and that's why we can know how ask problem in coding like stuff.......
It's helping us a lot...
Thanks you so much ❤️❤️
orz sir 🤩🤩
i had a confusion.......instead of keeping a "possible" matrix can we not have the dp matrix all initialised with -1 ?!
Great video and nice explanation but I would classify this problem as a Medium-Hard level instead of Hard level for competitive programming. But yes, for interview purpose this is considered hard.
Correct me if I misunderstood the question. Total number of unique caps are 100. Each person having a collection of these 100 caps. Total number of arrangement will be
100*99*98*97*....*(100-n).
lol funniest thing I read today
The number are not flexible they are fix in this setting
create objects like
selection(string p, int i)
string person[p]
int cap [i]
raw_input(p)
i = 100
and then populate both arrays through loop
then assign with random and match function to if matches random loops again till all 10 person are assigned a cap finishes the loop, then displays the result of assigned cap along with persons name with print()
3 years into devlopment
I hate those time complexity questions
My point is u have alorithms in Internet
Then y u need to spend time in learning them
Learning framework
Web frameworks or mobile development
Devops
Really I don't understand why PPL go after time complexity and algorithms
Bt u guys are really great, doing things that I can't imagine to do.
After watching this video I'm scared to hit that subscribe.
Bt I wanna follow u
U gave me inspiration today to lean towards DS and algorithms
Frameworks may change day by day , bt problem solving will not be changed
But frameworks can only do the frontend thing who will optimize the computations in the backend. Algorithms can be found on the internet but first you have to know where to use which combination of algorithms that can optimize the computations needed.
Can you please upload what happened before this part of video, where he solved the questions very quickly.
Please also bring jeel vaishnav on your channel. He has qualified google hash code world finals and currently a USC student and a codeforces grandmaster
I was just thinking that its not possible to store information for 100 caps, and that very moment he reversed the question and I understood what he is up to.
I just wanted to know if my approach would also work for this problem. I will count total number of arrangement which will be the product of number of caps owned by each people and then subtract duplicates from the total. The main challenge here is to count total duplicates. For each cap id (1 to 100) I would go through each people and find how many duplicates are there and knowing cap counts for every other people, I would know how many duplicates can be formed.
Keep coming up with these , these mocks are so much helpful....
Also great job Utkarsh 👍❤️
i dont think so this is hard for utkarsh who do more harder problem than this on codeforces
Where can I get this question to practice? Please provide some link to leetcode, gfg, interviewbit or codeforces or others (for practice and trying out different approaches).
He was so blushing when keerti asked if he wants to say something about Interviewer....
i am in class 11 and a chapter named permutation and combination can solve this question
n people with 100 caps
of 1st person has 100 option to wear
the 2nd would have 100-1 option
of to wear unique caps then
n th person will have 90 option if n=10
other wise 10 cases will be formed
ranging n form 1 to 10
with n=1 person having 100 options
correct i agree.. ans should be 100*99*..91
if all person have each (1 to 100) caps in their collection then why my answer is not 100* 99* 98*.........upto*(100-n+1). because select n caps out of 100 (100 c N) ways and arrange these caps for all n person( n!). so final answer is (100 c N)*n! which is {100* 99* 98*.........upto*(100-n+1)}.
I am on a bench in a company for almost 1.5 years. So zero real experience. I tried doing some small MERN projects but those projects are very easy. But these small projects are the only things which I am able to put in my resume. So how can I handle my experience situation with the interviewer?? Should I be honest or should I try to talk my way out of it. It would really help if I can get your opinion on this. Thanks and sorry because I might copy this comment in your other videos comments so that you can notice this sooner :'(
Thank you so much. It blows up my mind
Can you do a mock interview with errictoh...it will be so exciting...
Problem very similar to travelling salesman problem and he is grandmaster it would be kpop for him 😂 but the way he came up with soln and just code it with no problems .. i mean thats incredible
During contest Utkarsh finishes this type of question in 5 to 10 minutes.
I think U should have given the Interview because he is a google level code + India's no.1, so obviously he will win
dude its just a mock interview...no one is trying to win anything here
Man!!! I just learn so many things from this single mock interview, I will definitely put this video in favorite list.
Hi kreeti Didi , I am a software developer in Cognizant and preparing for Fang Company. I am passionate about teaching DSA and Algorithms and web development. Can you give me change to teach on your tube channel, So that It will become bigger Community.
2^n = 1
This problem is easy for CPers but its is nice watching you are holding it even though you don’t know some CP tricks…
we also want a video on mock interview with striver 🔥
I could've written the recursive dp. Iterative dp formulation was very good.
Utkarsh be like .
What the hell , N is just only 10.
It's simple DP with bitmask
I guess permutations and combinations can help here ?
@2:58 n can not be > 100 if we use pigeon hole we can notice if n > 100 no such arrangement is possible.
how does n being equal to zero prove to be of any use?
Please do mock interview with striver from takeuforward youtube channel, and give him the hardest problem(Brahmastra) you have.
PIE also works right. I guess it's equivalent to the DP
Some mistake/typo
if(possible[100][(1
There is a easy way to it i suppose "n choose k" for the permutations .
Leetcode Q : Number of ways to wear different hats to each other
bro solved my doubt on bitmasks in the middle of an interview 💀
what is that doubt?
@@allaboinadivakar1976 I did not understand what the "mask" in bitmask was.
Mam can you please paste the question link as well. Will be very helpful
Can someone explain to me why this isnt just combinatorics? For example 10 people 20 hats the first person has 20 options the second person has 19 choices the 3rd has 18 so 20×19×18×17...
Is it valid to wear a cap in an interview?
Haha, he had asked me before interview if it’s fine. I was chill with it ✌️
Yes for red coder, red cap is fine😂😂
@@KeertiPurswani May be for cold environment.
@@AlokTripathi Ya
Codechef pe same problem "Little Elephant and Tshirts" ke naam se hai , wo maine nhi kiya hota to ,It would have been very difficult for me to comprehend this question.
The interviewer is so beautiful, I would have forget the code🤣🤣😍
the outro/music is too flashy & feels harsh, something soothing would be better I think 😅
the interviewer is kind of not involved in the process
@@avetiqasatryan1540 true
You all expect all interviewers to be involved?
@@KeertiPurswani not everything as such but i saw many interviews where the interviewers ask again and again if we are missing on anything in question and clear that out. As i appeared all faang interviews. We should also ask everything before starting any solution. but in case we miss.
But yes i someone is highest rated in codeforces then probably not
Im not able to focus because of you whole 1 hour im trying to concentrate but I didn’t control and just watched you for 1hr 😊❤
This is all because of tremendous practice only!!!!
Agreed!! 😇😇
Question is vauge. I don't undestand why is this considered question hard. This is a simple combinatorics question. No wonder we will get bad lot of programmes in future. I can't expect an int to float evil bit hack followed by newton rahpson iterations to get inverse square root quickly from someone who calls this problem hard. You could have at least added a constrain where ith person is not wearing ith cap to make it a little more interesting. Please change thet title of the video, don't lower the bar by calling it hard.
Ab aayega na majaaa
Ma'am
For any coding ninjas courses
Will there be life time access of all courses from coding ninjas
Like udemy?
No
he already spend 2min on reading the problem, so how they are solving whole the contests questions in 10min?
@Keerti I want babbar bhaiya mock interview whoever wants this please like this comment
That on video tips are just amazing 🔥🔥
Thanks ❤️❤️😇😇
100*99*98*97……(100-n+1)
Is this correct answer? Please reply
Sab coding hi kr rhe hain..iss hisab se future me bas software developers hi honge 😂😂
Keerti stack just overflowed 😳😳
Will come back here in future!
I havent went thru all comments...but its a very basic question of permutation and combination.
its like how many ways can you choose n =10 numbers out of 100 without repitition ?
I wonder why ppl do lack this mathematical mind.
Madam i am in third year i am inteovert and i am getting too much presuure which i am not able to handle now getting panick attacks i am suffering a lot didi any suggestion please
It wasn't that hard to crack. Even Expert rated coder can crack this standard problem. But yes for interviews it was indeed hard.
Hi Nikhil , the videos on my channel for majorly for interview prep.
1. CP experts might be able to do quest but the video also shows how to express yourself in interview, his structured approach and a few pointers from my end as well.
2. There are many who aren’t CP experts and prepare for interviews. For people like us, this is definitely hard level.
Copied the LinedIn reply since you copied half comment🤷🏻♀️
@@KeertiPurswani no need to get offended though on LinkedIn comment, sharing approach isn't bad when someone can get hint from it instead of watching 1hr video to get the crux.
Nevermind :)
@@NikhilKumar-of5gb hater energy 😄
I am trying to understand but not understood anything :(
Fact is he impressed the interviewr
utkarsh guptha = legand's swag.
From next time please include the sample input and output as a part of question.
It’s a mock interview and not all interviewers will give sample input and output. Trying to keep it as realistic as I can😅
@@KeertiPurswani ok thanks for the reply😬😁
coudnt the answer br 100Cn C--combinations
mujhe toh solution dekhke bhi samajh nai aaya :")
Why use Google docs?
Should have been coded in IDE with proper testcases
Real interviews happen on something like google docs not ide
@@hmmmm4193 No.. they don't
@@nachiketkanore it depends on company to company but many do it this way only. How are you saying that they don't happen this way?
it was really a hard problem , i got the approach but coding it is really really hard
Hi i am a new subscriber can u tell me what is the pathway for beginners who are in first year of engineering
when are you going to do interview with tourist😀
Jabardast, pata chal gya, India no. 1 kya hota hai.
Can anyone have one on one conversation with you.......i really am confused. Your time would mean a lot to me.
The simple way to look at this problem is selection of n different caps out of 100 caps. The solution is 100*99*...(100 - (n-1)). Think in permutations & combinations, like nCr
Mam mera interview kab loge?
no wonder why he cracked google and is the top coder in india
Can someone please tell me whether nCr~~~ (100Cn) where n= number of people will be the answer of first question or not?
Now i m in 12th so i have no idea about is it for practice???
Mathematics person POV: The answer is the permutation 100Pn.
Ohh.. so that means I can expect question on DP on bitmasks too in the interview :(
No no, go through our discussion in the end. Most of the companies won’t ask question of this difficulty level but it’s a great learning. The way he has handled everything is just amazing!!
He is a real sigma