₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,381 members, 8,511,584 topics. Date: Monday, 02 November 2026 at 12:17 AM

Toggle theme

Deicide's Posts

Nairaland Forum › Deicide's Profile › Deicide's Posts

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 226 pages)

Computers › Re: Brand New Silver Color HP 15 With Touch Screen, 8gb And 1TB Hard drive Forsale by Deicide: 7:21pm On Feb 26, 2023
Core i3 for 350k? grin
TV/Movies › Re: When Last Did You Watch Super Story by Deicide(op): 8:31pm On Feb 23, 2023
.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 6:15pm On Feb 23, 2023
Harnny:
It's interview , simply create a variable to hold the size of your dictionary as you add. Also, in interview, you are allowed to explain the draw back of your implementations and what you will do in ideal situation.
I was given a prototype.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 5:23pm On Feb 23, 2023
ThrustReverser:
Op which language are you coding in? undecided
Because I'm sure that exercise would be a cakewalk if implemented in python.
Meanwhile your codes don override flexwrap for nairaland cheesy
I didn't use python cause I am not conversant with oop in python.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 5:21pm On Feb 23, 2023
MT:
I dont understand the language you are using but I am not bothered about that.

What you considered a better implementation was lacking interface. You are not building a loosely coupled application this way. Where is that contract in your implementation?
What do you mean.

They already gave me the structure of the code. All I just had to do was fill it up. So the functions they gave me I couldn't change it to add more parameters.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 5:16pm On Feb 23, 2023
Harnny:
I will still use my hashmap but use interger as the key... that value will be helpful when select a random
except the language support auto generated int for value this solution wouldn't work.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 5:06pm On Feb 23, 2023
li2pac1717:
I think you are overthinking it bro. I believe what the interviewer is testing here is how to deal with real life problem like this. HashMap would be fine. You can create a class Lottery and explain to them that a user have to have a unique ID. So store data of the class, such as id, name, and others. That way you can use random module to pick a random id number in the range of the id and get name from the hashmap of users using the randomly picked id. I think this will be enough.
I actually explained this to them.
Programming › Re: I Must Learn Spring Boot by Deicide(op): 9:39pm On Feb 22, 2023
Nastydroid:
drop your mail or dm let me forward the book
mrlectus@tutanota.com thank you.
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 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
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 1:41pm On Feb 22, 2023
robinhood171200:
whatsapp? twitter? anywhwere i could text you privately.
https://twitter.com/MrLectus?s=09
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 7:02pm On Feb 21, 2023
Temmylee01:
What language is this
The almighty Rust
Programming › Re: I Just Bombed A Technical Interview by Deicide(op): 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
Programming › I Just Bombed A Technical Interview by Deicide(op): 2:59pm On Feb 21, 2023
grin 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 grin 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 embarassed

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 grin

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 ? cry
}

fn remove_user(&mut self, string: user){
//no key can't remove anything tongue
}

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 grin
}
}



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.
Programming › Re: Your Advise For This Two Laptops? by Deicide: 10:02pm On Feb 20, 2023
If it's me I'll go for the Dell and since am biased I would knack Linux Inside grin
Romance › Re: I Am Confused In Choosing A Wife Partner by Deicide: 9:58pm On Feb 20, 2023
Men in the North don't even earn up to 600k per month and they have more than 3 wives and here you are struggling to choose one.
Programming › Re: My Journey As A Software Developer. Learning REACT by Deicide: 6:32pm On Feb 19, 2023
If you know react you already know like 70% nextjs
Business › Re: How To Deposit Old 500 and 1,000 Naira Notes Into Your Bank by Deicide: 4:43pm On Feb 17, 2023
That their useless website
Celebrities › Re: Tiwa Savage Shows Off Flowers Omah Lay Gifted Her On Valentine's Day (Photos) by Deicide: 1:55pm On Feb 17, 2023
Tiwa is still HOT so he should enjoy
Programming › Re: I'm Having Trouble Setting Up Opengl On Vscode by Deicide: 9:58pm On Feb 15, 2023
All Laptops comes with a graphic card or else it wouldn't display anything.
Phones › Re: Is MTN Network Down In Your Location? by Deicide: 7:35pm On Feb 14, 2023
It's very fast now, what did they do?
Programming › Re: Algorithm And Data Structure Study Section by Deicide: 11:39am On Feb 14, 2023
Phamo0:
Can't I just manually put it at the end of the script so that it will allow others to run without going through the hassle of making it asynchronous, since the whole purpose of making it asynchronous is to defer it to the end of the script?
Yes you can call it last.
Programming › Re: I Must Learn Spring Boot by Deicide(op): 2:24pm On Feb 13, 2023
qtguru:
See it's easier than Laravel as far as I am concerned. Plain Old Java and nothing else
Haha laravel, I don't know if I'll ever touch that grin
Programming › Re: I Must Learn Spring Boot by Deicide(op): 11:54am On Feb 13, 2023
So far so good, Spring is not as difficult as I thought. Infact I m wondering why people don't use it much as compared to Nodejs. It's way more performant and scales way more Better!
Jobs/Vacancies › Re: NPC Launches E-recruitment Portal For 2023 Census by Deicide: 6:04pm On Feb 09, 2023
ogashman:
Lol....u just dey after the money when work never start
You don't know what you taking about.
Jobs/Vacancies › Re: NPC Launches E-recruitment Portal For 2023 Census by Deicide: 10:24am On Feb 09, 2023
Dgener:
U will at least work before u get paid
What of for the training?
Jobs/Vacancies › Re: NPC Launches E-recruitment Portal For 2023 Census by Deicide: 5:32am On Feb 09, 2023
Have they paid anyone yet?
Music/Radio › Re: Five Times Tems Made History In Music Industry by Deicide: 1:05pm On Feb 06, 2023
I have been enjoying Arya Starr lately
Celebrities › Re: Tems Having A Moment With Mary J Blige, DJ Khaled And Rick Ross After Grammy Win by Deicide: 10:34am On Feb 06, 2023
1Alex:
The girl is talented. But in my opinion, her voice is not too wonderful. Ayra star sings better.
Yeah I know right? So how come she's wining all the awards?
Programming › Re: Python Secret Messages - Caesar's Cipher by Deicide: 11:16pm On Feb 05, 2023
x + 3 % 26
Programming › Re: What Are The Best Countries To Apply For Remote Jobs As A Nigerian? by Deicide: 11:08pm On Feb 05, 2023
airsaylongcome:
Na why I no dey reason japa laidis so. The only real draw back for me is the work hours. 5pm to 2am in my case
Ah Ah this is not bad Na. I love this
Programming › Re: RIP CSS and Bootstrap. Tailwind Is The Real Deal. by Deicide: 11:03pm On Feb 05, 2023
SUPREMOTM:
You need to calm down. CSS didn't make your life difficult, you just aren't giving yourself enough time to learn; it's always difficult before it's easy.

Ultimately, your productivity with the framework will still be limited by the depth of your knowledge of pure CSS.

While you make use of the framework, keep learning your CSS on the side.
I didn't see anywhere he said he doesn't know css
Programming › Re: RIP CSS and Bootstrap. Tailwind Is The Real Deal. by Deicide: 11:01pm On Feb 05, 2023
I have even forgotten how to write plain CSS grin

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 226 pages)