4 ms·
Personally I see this a lot in normal interview style questions. They are geared towards an imperative approach, find this thing in a 2d matrix based on some wa
by Royalaid 6y ago
Personally I see this a lot in normal interview style questions. They are geared towards an imperative approach, find this thing in a 2d matrix based on some way of manipulating the indexes is a common example. If you try a functional approach it is possible but often times akward or super dense looking code much like the double linked list example above.
I feel like this comes from the fact that while languages are extremely easy to bend into a shape that fits the problem and take a long time to learn so it's often easier for programmers to put out a bad solution instead trying to get the problem and the language to meet in the middle.