0% found this document useful (0 votes)
45 views7 pages

Frontend Interview Questions

Frontend Interview Questions

Uploaded by

barikhemanta997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views7 pages

Frontend Interview Questions

Frontend Interview Questions

Uploaded by

barikhemanta997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML

1. What is HTML and what is its role in web development?


2. Explain the basic structure of an HTML document.
3. What is the purpose of the <head> and <body> tags in HTML?
4. Differentiate between HTML, XHTML, and HTML5.
5. What are semantic HTML tags? Provide examples of semantic tags and explain their significance.
6. Explain the difference between block-level and inline elements in HTML.
7. What is the purpose of the alt attribute in HTML image tags (<img>)? Why is it important?
8. Describe the difference between HTML elements, attributes, and tags.
9. How can you create a hyperlink in HTML? Provide an example.
10. What is the role of the DOCTYPE declaration in HTML? Do you need it in HTML5?
11. Explain the difference between HTML forms' GET and POST methods.
12. What is the purpose of the <meta> tag in HTML? Provide examples of how it can be used.
13. Describe the importance of accessibility in HTML development. How can you make your HTML
code more accessible?
14. What is the purpose of the iframe tag in HTML? Provide an example of its usage.
15. How do you comment in HTML code? Provide examples of both single-line and multi-line
comments.
16. Explain the concept of nesting in HTML elements. Provide an example.
17. What is the purpose of the title attribute in HTML elements? Provide an example.
18. Describe the difference between the <strong> and <em> tags in HTML. When would you use
each one?
19. What is the purpose of the id and class attributes in HTML elements? How do they differ?
20. How can you include external CSS and JavaScript files in an HTML document?
21. What is the difference between HTML and HTML5 doctype declarations?
22. Explain the concept of HTML entities. Provide examples of commonly used entities and their
corresponding characters.
23. How do you create a numbered list (<ol>) and a bulleted list (<ul>) in HTML? Provide examples.
24. Describe the purpose of the <table> element in HTML. How do you define rows and columns
within a table?
25. What are the differences between the <header>, <footer>, <nav>, and <article> elements in
HTML5? When would you use each one?
26. How do you embed multimedia content such as videos and audio files in HTML? Provide
examples.
27. Explain the concept of HTML5 semantic elements and their advantages over using non-semantic
elements.
28. What are data attributes (data-* attributes) in HTML? How can they be used, and what are their
benefits?
29. Describe the purpose of the <figure> and <figcaption> elements in HTML5. Provide examples of
their usage.
30. How can you create a clickable email link in HTML? Provide an example.
31. Explain the difference between the href and src attributes in HTML anchor (<a>) and image
(<img>) tags, respectively.
32. What is the purpose of the charset attribute in the <meta> tag? How is it used?
33. How do you create a dropdown menu in HTML? Provide an example.
34. Describe the purpose of the <input> element in HTML forms. Provide examples of different input
types and their usage.
35. What is the purpose of the <label> element in HTML forms? How does it enhance accessibility?
36. Explain the concept of HTML validation. How can you validate an HTML document?
37. How do you create a line break (<br>) in HTML? Provide an example.
38. Describe the importance of using proper indentation and whitespace in HTML code. Why is it
considered a best practice?
39. What are the advantages and disadvantages of using inline CSS styles versus external CSS
stylesheets?
40. Explain the purpose of the title attribute in HTML elements. How does it impact SEO?

CSS

1. What is CSS, and what is its role in web development?


