Re:Stop Interviewing with Leet Code
by hereyougo on Thursday June 09, 2022 @04:12PM
(#31686167)
Here you go
Sample run
[ Parent
| on HN ]
I'm wondering why would the music player implement sampling with replacement and not without replacement? Sampling without replacement would shuffle the list and then play the tracks in shuffled order, no repeats until all songs are played once.
This is what I was thinking, as I was driving in, and heard the same song. It was an iPhone, and it was my impression that this is how the iPhone worked. Now, my iPhone did something else weird, it randomly dropped songs from being downloaded, so songs 'disappeared'.
One other thing, I just got a new car, and this was the first time I was using 'next' using bluetooth. So, as I was driving in, I was in my head trying to figure out whether the phone now only had 100 songs downloaded, or whether this bluetooth 'next' function on shuffle was picking a random song from the list, rather than 'next' on a shuffled list.
That would have been perfect. That's what I would have wanted checked in. I would have quickly turned to telling you how awesome the company was.
Re:Stop Interviewing with Leet Code
by fuzzythinker on Thursday June 09, 2022 @04:25PM
(#31686342)
Nice. I would add % of it played vs. median and how many std.deviations from it.