Web Development Interview Question Answer

What is static website?

A static website is the most basic type of website and contains web pages with fixed content. Each page is coded in HTML and displays the same information to every user. Examples of static web page include about us page with a corporate website, mission, vision etc.


What is a dynamic website?

A dynamic website is more functional. It allows users to interact with the information that is listed on the page. Of course, that requires utilizing more than just HTML code.


How can you submit a form without a submit button?

You can use JavaScript submit() function to submit the form without explicitly clicking any submit button.


How can you reduce page loading time?

There are many factors effect website loading spped. Here some of methods or ways to reduce website's loading time :

  • Choose a performance-optimized hosting solution
  • Compress or reduce your images size
  • Reduce your redirects
  • Cache your web pages
  • Minify HTML, CSS, and Javascript
  • Create Accelerated Mobile Pages ( AMPs)
  • Remove unnecessary widgets and plug-in
  • Use asynchronous and defer loading for your CSS and JavaScript files.
  • Enable browser caching.

)

What is CORS?

Cross-Origin Resource Sharing (CORS) is a mechanism that enables different resources on a web page to be requested from another domain outside the domain from which the request originated.


What are the advantages of HTTP 2.0 over HTTP 1.1?

  • Higher loading speed
  • Improvement of web positioning
  • Automatic prioritization
  • Less broadband consumption
  • Immediate presentation

Which are the new APIs provided by HTML5?

Here is list of some API provided by HTML5 :

  • Media API
  • Text track API
  • Application cache API
  • Data transfer API
  • User interaction API
  • Command API
  • Constraint validation API
  • History API

What is the difference between null value and undefined value?

Undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value.


What are the different types of pop-up boxes available in JavaScript? Explain them.

There are three main types of pop-up boxes:

  • Alert – it just displays a message with an OK button.
  • Confirm – it pops up a confirmation message window with the OK and Cancel button.
  • Prompt – it pops up a dialog box asking the user input followed confirmation buttons.

What is scope in JavaScript? Name the different types of Scopes.

The scope defines the accessibility of the functions and variables in an application. There are two types of scopes: local and global.


)

How is HTML different from XHTML?

HTML and XHTML are both known for writing web pages. But, HTML is extended from SGML tagging whereas XHTML is an application of Extensible Markup Language (XML).

HTML has three components – element tag pair (start tag and end tag), attributes of the element within the tag, and content in the form of both text and graphics. Whereas XHTML includes only a single root element which includes lower case elements and the value that is assigned should be closed, nested, and must be surrounded by quotation marks. Looking at the difference, XHTML is more expressive when compared to HTML.


What is npm?

NPM stands for Node Package Manager. It is a package manager for JavaScript. npm puts modules in place so that node can find them. npm also manages dependency conflicts. It is used to publish, discover, install, and develop node programs.


What is Webpack?

Webpack is an open-source JavaScript module bundler. It is made primarily for JavaScript, but it can transform front-end assets such as HTML, CSS, and images if the corresponding loaders are included. Webpack takes modules with dependencies and generates static assets representing those modules.


What is DOM (Document Object Model)?

The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree.


What is the difference between responsive design and adaptive design?

responsive is fluid and adapts to the size of the screen no matter what the target device. Responsive uses CSS media queries to change styles based on the target device such as display type, width, height, etc., and only one of these is necessary for the site to adapt to different screens.

Adaptive design, on the other hand, uses static layouts based on breakpoints that don’t respond once they’re initially loaded.


)

Explain the functional and non-functional requirements?

Functional requirements define the specific functionality of the system, It describes what the system does or must not do.

Non-functional requirements, on the other hand, define how the system should do it. It specifies a system’s type, in terms of accessibility, reliability, capacity, usability, maintainability, and security. Non-functional requirements describe system behavior, features, and general characteristics that affect the user experience.


What are CSS selectors?

CSS selectors are used to select the HTML elements you want to style. Here is main types of CSS selectors :

  1. Element Selector
  2. Id Selector
  3. Class Selector
  4. Universal Selector
  5. Attribute selectors
  6. Pseudo-Classes
  7. Pseudo-Elements
  8. Combinator

Explain what is long polling?

Long polling is a web application development pattern used to emulate pushing data from the server to the client. When the long polling is used, the client sends a request to the server, and the connection remains intact until the server is ready to send data to the client. The connection will be closed only after the data is sent back to the client or connection timeout occurs.


Mention what is the correct way to include JavaScript into your HTML?

he correct way to include JavaScript into your HTML is by using inline event handlers or inline code.


In HTML which tag can be used for a multi-line text input control?

For Multiple line input we can use textarea tag.


How XHTML is different from HTML?

Here is list of some differance between XHTML and HTML :

  • XHTML requires that all tags should be in lowercase
  • XHTML requires that all tags should be closed properly
  • XHTML requires that all attributes are enclosed in double quotes
  • XHTML forbids inline elements from containing block level elements

)

How is type conversion handled in JavaScript?

JavaScript supports automatic type conversion. Since it is weakly typed, you can pass a function as an argument into another function easily.

This ensures that there are no errors or data type-associated warnings as values get converted to the required data type automatically.


What is the use of the ‘defer’ attribute in JavaScript?

The attribute is used as a boolean type attribute. It is used to delay the execution of the JavaScript code on a web page until the parser completely loads and initializes the page.


What is the result if a jQuery Event Handler returns false?

If the jQuery Event Handler returns a boolean false value, it simply means that the event will not execute further and will halt the execution for the particular action it is associated with.


What is pair programming?

Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently.