4 ms·
> requirement is that the engineer being hired is able to come up with efficient algorithms. Coding binary tree is not the way to discover that. Presenting a
by p2t2p 5y ago
> requirement is that the engineer being hired is able to come up with efficient algorithms.
Coding binary tree is not the way to discover that.
Presenting a task and observing people solving it and explaining computation complexity behind their solution and the thinking behind their solution is how you do that.
- gameswithgo 5y agoIf I give a candidate a truly real world difficult problem with an hour or even a day to solve it, some people who are not so smart will get the correct answer by luck, some people who are brilliant will start off with a bad approach and not get there. If I ask if you can do something basic binary tree things, I will also not know if you are brilliant, but I can at least rule out if you are totally clueless or not.
- smallerfish 5y agoIt's a fine way of doing it, although certainly it shouldn't be the only algorithms question. It's a simple data structures / algorithms question. Can you think in terms of how data is stored in memory? Do you understand the tradeoffs of storing data in one form or another? Can you work with recursive algorithms? Given a challenge of having to think about data in a form you haven't recently, can you wrap your mind around the characteristics of that data structure? If you're getting asked all this for a ReactJS UI building job, then the interviewer is probably off-base. But otherwise, make sure you're applying for jobs you're suited for. If you don't want a job where coming up with efficient algorithms is important, that's fine - there's plenty of others out there.
- kayodelycaon 5y ago> Can you think in terms of how data is stored in memory? If you're using a modern OS, you don't know this. The kernel remaps everything and pretends to give you a linear chunk of memory. You don't know what's in the various caches and what's been paged out of ram completely. Everything is built on layers of abstraction. C is an abstraction layer that fits poorly into what modern CPUs and operating systems actually do, but everything is programmed to cater to C's assumptions so people don't need to rewrite their programs. Higher languages don't necessarily use the data structure you think they do and they can switch the implementation details based on the size. "Simple data structures" are only simple because you pick one specific layer of abstraction to work with.
- smallerfish 5y agoThat's not an excuse for not being able to reason about data structures if your job requires working with data structures and algorithms. The logical extension of your argument is "put everything in a linked list and let the OS work it out."