Deathwing
<Bronze Donator>
This is the link:Maybe he is asking why you need to return a pointer from a function instead of being able to return the array? I assume C has that limitation since C++ has it at least.
Difference between pointer and array in C? - GeeksforGeeks
It's phrased really poorly, like someone saw some shared characteristics between arrays and pointers, and there definitely are, but they had to shoehorn it into an "interview question".
I've gone from C++ to Java to C to Python, traversing my job history. I've found the simplicity of Python's implementation, even outside of containers, to be much more beneficial than knowing that one time it would be better to know to use a sorted Map or vector instead of ArrayList.You're mostly just complaining about Java having a ton of implementations of their basic Collection interfaces... Like mostly you'll just define your List as an ArrayList but sometimes you need something different. Granted Queues and Dequeues are different interfaces but they ascend to the same Queue interface. But it is nice knowing that you have a HashMap but sometimes you do actually need a sorted Map and Java already gives you a TreeMap for that occurrence. Just because Java gives you a ton of implementations doesn't make it bad it just gives you generic stuff (ArrayList, HashMap, LinkedList) but it can also give you more specific and granular implementations if required by your spec.
Vectors are thread-safe where ArrayLists are not thread-safe. Usually you don't want to pay that cost so you will use an ArrayList 999/1000 but sometimes Vectors fit their niche. Though since Java added the java.util.concurrent package in (I think?) 5 it is pretty much wholly deprecated.
Not to say that making such choices don't have their place. I'm just saying I much prefer the type of programming I can do in Python due to that simplicity. Everything's a dict, I know how they function, no need to worry about details of the variations.