I applied for a backend role, expecting the interview to focus on server-side technologies and development. However, I was unexpectedly asked frontend questions, which caught me off guard since I had primarily prepared for backend-related topics, leaving me less confident in answering the frontend queries.
Interview questions [1]
Question 1
How do you select an element by its class or ID in JavaScript?
How can you dynamically change the content of an HTML element using JavaScript?
What’s the difference between margin and padding in CSS?
How do you modify the margin or padding of an element using JavaScript?
What is the box-sizing property, and how does it affect the way margin and padding are applied?