2. Explain the difference between inline, internal, and external CSS styles.
3. Describe the box model in CSS. What are its components?
4. How do you select elements in CSS? Provide examples of different types of selectors.
5. What is the purpose of the !important declaration in CSS? When would you use it?
6. Explain the difference between margin and padding in CSS.
7. Describe the difference between display: block, display: inline, and display: inline-block in CSS.
8. What is the purpose of the float property in CSS? How does it work?
9. Explain the difference between position: relative, position: absolute, and position: fixed in CSS
positioning.
10. How do you center an element horizontally and vertically in CSS? Provide examples.
11. Describe the difference between em and rem units in CSS. When would you use each one?
12. What is the purpose of the z-index property in CSS? How does it affect stacking order?
13. How do you create a CSS3 gradient? Provide an example.
14. Explain the concept of CSS specificity. How is specificity calculated, and why is it important?
15. Describe the difference between the font-weight and font-style properties in CSS.
16. How do you create a CSS3 animation? Provide an example.
17. What is the purpose of the @media rule in CSS? How can it be used to create responsive
designs?
18. Explain the concept of vendor prefixes in CSS. Why are they used, and how can you handle
them?
19. Describe the purpose of the box-shadow and text-shadow properties in CSS. Provide examples.
20. How do you include custom fonts in a web page using CSS? What are the different methods
available?
21. What is the purpose of the overflow property in CSS? How can you use it to control the visibility
of overflowing content?
22. Describe the difference between margin:auto and text-align: center for centering content
horizontally. When would you use each one?
23. Explain the concept of the CSS box-sizing property. How does it affect the sizing of elements?
24. How do you create a responsive layout in CSS? Describe the techniques you would use.
25. What are pseudo-classes in CSS? Provide examples of commonly used pseudo-classes and their
purposes.
26. Describe the purpose of the CSS transition property. How does it enable smooth animations in
web pages?
27. What is the flexbox layout model in CSS? How does it differ from the traditional box model
layout?
28. Explain the difference between inline-block and inline elements in CSS, and when would you use
each one?
29. How do you apply CSS styles specifically for printing? What are some common use cases for print
styles?
30. Describe the purpose of CSS preprocessors like Sass and LESS. What advantages do they offer
over writing raw CSS?
31. How can you target specific elements based on their attributes using CSS attribute selectors?
32. Describe the purpose of the transform property in CSS. Provide examples of transformations you
can apply using this property.
33. What is the purpose of the CSS box-shadow property? How can you use it to create shadow
effects for elements?
34. Explain the concept of CSS specificity and inheritance. How do these concepts impact the way
styles are applied to elements?
35. How can you include external CSS stylesheets in an HTML document? What are the benefits of
using external stylesheets?
36. Describe the difference between inline, block, inline-block, and flex display types in CSS, and
provide examples of each.
37. How do you create a CSS dropdown menu? Provide an example.
38. Explain the purpose of the opacity property in CSS. How does it affect the transparency of an
element?
39. Describe the difference between :hover, :active, and :focus pseudo-classes in CSS.
40. How do you create CSS sprites? Explain their benefits and how they can be implemented.

JAVASCRIPT

1. What is JavaScript, and what is its role in web development?


2. Explain the difference between JavaScript and Java.
3. Describe the basic syntax for declaring variables in JavaScript. What are the different types of
variables?
4. How do you include JavaScript code in an HTML document? Provide examples of both inline and
external JavaScript.
5. Explain the difference between == and === operators in JavaScript. When would you use each
one?
6. What are the different data types in JavaScript? Provide examples of each.
7. How do you declare and call a function in JavaScript? Provide examples.
8. Describe the purpose of the document.getElementById() function in JavaScript. How does it
work?
9. Explain the concept of scope in JavaScript. What is the difference between global and local
scope?
10. How do you create a loop in JavaScript? Provide examples of for and while loops.
11. What is an array in JavaScript? How do you create and access elements in an array?
12. Describe the purpose of the this keyword in JavaScript. How is it used?
13. How do you handle errors in JavaScript? Explain the purpose of the try, catch, and finally blocks.
14. What is event handling in JavaScript? Provide examples of commonly used events and how they
are handled.
15. Explain the difference between synchronous and asynchronous JavaScript code. Provide
examples of asynchronous operations.
16. Describe the purpose of the setTimeout() and setInterval() functions in JavaScript. How do they
work?
17. How do you manipulate the DOM (Document Object Model) using JavaScript? Provide examples
of common DOM manipulation techniques.
18. What are closures in JavaScript? Explain their significance and provide examples.
19. Describe the difference between null and undefined in JavaScript.
20. How do you create and handle JSON data in JavaScript? Provide examples of JSON syntax and
manipulation.
21. What are JavaScript promises? How do you use them to handle asynchronous operations?
22. Explain the concept of hoisting in JavaScript. How does it affect variable and function
declarations?
23. How do you add and remove elements from an array in JavaScript? Provide examples.
24. Describe the purpose of the map(), filter(), and reduce() functions in JavaScript. How are they
used?
25. What is the purpose of the localStorage and sessionStorage objects in JavaScript? How do you
use them to store data locally?
26. How do you define and use classes in JavaScript (ES6)? Provide examples.
27. Explain the concept of event delegation in JavaScript. How does it improve performance in event
handling?
28. How do you check the type of a variable in JavaScript? Provide examples of the typeof operator.
29. Describe the purpose of the fetch() function in JavaScript. How do you use it to make HTTP
requests?
30. How do you create and manipulate dates and times in JavaScript? Provide examples of date and
time-related functions and methods.
31. Explain the difference between let, const, and var for variable declaration in JavaScript. When
would you use each one?
32. Describe the purpose of the NaN value in JavaScript. How do you check if a value is NaN?
33. What is the difference between a method and a function in JavaScript?
34. Explain the concept of callback functions in JavaScript. How are they used, and why are they
important?
35. Describe the purpose of the prototype property in JavaScript. How is it used in object-oriented
programming?
36. How do you clone an object in JavaScript? Provide examples of different techniques.
37. Explain the concept of event bubbling and event capturing in JavaScript. How do they differ?
38. What is the purpose of the bind(), call(), and apply() methods in JavaScript? How do they differ?
39. Describe the difference between null, undefined, and undeclared in JavaScript.
40. How do you convert a string to a number in JavaScript? Provide examples of the parseInt() and
parseFloat() functions.
41. Explain the concept of asynchronous programming in JavaScript. How do you handle
asynchronous operations using callbacks, promises, and async/await?
42. Describe the purpose of the spread operator (...) in JavaScript. How is it used with arrays and
objects?
43. How do you handle errors in JavaScript asynchronous code? Provide examples of error handling
techniques.
44. Describe the purpose of the localStorage and sessionStorage objects in JavaScript. How do they
differ from cookies?
45. What are arrow functions in JavaScript? How do they differ from regular functions, and when
would you use them?
46. Explain the concept of strict mode in JavaScript. How is it enabled, and what benefits does it
offer?
47. How do you check if an object contains a specific property in JavaScript? Provide examples of
different approaches.
48. Describe the purpose of the Array.isArray() method in JavaScript. How is it used to check if a
value is an array?
49. What are higher-order functions in JavaScript? Provide examples of higher-order functions and
their usage.
50. How do you handle browser compatibility issues in JavaScript code? What are some common
techniques?

