I Just Bombed A Technical Interview by Deicide: 2:59pm On Feb 21, 2023 |
Too much pressure that i couldn't even think straight. The question is not even that hard simple data structure question that i can't even believe i bombed it. Chai. I was asked to implement a Lottery system. that has the following functionality. 1. add_user(string: user) 2. remove_user(string: user) 3. pick_random_winner() -> string
Yes that was how easy it was but i bombed. Immediately i saw add and remove my mind immediately went to the king of all data structure HashMap but boy i was wrong a vector would do just fine, the problem here is the functionality to pick_random_user and the function signature. how do you do that with a HashMap if data are stored anywhere in memory? meanwhile in Array everything stored contiguously. But i was busy thinking of speed In as much as hash map would be good for add and removal in 0(1) time. it's bad for random access. could use HashSet but random would still Bleep you up. My bad implementation. struct Lottery { map: HashMap<i32, String>, }
impl Lottery { // first problem realized here, what would be the key? and i don already talk say na hash map go good for this things o chai
fn add_user(&mut self, string: user){ // But this would not work it doesn't work that way. it would have made sense if the function has a signature for key. self.map.insert(user); error, where is the key ? }
fn remove_user(&mut self, string: user){ //no key can't remove anything }
fn pick_random_user(&self){ // impossible!!! no key no random - even if there was a key it doesn't reorder it self unlike Vector. This might be possible in language like python } }
Now for a better implementation, that only came to my head as i was not overthinking immediately after the interview. struct Lottery { user: Vec<String>, }
impl Lottery { fn add_user(&mut self, string: user){ // we just insert self.user.push(user); }
fn remove_user(&mut self, string: user){ // linear search and then remove if self.participant.contains(&participant) { self.participant.retain(|x| x != &participant); } }
fn pick_random_user(&self){ let random_gen = // algorithm that generate random number let random = random_gen % self.user.len(); self.user[random] } }
Anyways we move!!. Best advice? CALM DOWN! Technical interview are fun but trust 9ja network to Bleep you up. 39 Likes |
Re: I Just Bombed A Technical Interview by satandeterrible: 4:40pm On Feb 21, 2023 |
Shame on you. |
Re: I Just Bombed A Technical Interview by robinhood171200: 6:36pm On Feb 21, 2023 |
better luck next time bro. another opportunity will surely come. can i dm you privately or send you an email? i'd like to ask for your opinion/advice on some tech related issues. Deicide: Too much pressure that i couldn't even think straight. The question is not even that hard simple data structure question that i can't even believe i bombed it. Chai.
I was asked to implement a Lottery system. that has the following functionality.
1. add_user(string: user) 2. remove_user(string: user) 3. pick_random_winner() -> string
Yes that was how easy it was but i bombed. Immediately i saw add and remove my mind immediately went to the king of all data structure HashMap but boy i was wrong a vector would do just fine, the problem here is the functionality to pick_random_user and the function signature. how do you do that with a HashMap if data are stored anywhere in memory? meanwhile in Array everything stored contiguously. But i was busy thinking of speed
In as much as hash map would be good for add and removal in 0(1) time. it's bad for random access.
could use HashSet but random would still Bleep you up.
My bad implementation.
struct Lottery { map: HashMap<i32, String>, }
impl Lottery { // first problem realized here, what would be the key? and i don already talk say na hash map go good for this things o chai
fn add_user(&mut self, string: user){ // But this would not work it doesn't work that way. it would have made sense if the function has a signature for key. self.map.insert(user); error, where is the key ? }
fn remove_user(&mut self, string: user){ //no key can't remove anything }
fn pick_random_user(&self){ // impossible!!! no key no random - even if there was a key it doesn't reorder it self unlike Vector. This might be possible in language like python } }
Now for a better implementation, that only came to my head as i was not overthinking immediately after the interview.
struct Lottery { user: Vec<String>, }
impl Lottery { fn add_user(&mut self, string: user){ // we just insert self.user.push(user); }
fn remove_user(&mut self, string: user){ // linear search and then remove if self.participant.contains(&participant) { self.participant.retain(|x| x != &participant); } }
fn pick_random_user(&self){ let random_gen = // algorithm that generate random number let random = random_gen % self.user.len(); self.user[random] } }
Anyways we move!!. Best advice? CALM DOWN! Technical interview are fun but trust 9ja network to Bleep you up. 2 Likes |
Re: I Just Bombed A Technical Interview by Temmylee01(m): 6:39pm On Feb 21, 2023 |
Deicide: Too much pressure that i couldn't even think straight. The question is not even that hard simple data structure question that i can't even believe i bombed it. Chai.
I was asked to implement a Lottery system. that has the following functionality.
1. add_user(string: user) 2. remove_user(string: user) 3. pick_random_winner() -> string
Yes that was how easy it was but i bombed. Immediately i saw add and remove my mind immediately went to the king of all data structure HashMap but boy i was wrong a vector would do just fine, the problem here is the functionality to pick_random_user and the function signature. how do you do that with a HashMap if data are stored anywhere in memory? meanwhile in Array everything stored contiguously. But i was busy thinking of speed
In as much as hash map would be good for add and removal in 0(1) time. it's bad for random access.
could use HashSet but random would still Bleep you up.
My bad implementation.
struct Lottery { map: HashMap<i32, String>, }
impl Lottery { // first problem realized here, what would be the key? and i don already talk say na hash map go good for this things o chai
fn add_user(&mut self, string: user){ // But this would not work it doesn't work that way. it would have made sense if the function has a signature for key. self.map.insert(user); error, where is the key ? }
fn remove_user(&mut self, string: user){ //no key can't remove anything }
fn pick_random_user(&self){ // impossible!!! no key no random - even if there was a key it doesn't reorder it self unlike Vector. This might be possible in language like python } }
Now for a better implementation, that only came to my head as i was not overthinking immediately after the interview.
struct Lottery { user: Vec<String>, }
impl Lottery { fn add_user(&mut self, string: user){ // we just insert self.user.push(user); }
fn remove_user(&mut self, string: user){ // linear search and then remove if self.participant.contains(&participant) { self.participant.retain(|x| x != &participant); } }
fn pick_random_user(&self){ let random_gen = // algorithm that generate random number let random = random_gen % self.user.len(); self.user[random] } }
Anyways we move!!. Best advice? CALM DOWN! Technical interview are fun but trust 9ja network to Bleep you up. What language is this 17 Likes |
Re: I Just Bombed A Technical Interview by Deicide: 7:01pm On Feb 21, 2023 |
robinhood171200: better luck next time bro. another opportunity will surely come. can i dm you privately or send you an email? i'd like to ask for your opinion/advice on some tech related issues. My Email on this account, I don't even know the password |
Re: I Just Bombed A Technical Interview by Deicide: 7:02pm On Feb 21, 2023 |
12 Likes 1 Share |
Re: I Just Bombed A Technical Interview by stanliwise(m): 8:28am On Feb 22, 2023 |
like you say a vector an array is just fine. I think you're overthinking data structure |
Re: I Just Bombed A Technical Interview by LikeAking: 8:48am On Feb 22, 2023 |
Deicide: Too much pressure that i couldn't even think straight. The question is not even that hard simple data structure question that i can't even believe i bombed it. Chai.
I was asked to implement a Lottery system. that has the following functionality.
1. add_user(string: user) 2. remove_user(string: user) 3. pick_random_winner() -> string
Yes that was how easy it was but i bombed. Immediately i saw add and remove my mind immediately went to the king of all data structure HashMap but boy i was wrong a vector would do just fine, the problem here is the functionality to pick_random_user and the function signature. how do you do that with a HashMap if data are stored anywhere in memory? meanwhile in Array everything stored contiguously. But i was busy thinking of speed
In as much as hash map would be good for add and removal in 0(1) time. it's bad for random access.
could use HashSet but random would still Bleep you up.
My bad implementation.
struct Lottery { map: HashMap<i32, String>, }
impl Lottery { // first problem realized here, what would be the key? and i don already talk say na hash map go good for this things o chai
fn add_user(&mut self, string: user){ // But this would not work it doesn't work that way. it would have made sense if the function has a signature for key. self.map.insert(user); error, where is the key ? }
fn remove_user(&mut self, string: user){ //no key can't remove anything }
fn pick_random_user(&self){ // impossible!!! no key no random - even if there was a key it doesn't reorder it self unlike Vector. This might be possible in language like python } }
Now for a better implementation, that only came to my head as i was not overthinking immediately after the interview.
struct Lottery { user: Vec<String>, }
impl Lottery { fn add_user(&mut self, string: user){ // we just insert self.user.push(user); }
fn remove_user(&mut self, string: user){ // linear search and then remove if self.participant.contains(&participant) { self.participant.retain(|x| x != &participant); } }
fn pick_random_user(&self){ let random_gen = // algorithm that generate random number let random = random_gen % self.user.len(); self.user[random] } }
Anyways we move!!. Best advice? CALM DOWN! Technical interview are fun but trust 9ja network to Bleep you up. This is how an tech interview shud be. U go get it write next time. E go beta. 2 Likes |
Re: I Just Bombed A Technical Interview by richebony: 9:52am On Feb 22, 2023 |
Deicide: The almighty Rust Hope u don't mind my asking, but how many programming languages do u actually know.,because I have seen u write in several languages 2 Likes |
Re: I Just Bombed A Technical Interview by OdogwuMoney6: 10:07am On Feb 22, 2023 |
I pray you continue bombing all your interviews like this in Jesus name, amen.. 2 Likes 1 Share |
Re: I Just Bombed A Technical Interview by robinhood171200: 10:29am On Feb 22, 2023 |
Deicide: My Email on this account, I don't even know the password whatsapp? twitter? anywhwere i could text you privately. |
Re: I Just Bombed A Technical Interview by Deicide: 1:41pm On Feb 22, 2023 |
|
Re: I Just Bombed A Technical Interview by Deicide: 1:43pm On Feb 22, 2023 |
richebony:
Hope u don't mind my asking, but how many programming languages do u actually know.,because I have seen u write in several languages You sure say Na me |
|
Re: I Just Bombed A Technical Interview by Akonimohate12: 2:49pm On Feb 23, 2023 |
4 Likes |
|
Re: I Just Bombed A Technical Interview by Mide337: 2:49pm On Feb 23, 2023 |
Hmm |
Re: I Just Bombed A Technical Interview by SenatePresdo(m): 2:49pm On Feb 23, 2023 |
|
|
Re: I Just Bombed A Technical Interview by Mrregistration: 2:50pm On Feb 23, 2023 |
I greet you in the name of CAC work |
Re: I Just Bombed A Technical Interview by Peterobi90: 2:50pm On Feb 23, 2023 |
🤦♂️🤦♂️ 1 Like |
Re: I Just Bombed A Technical Interview by Ishilove: 2:50pm On Feb 23, 2023 |
Deicide: Too much pressure that i couldn't even think straight. The question is not even that hard simple data structure question that i can't even believe i bombed it. Chai.
I was asked to implement a Lottery system. that has the following functionality.
1. add_user(string: user) 2. remove_user(string: user) 3. pick_random_winner() -> string
Yes that was how easy it was but i bombed. Immediately i saw add and remove my mind immediately went to the king of all data structure HashMap but boy i was wrong a vector would do just fine, the problem here is the functionality to pick_random_user and the function signature. how do you do that with a HashMap if data are stored anywhere in memory? meanwhile in Array everything stored contiguously. But i was busy thinking of speed
In as much as hash map would be good for add and removal in 0(1) time. it's bad for random access.
could use HashSet but random would still Bleep you up.
My bad implementation.
struct Lottery { map: HashMap<i32, String>, }
impl Lottery { // first problem realized here, what would be the key? and i don already talk say na hash map go good for this things o chai
fn add_user(&mut self, string: user){ // But this would not work it doesn't work that way. it would have made sense if the function has a signature for key. self.map.insert(user); error, where is the key ? }
fn remove_user(&mut self, string: user){ //no key can't remove anything }
fn pick_random_user(&self){ // impossible!!! no key no random - even if there was a key it doesn't reorder it self unlike Vector. This might be possible in language like python } }
Now for a better implementation, that only came to my head as i was not overthinking immediately after the interview.
struct Lottery { user: Vec<String>, }
impl Lottery { fn add_user(&mut self, string: user){ // we just insert self.user.push(user); }
fn remove_user(&mut self, string: user){ // linear search and then remove if self.participant.contains(&participant) { self.participant.retain(|x| x != &participant); } }
fn pick_random_user(&self){ let random_gen = // algorithm that generate random number let random = random_gen % self.user.len(); self.user[random] } }
Kuku kee person. Mscheeeeeew 1 Like 1 Share |
Re: I Just Bombed A Technical Interview by Ishilove: 2:51pm On Feb 23, 2023 |
1 Like |
Re: I Just Bombed A Technical Interview by Offpoint1: 2:51pm On Feb 23, 2023 |
|
Re: I Just Bombed A Technical Interview by Newbietroll: 2:51pm On Feb 23, 2023 |
Better luck next time bro. Nigeria happens to all of us at one point or the other. 1 Like |
Re: I Just Bombed A Technical Interview by 9jatriot(m): 2:51pm On Feb 23, 2023 |
Send them an email with your new solution, you never can tell.
Just tell them that you came up with a much simpler solution after you got off the interview. Nothing to lose here
If they do not have anyone better than you within that interview itself, rather than conduct a new one, they may call you again 44 Likes 1 Share |
Re: I Just Bombed A Technical Interview by thaoriginator: 2:52pm On Feb 23, 2023 |
Whot sort of raaaabisssshhhhh is this? |
Re: I Just Bombed A Technical Interview by Wealthoptulent(m): 2:52pm On Feb 23, 2023 |
Ur use of English sef! The BOMB |
Re: I Just Bombed A Technical Interview by solamakinde1: 2:53pm On Feb 23, 2023 |
My heart beats faster when I hear anything DSA |
Re: I Just Bombed A Technical Interview by sofeo(m): 2:56pm On Feb 23, 2023 |
Alright
Check my Signature |
Re: I Just Bombed A Technical Interview by Ulunne777(f): 2:59pm On Feb 23, 2023 |
Let us pretend we understand. Goodluck 14 Likes |
Re: I Just Bombed A Technical Interview by DasBeste: 2:59pm On Feb 23, 2023 |
|