r/programming • • Mar 01 '17

Programmers are confessing their coding sins to protest a broken job interview process. “Whiteboard” interviews are widely hated. They also discriminate against people who are already underrepresented in the field.

https://theoutline.com/post/1166/programmers-are-confessing-their-coding-sins-to-protest-a-broken-job-interview-process
1.0k Upvotes

717 comments sorted by

View all comments

Show parent comments

3

u/quicknir Mar 02 '17

You put a constraint on the problem that was not actually there, and worded it incorrectly. When you say "this can be done with a LL", the implication is that this is the only data structure you need. Like "this can be assembled with a screwdriver" is not something that would be said if you also needed a buzz saw, drill, etc, in addition to a screwdriver. So I tried to figure out a way to do it with only a LL.

To be honest I still have no idea what you would use the linked list for; if you use a BST you do not need the LL for anything. It's hard trying to figure out someone else's convoluted inferior solution, without doubt.

If you are actually curious, when I was asked this problem, I came up with the two heap solution in around 5 minutes. It will probably be more comforting for you to not believe me though, so by all means.

1

u/AmalgamDragon Mar 02 '17

You put a constraint on the problem that was not actually there, and worded it incorrectly. When you say "this can be done with a LL", the implication is that this is the only data structure you need. Like "this can be assembled with a screwdriver" is not something that would be said if you also needed a buzz saw, drill, etc, in addition to a screwdriver.

Strawman. That isn't what I said.

I didn't say BST. I said binary tree (and some pointers for caching) beyond the linked list. I also didn't say what was in the binary tree or the pointers for caching. It's not the numerical values. Using just a BST won't get you O(1) for getting the min, max, median, and a fixed number of percentiles all at the same time.

It's hard trying to figure out someone else's convoluted inferior solution, without doubt.

Another strawman. The solution is superior in the real world in that it allows getting the min, max, median, and a fixed number of percentiles as O(1) while also maintaining the same O(lg n) for insertion and O(n) for memory usage.

It will probably be more comforting for you to not believe me though, so by all means.

Another strawman. You aren't threatening. Merely egotistical and hypocritical.