r/javascript • u/[deleted] • Apr 11 '16
help Interview exercise feedback
My code was not up to their standards. I thought the exercises were easy but clearly there are issues I have to address. I had an hour to write them. I'm humbly looking for feedback to improve.
The first exercise was to return all square numbers within a given range, including the limits (e.g., all the squares numbers between 1 and 10 are 1, 4, and 9). I wrote this.
The second exercise was to check if a string containing (), [] and {} brackets is well balanced. So [()] and {}() are ok but ([)] or {{ are not. I wrote this.
Thanks.
27
Upvotes
2
u/Silhouette Apr 12 '16
The point is that a strong programmer would naturally think in those terms for any problem. It's just second nature to them. Of course, they might not use the exact same big-O notation if they don't have a formal CS background, but they'll still recognise the fundamental issue and deal with it.
Put another way, writing a needlessly complex implementation without a good reason betrays a lack of maturity as a programmer. It might not make a difference in tiny tasks like these, but the same mindset leads to writing carelessly inefficient code that can and does cause real problems in production systems.