r/learnjava • • Jun 16 '15

Help with job interview

Hello everyone!

I need some help, I have an interview next week with a company that offers Java traineeships. They have asked me that before I come in I send some code to show how far I've come. The problem is that I'm very uncreative with things like this. The logic part and such I am fine with. However just start coding something out of thin air and I don't know where to start or what to do.

I'm currently in college, nearing the end of my first year. I know about abstract classes and interfaces and how to implement them. A little about sorting lists alphabetically or by for example age. Other then that, I know all of the basic stuff. Like try catch blocks and all that.

Now my question is, what would be a project that I can finish within 4 days that could really show off my knowledge?

0 Upvotes

2 comments sorted by

2

u/amnuous Jun 16 '15

Probably not the best advice, I'm sure more proficient programmers will answer you better, but writing a piece of code using recursion could show some skill, just because most students fail to understand the concept, and showing you are able to grasp that should help you.

2

u/[deleted] Jun 16 '15

There probably is not a single project you can do in four days to show off all of your knowledge -- simply put, your probably know more than can be expressed in just four days. Moreover, your goal here should not be to show off all your knowledge, but instead to show that you can do good work and solve problems.

Rather than worrying about being creative, reproduce (even on the command line, if necessary) something that already exists in the simplest way you can. Maybe it's a to-do list. Maybe it's a phone book. Something that has you work with real-world(-ish) data.

Were it me, I'd build a CSV parser -- given a CSV file, open it, turn each of those records into objects of the appropriate class, then work with them in some way. As a bonus, have your program be able to export data to a CSV file as well.

Add in some sorting, some use of the Date/Time class(es), reasonable error handling, and reasonable data validation, and you've got yourself a manageable project. If you use things like interfaces and abstract classes, cool, but only use them if you think they'll make your life easier. Ditto for recursion, data structures, algorithms, design patterns, and so on; only use them if they're in response to a problem you actually have right now and if they're appropriate to that problem.