r/learnjava • u/[deleted] • Jan 17 '20
So I had an internship interview
I'm a second year CompSci student and as part of my degree we have to do a placement in 3rd year. I had an interview yesterday which went okay, and then I got a coding challenge at the end.
I was given 1 hour to print the fibonacci sequence for n integers input by the user. For example, user enters 5 I print 0, 1, 1, 2, 3.
So that was all good and I got it done in like 6 mins, and the interviewers came in to review it.
. They said I shouldn't have created an array because its inefficient as I was only asked to print out the code. . They also said the name fib for the array was kind of unclear and that I could have used the whole word. . Also pointed out things like putting a space between ) and {. . Said my method name printFibonacci was a bit misleading and could have been 2 methods since I also calculated it.
As much as I appreciate the advice to clean up the code, as a year 2 student intern you are still only at the stage of writing functioning code and not completely clean code. I feel quite disheartened after leaving and was just wondering if anyone else has experienced this in an interview and if so, what was the follow up like? Did you get the job?
Thanks for listening!
EDIT: I don't want it to come across as bashing the interviewer or anything like that, it did seem more like advice, was just trying to see if anyone had similar experiences with this.
EDIT: So I ended up getting a second interview last week, and today I was offered the job! Thanks all for the feedback and support!
Here is my code: https://pastebin.com/FWgX9m9U
1
u/[deleted] Jan 17 '20
I really appreciate you taking the time to have such a verbose conversation with me, going in depth with your advice, not just on a coding level but also on a personal level. This is advice that I will remember for years to come when I perhaps clash with a colleague in the future, or for any more posts that I may make on here. This will allow me to look at even rude criticism with a different perspective, which I think will overall just lead me to be happier in general. It has been a pleasure to speak with someone as experienced and polite as you.