Almost on every interview I'm asked some questions implies data structure implementation. Is there really good reasons to implement own data structures in Java application?
-
to test if you can logic correctly? – Nishant Feb 20 '12 at 17:27
-
1There *could* be, but it's probably irrelevant -- the questions are probably intended to get an idea of your understanding of those basic data structures, regardless of how likely you are to really implement them. – Jerry Coffin Feb 20 '12 at 17:29
-
See [this question](http://stackoverflow.com/questions/9358821) for one of the possible usages. – Tomasz Nurkiewicz Feb 20 '12 at 17:29
-
@TomaszNurkiewicz thanks, really an interesting case. – wideString Feb 20 '12 at 17:43
4 Answers
No, probably not in most cases.
But the interviewer wants to check you understand the theory behind them and how to use them correctly.

- 46,453
- 60
- 198
- 311
-
That said, new implementations get added to Java, and to third-party libraries, more often than you'd suspect. – Louis Wasserman Feb 20 '12 at 18:38
"Data Structures and algorithms" is an indispensable field in the area of computer programming. It's important you know some of the basic algorithms and data structures irrespective of the programming paradigm or the language.
Try practicing these using a procedural languages like C.

- 10,922
- 24
- 72
- 114
Probably it is far more useful to know WHEN to use a list, array, dictionary etc. Using the correct data structure influences not only performance but also readability and maintainability and code clearity.
Creating your own is seldom necessary.

- 15,025
- 28
- 93
- 119
-
-
Yes, when you want to create your own data structure, such as a binary tree (which I believe is not a default type). – Michel Keijzers Feb 20 '12 at 21:00
Its good to know - the supplied collection classes span the most use cases. Its more about basic/advanced CS knowledge and specific application in a language. Knowing the details is essential to choose the right data structures, evaluate performance , thread safety etc.

- 1,441
- 11
- 6