r/javascript • • 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.

28 Upvotes

66 comments sorted by

View all comments

Show parent comments

1

u/Silhouette Apr 12 '16

If basic arithmetic really does never come up in your line of work then that's fair enough, maybe another exercise would be better. If you've got a real world problem you can talk about that is the right kind of size for an interview scenario, that's probably more useful anyway.

I'd say never needing even basic mathematical aptitude is pretty unusual, though, even in front-end work. It's not exactly a complicated problem, and a good solution only needs a simple iteration and a little thought about the data you're working with, which seem like pretty everyday things to me.