Interview questions for front end
This readme is a compilation of all the question asked during my recent COVID-19 job hunt. I've also att...
For further actions, you may consider blocking this person and/or reporting abuse
This list of problems to solve is extremely discouraging. I've done Hackerrank/leetcode/codesignal challenges, and most of these seem like things that would take me at least a couple hours. Mainly, I can't even see a 'first step' to a solution after reading the problem. But if you have all these exercises, it means you had all these interviews without being hired... and if they didn't hire you, then what gnats chance in hell do i have?
Congratulations, truly, for getting the interviews, and I thank you kindly for posting these in an attempt to help others learn from your experience.
These interview questions aren't necessarily meant to be answered on the spot. They're purposely complex so that the interviewer can see your thought and team process.
I was dumbfounded by many interview questions and I'm currently in a few final rounds. One of them is a fortune 500 company, and that's the one I most shaky in and never wrote a full implementation. But by talking my way through it aloud, the interviewer realized that I knew what I was doing and needed more time.
Just make sure to collaborate with the interviewer as if you already work there. Ask questions and provide input as you search for the solution. Understand why you're making certain choices, and the tradeoffs of them. They want to know how you'll be on the job after all.
Any honest developer would agree that if you haven't seen these problems before, it would take more than a couple of hours.
Like, who seriously believes promises were implemented in a day, let alone a couple of hours? And for those who do think that, do you even want to work with that toxic mentality?
The path to the solution is more important than the solution. So focus less on interviewing, and more on acting the same as you would on the job.
Solid take and advice. Thanks.
Yeah, I know right. It's not like I had it all figured out. The solutions I have posted here are the final ones that I had reached after making countless mistake and a ton of console logs. The toughest amongst them were 1 and 7. On any other day I wouldn't be struggling that much but presenting solution during interview is a whole different ball game.
Also I had cleared a lot of interviews but most of it didn't materialize. Some of the interviews I gave were only to gain experience, even when I was not interested in the company I was getting interviewed at.
I disagree. These questions are not that hard for someone calling themself a software engineer.
Very helpful. Congratulations on your new title.
A tad unnecessary. Just stating my opinion.
Your promise implementation is incorrect.
This is how the promise works:
If the handler function:
The implementation is a rough idea.
I believe it's better to provide a correct solution or no solution at all, otherwise, it may mislead our fellow developers into believing it to be the correct solution. You may check out this link for a detailed implementation and explanation of promises. By the way great post. :)
Please read the note before the answer started.
Yes, I've read that, it says "not production ready", not that the provided solutions are psudo-code. Anyway great stuff 👍.
2) Create a promise from scratch
Sorry, but your promise implementation is wrong.
then
andcatch
must return newPromise
instance but notthis
. That's why your sample doesn't work correct:Compare results using original
Promise
.Hi, thank you for sharing this but can you explain your getHashCode implementation ?
I though you would compute some values, based on charCodeAt() and maybe bitwise operation or anything, to make it unique, but you simply returned the string instance.
I expected the same when the interviewer asked the question. However, on further follow up the interviewer asked me to only make a method by the same name available on the instance. Strange 😕
Oh ok weird, thank you.
great blogpost anyway :)
For Sum of three,
lol. here i am a year into learning JS about an hour a day just mainly for fun. got more serious recently about trying for an entry level front end job and have been applying about 3 hours a day. but after seeing this im crushed... yay! thanks for sharing lol
Absolute insanity.
What types of positions did you apply for? Entry-level? Junior? Mid? Senior level? Just curious!
It was Software Engineer III position.
That makes sense
Children.prototype = new Parent(), shoudn't this be
Children.prototype = Object.create(Parent.prototype); instead of creating new instance?
Thanks for posting, good stuff.
Why does 'two' > 'three' evaluate to true?
For this case, ASCII value of first character from both string are compared. Since the first char is 't' from both string, the resultant ASCII value will also be same. The evaluation then moves to the second character of both string.
Character 'w' from string one has ASCII value greater than ASCII value of character 'h' from string two, hence evaluation will now be of below state...
Also the below evaluates to false
11) Convert class based inheritance code given below to ES5 code.
"class Parent(name){ " is wrong.
should be "class Parent { "
All this stuff for Frontend post? I am a fresher starting career in Frontend Development. But I hate DSA from my bottom of the heart. What should I do? These types of questions will freak me out.
I am not sure if a fresher will be subjected to same questions. However, learning DSA will help you out in long term if you are considering Software development for profession. You can check my
Resources for preparation
blog. It has links to some youtube channel to get started with DSA.Never mind how little sense that makes, the author actually stated he was being interviewed for a Software Engineer position. How is the tag of the post relevant, given that fact.
is this type of stuff way beyond a junior front end web dev interview? i f****in hope so lol... i would NEVER be able to answer this
To prepare for frontend/javascript interview. You can look at this ebook I created with collections of commonly asked frontend questions with solution.
mohit8.gumroad.com/l/ygass