• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Structure implementation in Java  RSS feed

 
Praggi Gen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So right now I am preparing for job interview and various coding competitions and I have a few doubt regarding the implementation of data structure using java.
Q1) As java provides Collection framework to use all the data structure, do I need to learn to make all these data structure by my own instead of using the Collection framework ? or Should I learn both (using Collection and making them by myself ?)
Q2) Will interviewer ask me to make Data Structure (my implementation not using the Collection ) ?
Q3) For company like google do I need to make these by myself or can I use the Collections ?
Q4) Do I need to know about the inner working of Collection classes ?

I have been confused with this for like 2 month please help me out...
I am new here if I have made any mistake in asking question please forgive me
God bless you
Thank you 
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I shall duplicate this discussion in the jobs forum where questions about interviews usually come up.
You probably will never have to write your own general‑purpose collections classes, but I think you should know about their internal workings and how you would write them. It might be worth writing a simple map, list, linked list, queue, set, and tree set just for practice.
Praggi Gen wrote:So right now I am preparing for job interview and various coding competitions and I have a few doubt regarding the implementation of data structure using java.
Q1) As java provides Collection framework to use all the data structure, do I need to learn to make all these data structure by my own instead of using the Collection framework ? or Should I learn both (using Collection and making them by myself ?)
Q2) Will interviewer ask me to make Data Structure (my implementation not using the Collection ) ?
Q3) For company like google do I need to make these by myself or can I use the Collections ?
2, and 3: Don't know. Don't know. I would have thought they would expect you to be able to write such classes. I would think it goes without saying that an applicant should be able to use the better‑known classes in the Collections Framework.
. . . God bless you
Thank you 
That's a pleasure.
 
David Simkulette
Ranch Hand
Posts: 67
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Praggi Gen wrote: Should I learn both (using Collection and making them by myself ?)


Heck yes. Companies want people who are "capable" of coding (something as complicated as) data structures. Everyone in comp. sci.  coded data structures from scratch, even though of course they already exist. We all did it.

Praggi Gen wrote: Q2) Will interviewer ask me to make Data Structure (my implementation not using the Collection ) ?


Who knows? They could. They might not. They could ask you for something even harder. Depends on the job. A lot of companies will just look at your past employment history, read your resume and hire you. Who knows? Do you want to chance it?

Praggi Gen wrote: Q3) For company like google do I need to make these by myself or can I use the Collections ?


Oh for Google they definitely want people who are capable of data structure design and more. No telling if the person you sit down with will ask you to do one, but it's immaterial because if you can't in principal create them, then you're not going to hold the job long anyway. Look up "google interviews" to see the craziness that goes on there.

Praggi Gen wrote: Q4) Do I need to know about the inner working of Collection classes ?

In general, for each category of DS you should have at some point actually written your own because that is the minimal definition of being a competent programmer, by unanimous agreement- understanding how to code things that complicated.



Praggi Gen wrote: I have been confused with this for like 2 month please help me out...


OK well two months is not a long time to have been coding. If you can code but data structures seem intimidating to you,as they do to most people,  then you need to find a good book on data structures and work through it as though you were in class in school and you cared about your grade. This is defintiely doable; people of just ordinary intelligence do it. Programming is not an IQ competition, but you have to sit down day after day and go through the material and learn it. For that you need a good book you can actually learn from (as opposed to a good book that is merely very sophsiticated and praised as "authoritative").


You are definitely smart enough to do it. CS majors take two semesters; one on elementary DS then one on advanced DS.

Find a book on DS written in a language you really know . The choice of book is paramount and be prepared to quit books that are too hard to understand (for you as you are today).

Everyone starts where you are right now. Then they do the work. You can do the work too. There is no royal road to data structures.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!