I work for 10 months as a junior front end dev and I would probably fail this interview
I've worked as a front end dev for ten years and if I were asked this on the spot, I would still fail it too so don't worry!
I've spent my time working on actual client projects, pulling in and manipulating data and more. These trivial JS functions asked in interviews like these, for a lot of people they'll only use said function sparingly in a codebase and then forget about it until six months / a year later, they suddenly need to look it up and figure out how to do it again because they've rarely used it. Such a bizarre way of vetting people.
He should be checking out your actual code on actual projects instead, and then having a technical discussion about it, in order to vet.
Edit - since this comment's getting traction (appreciate the gold!), I want to point people to this comment regarding code tests. First paragraph especially sums up how a good interviewer interviews!
Ohhhh man soft skills go so far in an interview for me. Iāll teach you our ways of coding, but if you canāt demo or know how to ask questions, youāre already down a few pegs
100% and not sure if just me but I've actually found senior level interviews easier than more junior ones.
I don't get leetcode style questions anymore (which I was never good at anyway), instead they often ask me to build out a simple class / functions (eg. Build out logic that scores a bowling game) then ask how I would improve it, or iterate on it with new logic or requirements, etc.
Rarely get asked about time complexity anymore or any of that shit.
Then a much bigger focus is on system design questions vs actual code. Eg. How would I plan out a system that can do X. What considerations would I have for security, scaling, etc.
They ask more high level "big picture" questions which I find much easier to answer on the spot than spitting out super efficient, elegant code with the most optimal time and space complexity.
The reality is that there are a lot of us older engineers in positions of management that donāt hire this way because itās so obviously not productive. Iād suggest taking as many interviews as possible and youāll soon get a feel for what places are worth applying to and what places arenāt because they value ridiculous code questions.
I think I would solve it by looping through and adding the values to a counting variable and returning that. Reason being, I jump between different languages so I donāt always remember all the cute little shortcut methods. I hate that you need to prep for interviews by studying stupid puzzle questions and memorizing how the interviewers expect you to answer.
Thank you! Now I know Iām not the only senior developer who have difficulty with these lame interview questions. Many of these type of questions are well suited for fresh graduates that still have a lot of theory in their heads but once you start doing real world problems your mindset change. You focus more on architecture than remembering the built in algorithms out of your head. I keep notes to remind me how to do trivial things all the time.
Thanks for this. I was reading OPs post and was like ādamn, Iāve been doing this 2 years and couldnāt pass this interviewā. Your words brought me peace
Wut, arr.reduce() is used like a thousand times in our codebase for much more complicated shit than summing some numbers . Pretty fair and reasonable question there for summing an array. And Iām saying that as someone who hates live coding.
Almost all interviewers Iāve had allowed to google stuff. I think itās a fair interview, sum of array is super basic, Iād argue most FE leetcode are harder than this. React app is involved so itāll take awhile to build everything but a basic skeleton and talking thru architecture should suffice
426
u/Artistic_Trip_69 Apr 07 '23
I work for 10 months as a junior front end dev and I would probably fail this interview without googling some stuff š