REACTJS

1. What is ReactJS, and what are its main features?


2. Explain the difference between functional components and class components in React.
3. Describe the purpose of JSX in React. How does it differ from regular JavaScript syntax?
4. What is the Virtual DOM in React, and why is it important?
5. How do you create a new React application using Create React App (CRA)?
6. Explain the concept of state in React. How do you initialize and update state in a component?
7. Describe the difference between props and state in React. When would you use each one?
8. How do you pass data from a parent component to a child component in React?
9. What are React hooks? Provide examples of built-in hooks and their usage.
10. Explain the purpose of useEffect hook in React. How do you use it to perform side effects in
functional components?
11. Describe the component lifecycle methods in React class components. How do they differ from
hooks?
12. How do you handle forms in React? Provide examples of controlled and uncontrolled
components.
13. Explain the purpose of conditional rendering in React. Provide examples of conditional rendering
techniques.
14. What are keys in React? Why are they important when rendering lists of elements?
15. How do you handle events in React? Provide examples of event handling in class and functional
components.
16. What is React Router? How do you use it to implement routing in a React application?
17. Describe the purpose of context in React. How do you use context to share data between
components?
18. How do you handle CSS in React? Describe different methods for styling React components.
19. What are higher-order components (HOCs) in React? How do you use them?
20. Explain the concept of composition in React. How does it enable reusability and maintainability
of components?
21. How do you handle state management in larger React applications? Describe different state
management solutions like Redux and Context API.
22. What are the advantages of using React over other front-end libraries/frameworks?
23. Describe the purpose of error boundaries in React. How do you use them to handle errors
gracefully?
24. How do you optimize performance in React applications? Provide examples of performance
optimization techniques.
25. What are React fragments? How do you use them to avoid unnecessary wrapper elements in the
DOM?
26. What is the purpose of the useState hook in React? How do you use it to manage state in
functional components?
27. Describe the concept of component composition in React. How do you compose smaller
components to build larger ones?
28. What is prop drilling in React? How do you mitigate prop drilling in larger component trees?
29. Explain the difference between class components and functional components with hooks in
terms of lifecycle methods and state management.
30. What are React keys, and why are they important when rendering lists of components?
31. Describe the purpose of the useEffect hook in React. How do you use it to perform side effects in
functional components?
32. How do you handle form validation in React? Provide examples of how you can validate user
input.
33. What is the purpose of the useContext hook in React? How do you use it to consume context in
functional components?
34. Explain the concept of lazy loading in React. How do you implement lazy loading for
components?
35. Describe the purpose of React portals. Provide examples of scenarios where portals are useful.
36. How do you handle routing in React applications? Explain the difference between client-side
routing and server-side routing.
37. What are controlled components in React? How do you use them to manage form state?
38. Explain the concept of higher-order components (HOCs) in React. Provide examples of how you
can use HOCs to enhance component functionality.
39. Describe the purpose of the memo function in React. How do you use it to optimize functional
components?
40. How do you manage side effects in React components? Provide examples of scenarios where
you might use useEffect hook.
41. What are React hooks rules? Explain the rules of using hooks in functional components.
42. Describe the purpose of the useReducer hook in React. How do you use it to manage complex
state logic?
43. Explain the concept of code splitting in React. How do you implement code splitting for better
performance?
44. What are the differences between React functional components and class components in terms
of syntax and features?
45. Describe the concept of server-side rendering (SSR) in React. What are the benefits of SSR?
46. What is the purpose of the forwardRef function in React? How do you use it to forward refs to
child components?
47. How do you handle authentication and authorization in React applications? Provide examples of
authentication flows.
48. Explain the concept of hooks in React. How do hooks change the way you write components?
49. Describe the purpose of the useCallback hook in React. How do you use it to optimize
performance?
50. What are the differences between React and React Native? How do you decide when to use one
over the other?

You might also like