DEV Community

Cover image for 30 Web Developer Interview Questions (With Answers)

30 Web Developer Interview Questions (With Answers)

Gedalya Krycer on January 04, 2021

Overview I don't know about you, but technical interviews are not my favorite. That said, they can be an effective way to discover new a...
Collapse
 
bookercodes profile image
Alex Booker

Would be amazing if you linked my post on React interview questions at the bottom, for those looking to keep going and nail the more specific React interview!

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

Hey Alex, that bottom section is really more for questions that I pulled from online and used within this post to also answer. However, I did just read your React Interview Question article and it is really good, explaining a lot of concepts clearly.

If I do a React Resources post in the future this will definitely go into it. 👍

Collapse
 
bookercodes profile image
Alex Booker

No worries, Gedalya. Thanks for considering it :)

Collapse
 
letsjuscode profile image
Kamal Sharma • Edited

Hey, it was very useful and helped brush my knowledge. Here are few more questions I was practicing from InterviewBit on HTML

1 - How to handle events in HTML?
2 - How to include javascript code in HTML?
3 - Difference between link tag and anchor tag ? 4 - What is the ‘class’ attribute in HTML? 5 - What is the difference between tag and tag?

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

Here's my best attempt at getting them all wrong:

1. Why is alt text important?

So users know what they're missing out on when your admin fucks up and takes the
image server offline.

2. What does the <DOCTYPE> tag in HTML do?

It reminds you what type of file you're working on at the moment.

3. Optimize this HTML code with proper semantic elements.

add class="container header", class="container article", etc. to the divs

4. What are Open Graph meta tags?

Metainformatin that allows you to make your phishing site look more legitimate.

5. What are different ways to use the <script> tag in HTML?

<script>, <SCRIPT> <Script>, etc.

6. How comfortable are you with Bootstrap?

I usually write CSS at my desk in my office chair, which is very comfortable,
but I might occasionally do work outside, in which case I cannot guarantee my
comfyness while using Bootstrap.

7. How would you override a Bootstrap button style?

!important

8. What is the box-sizing property?

It's a CSS property that allows e-commerce sites like amazon to add semantic
information about the dimensions of a product so the user can expect what they
will be getting.

9. In what ways do you use CSS Animations effectively and efficiently?

Mostly with flash, which is very efficient by default. I also used animated gifs
with the background-image property before the industry overall abandoned that
pattern and it became considered bad practice.

10. How would you rewrite this CSS code in SCSS, using BEM naming conventions?

.BEM.buttin {, .BEM.button-with-icon {, etc.

11. What values of the display property do you know and how are they unique?

display: hidden and display: visible

12. What is Event Delegation?

The busyness practice when a new ticket is opened and the boss delegates it to
an employee matching issue-importance to employee-motivation (i.e. important
issues go to motivated employees, less important issues got to less motivated
employees and UX issues go directly to the janitor)

13. Explain the difference between the For, While, and Do...While loops.

The Four-loop repeats a block of code exactly 4 times. The while loop repeats
the code while a condition is true and the do..while loop makes sure to actually
do what you tell it to while the condition is true.

14. How do you parse data as JSON in Node.js?

eval

15. Explain the difference between var, let, and const.

var declares a new variable, let lets go of a variable (frees its memory)
and const creates a new variable and throws an error if the user tries to
let it go.

16. How does this behave differently in arrow functions, in comparison to
regular functions?

*proceeds to rant 5 minutes about whatever the interviewer is holding in their
hand as they say "this" (presumably a pen, glass of water, or maybe interview
notes)*


Okay, that's about the extent of my stamina for making up stupid answers. Maybe
someone else can take over from question 17 onward? 😉

Collapse
 
_dsasko profile image
Denis Šaško

Thanks for the post.

Small correction in 3. Optimize this HTML code with proper semantic elements.
<h2>This is a blog subtitle</h2> is neither semantic nor in the original part of the code.

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

No problem and thank you for catching that typo! I’ll add the subhead in the original code shortly. :)

Could you elaborate on how it would not be semantic? To my understanding, text that summarizes or leads into a topic specific block of text, would be a good candidate for headline tags. And the less impactful a headline is to the main subject, the smaller designation it would get. (From h1-h6).

But eager to learn something new about it if that understanding is not correct. Thanks!

Collapse
 
_dsasko profile image
Denis Šaško

I agree with what you said, but the word "subtitle" is what bugs me. Headings should use the h1-h6 tags, yet subheadings (or subtitles) should be put in a regular p tags. So imho either the text inside your h2 is wrong or the h2 itself is.

Thread Thread
 
gedalyakrycer profile image
Gedalya Krycer

Ah, that makes sense now. I can see how "subhead/subtitle" could communicate something different.

My intention was for a "level 2 headline/title" vs text that follows a headline/title. I agree that in the latter case a <p> tag would be better served. :)

Collapse
 
davidedelpapa profile image
Davide Del Papa

Very nicely done!

One typo in the code: in the async section of <script> loading, it reads defer, not async.

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

Thank you for catching that! Just fixed it. :)

Collapse
 
architectak profile image
Ankit Kumar

Nice Collection for refreshing basics 👌👏

Collapse
 
amirkhan81 profile image
Amir Khan

Nicely done, with 10+ years of experience high-level articles like this are still refreshing.

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

Thank you! Indeed, sometimes coming back to the basics can be really valuable.

Collapse
 
mhasan profile image
Mahmudul Hasan

Very helpful post, thanks 🙂

Collapse
 
gedalyakrycer profile image
Gedalya Krycer

You’re welcome! Best of luck!