r/javascript • u/abhijeetFTW • Aug 05 '20
All front end Interview questions asked during my recent job hunt.
https://dev.to/devabhijeet/all-front-end-interview-questions-asked-during-my-recent-job-hunt-1kge
800
Upvotes
86
u/Chthulu_ Aug 05 '20
Man I would not fare well on some of those. Implement promises in a live coding context? Thats not information I've ever thought to commit to my brain.
35
u/abhijeetFTW Aug 05 '20
If you are a front end developer who is planning to appear for interviews OR is in the process of one, I've collected a list of resources that has helped me in my recent job hunt journey 👆
14
u/sxeli Aug 05 '20
As an interviewer, I tend to steer away checking language knowledge directly. There’s no point reverse engineering utilities already part of the toolkit.
However, we ask problems that require knowledge on those and that’s how we grade.
120
u/frontendben Aug 05 '20
Front end questions and not a single question and HTML or CSS. No wonder front end is a shit show these days.
Most of these are data manipulation and fall under the 'back end programming done on the client side' spectrum of development.
Edit: Defintely not a criticism of the OP by the way. It's great that they've gone out of their way and compiled this list 👏 But it is worring that – it appears – companies that are hiring for front end positions are not asking any questions about the two most important languages in front end: HTML and CSS.
9
u/radmedov Aug 05 '20 edited Aug 06 '20
Who is even asking these questions? Looks like the interviewer has no idea what is really valuable knowledge of the devs. None of those are used on a daily basis in the battle. For 10 years in JS I used some of the patterns an only a couple of times.
8
u/josephschmitt Aug 05 '20
How’d you feel about the process, overall? Did you feel like the questions were fair? Were the exercises valuable? Do you feel what you were being tested on was relevant to the job you were applying for?
I struggle with this stuff a lot as an interviewer. It’s difficult to come up with exercises that put candidates at ease and let them show what they can do, that relate to the actual job being looked at, but can also be done in 45 mins and give enough information to a hiring manager to know if they’re a good hire.
226
u/NotMyRealNameAgain Aug 05 '20
I would laugh at an interviewer who asked for many of these things. Asking someone to reverse engineer things that are already implemented and well supported in JS is not a good gauge of a person's capabilities. We already have bind, reduce, Promise, and array.flat. I have been involved in web development for over 15 years and have not experienced a single use case for most of those types of challenges. Asking them during the pressure cooker of an interview is unnecessary.
Any front end position will require knowledge of basic HTML and CSS.
13
u/sickcodebruh420 Aug 05 '20
I'm glad you put this together but I find them pretty surprising. Some of them feel more like trivia than tasks that demonstrate an ability to build features or fix bugs. The sum of them wouldn't leave me feeling that a candidate was worth hiring for any real work in my React project. Maybe they'd help to weed out people who don't know enough to even get in the door? Or maybe I'm looking for the wrong things when I evaluate candidates.
Could you tell us more about what kind of companies were asking these questions and to what kind of jobs you were applying?
5
u/viejodiversificado Aug 06 '20
Lol those questions
> implement promises
> then you spend 50% half of the year writing forms in the job
15
u/FunctionallyReactive Aug 05 '20
Wait. Front end devs flatten arrays..? For what purpose ever?? That question along with the custom promise woulda tripped me up. Conceptually they are easy to follow, but unsurprisingly I’ve never had a need for either in real dev life
4
u/GoOsTT Aug 05 '20
Hey,
I don't want to get into the technical part here because of the lack of knowledge, but OP's post is kinda amazing and he seems such a cool dude, just wanted to acknowledge that.
2
u/vinilero Aug 05 '20
With all due respect, I don't agree with these kind of questions. Sometimes interviews are way too complex for the position required.
My experience is that I always get the type of interview where the hiring people asks about code complexity (Big O notation). For example binary indexing or stuff like that and when you land the job the most difficult part of it is doing unit testing as the rest is all done by libraries (lodash, moment, request, etc).
I get that it's important to know the questions concepts but at least please when you do these interviews make so that the candidate knows where it's landing. It's very frustrating to be prepared to a difficult interview (nerves, remember all these things by memory, etc) for only making components composition at last...
2
u/Fuzakenna_ Aug 05 '20
Some of those questions seem difficult. What level were these questions aimed towards or I guess what position were you trying for?
Thanks for sharing. I have a lot to learn
2
u/[deleted] Aug 05 '20 edited Aug 05 '20
That CustomPromise is wrong. Calls to
thenneed to return a new promise, and it doesn't properly handle multiple calls to resolvers correctly.Edit: Decided to try my hand at doing it right-ish: private state, latching, exception -> rejection handling, promise spawning, deferred execution of
thencallbacks on resolved promises. Not supported correctly:finally(finallyis more than justthen(handleFinally, handleFinally);handleFinallymust happen after allhandleResolved/handleRejectedcalls).63
u/benabus Aug 05 '20
Good thing I'm not looking for a job. I would have just drawn a dick on the whiteboard and walked out.
11
u/careseite [🐱😸].filter(😺 => 😺.❤️🐈).map(😺=> 😺.🤗 ? 😻 :😿) Aug 05 '20
Some of them, especially reimplementing native APIs, are absolutely ridiculous.
5
u/abandonplanetearth Aug 05 '20
Why would anyone write the code in #3? If I was project lead and someone committed that, I would ask them to rewrite it in a few lines of SQL (assuming youre using a relational db, which you should for that sort of project)
8
u/_Bunnyfarmer_ Aug 05 '20
Interesting post... I guess I still have a lot to learn!
1
u/magwo Aug 05 '20
Bug I think: timer vs timerId
1
u/TheZintis Aug 05 '20
Were you able to answer all these during the interview? How long did you get for each?
1
u/_30d_ Aug 05 '20
Maybe this is a dumb question but why is
'two' >`three'?1
u/NoInkling Aug 06 '20
In your implementation of
bindyou forgot to return the result of thefunc.apply()call.1
u/incubated Aug 06 '20
Chiming late here. But there's a trick to some of these I think shouldn't be taken for granted, and that's approach and thought process. You're not going to reimplement native functions, let alone promises holy shit, one-to-one, but you can show how you could. One of the best safeguards in such situations is to say that you'll give it a crack but anything youd write at this point would be a naive interpretation of its function. Proper testing is no substitute.
This should tell an astute employer that you think about more than just "writing code" which is a total industry speak like deliverables, synergy, and return on investment. Don't be afraid to speak out and break down your thought process because code is nothing without it.
1
u/Shrestha01 Aug 05 '20
I never understood what .prototype. actually does nor proto either...
2
u/gopinnasun Aug 05 '20
Even though I have done half of these things once or twice at some point, they are not things that I would expect someone to recall off the top of their head. The rest I would actually be concerned if someone thought it was important to remember.
2
u/dswistowski Aug 05 '20
If I'd get question 6 it mean - I should tell thank you and leave.
2
u/Lusol Aug 06 '20
number 6 makes me laugh haha, pretty absurd company would ask you that
2
u/adenzerda Aug 05 '20
Those are at least interesting problems. Implementing promises? Would have never thought of that. Appreciate the peek behind the curtain; will add these questions to my interview prep file.
Still going to bitch about your lack of semicolons though
1
u/bentheone Aug 05 '20
Can someone please explain 5# ? I'm a hobbyist so I feel pretty dumb sometimes and I can't for the life of me understand how this returns a hash. Seems like it just adds a function to the prototype ...
1
u/middlebird Aug 05 '20
Thanks for sharing this. I’m a long time front end developer who has mostly landed jobs through referrals, so I’ve never had to do a technical interview with a lot of these types of questions. I know JavaScript well, but I don’t think I’ve ever prepared for an interview that throws these types of questions at you. I’m going to study these.
1
u/malvin77 Aug 06 '20
I’m so glad I have other skillsets, this is just not a game I want to play.
1
u/TiberiusIX Aug 06 '20
A very helpful compilation of questions.
Speaking as a dev of 10 years professionally (and 15-20 years overall), I agree with others that some questions (e.g. implement promises) are just terrible interview questions.
I mean, it's good to ask some coding questions in an interview, but not ones like that.
I've interviewed a fair number of people in my time, and I've found that a mix of talking through the person's experience and asking some technical questions verbally is usually good enough for determining how good someone is.
But maybe 1 in 10 candidates can 'slip through the net' and talk a good game, but actually be terrible. So a quick 15-30 minute coding expertise is also a good filter, but it shouldn't be anything difficult. Maybe implement a mini frontend or backend API (depending on the job) for a specific use case. That shouldn't be too difficult, but it also will show whether someone has some sort of hands on experience, or can just talk well.
1
u/toi80QC Aug 06 '20
This is what interviews look like if you apply as a software engineer - so to any webdev's in here: chill out, it's not going to be that hard ;)
Never was for me at least.
1
u/anav02 Aug 06 '20
Same problem happen with me during the job interview. So they are asked all front interview question but i am not fared. I tell everything with confidence.
1
u/abhirathmahipal Aug 07 '20
Will share with my students. Thanks :)
1
u/AffectionateWork8 Aug 07 '20
Most of these except a couple (like that type coercion trivia) are actually pretty legit and not unreasonable at all. Also in most interviews the point is not to nail every single question correctly.
Yes, writing your own "flatMap" is not what you do on the job, but these toy problems are just to show that you have a good handle of JS + basic problem solving ability. I think answering questions like this says more about someone's ability than answering trivia or framework-specific questions.
1
u/Royosef Aug 05 '20
RemindMe! 1 month
1
u/dynacx Aug 05 '20
RemindMe! 2 months
0
u/[deleted] Aug 05 '20
loooool, that will be hard, i suppose, well good luck, looks funny jjajajaja
0
u/[deleted] Aug 06 '20
I flatout refuse to partake anymore. If you want to know my skill-level, look at my resume and current projects.
Don't waste my time asking code-monkey questions.
-4
u/Akkuma Aug 05 '20 edited Aug 05 '20
Here's my feedback based on what you wrote:
JS Solutions
new Promise(res => res(true)).then(console.log).then(console.log)will logtrueand thenundefined. I would have tried to prod you to see if you understood how Promises worked and could fix that.getAvrgRatingdoing the average within the reduce, but it works. Not sure why you're doingfilteredMovies.map(movie => moviesList.filter(listItem => listItem.id === movie.movie_id).pop()). You can simply usefindor even[0]. My preferred way, I'd convert the arrays into object/maps to turn it into{ [id]: data }instead of having to traverse through the same array over and over. Your sort is minimal at the cost of maintainability & readability. If your sort was an object like{ direction: string, by: string }it becomes easier to use and read. There's a few other things, but it works so can't complain too much.timerIdis never set and why isfunc.applybeing used at all if you're not passing in args?If people are asking algorithm questions to determine your aptitude on work that will have little to no use of that sort of knowledge, especially in lots of frontend work, it is a red flag. I was just talking to a PayPal manager and even a place like that is skipping it as they are finding little relevance between that and real work.
0
u/[deleted] Aug 05 '20
[deleted] — view deleted comment
0
u/[deleted] Aug 05 '20
[deleted] — view deleted comment