Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
My employer has never asked me to implement any search. The last time I rolled my own linked list was also 20 years ago. How are these things relevant to a job today? I get the algorithm part, but not some kind of rote exercise. I feel like I would completely under-prepared for an interview these days.
-
A binary search on a data structure that has O(n) access? Am I missing something?
I mean yeah with a skip list overlay in parallel, but then even insertion and deletion wouldn't be fast anymore so that the linked list would be pointless. -
@Fast-Nop
Exactly. I'd expect at least a red-black tree here.
Rocket scientist likely assumed that the linkedlist was sorted or started with a middle node or supported atIndex -
@SortOfTested Or something I actually had recently, with two lists where I needed to find all elements from list 1 that were not in list 2, both as arrays. Sort list 2 in O(n log n), and then for each element of list 1, a binary search in list 2, also O(n log n).
-
@Fast-Nop
I would definitely have ignored the question and said, "create a Set from the list L, map list R for LSet contains Ri, O(n+m)" >.<
Related Rants
-
CaptainRant6For myself, I choked on the following: - "Why do you want to work for us?" - "Why us, specifically?" - That s...
-
Karunamon19DO NOT LIE ON YOUR RESUMΓ! I don't understand why people do this. I understand that some shady recruiters li...
-
ZioCain5So I did make a few website, they kinda worked well, but they really were ugly as fuck in terms of UI and UX. ...
Interviewer: Implement Binary Search on a Linked List
Me: * did so on the whiteboard *
Interviewer: *irritated* This is complete BS
Me: Yes, a complete Binary Search π
rant
wk197