1. What are the key responsibilities of Web Developers?
It is generally expected that web developers will be able to perform the following tasks:
Build products using HTML, CSS, JavaScript, PHP (Hypertext Preprocessor), and other relevant coding languages.
Design, develop, test, debug, and deploy applications in a cross-platform, cross-browser environment.
Coordination with designers and programmers for the development of projects.
Develop design specifications/patterns for optimizing web programs.
Identifying and fixing bugs, troubleshooting, and resolving website issues.
Taking care of the technical aspects of the site, such as its cache and performance (which indicate how fast a site will run and how much traffic it can handle).
Providing support and assistance with web management best practices.
Keep up with the latest technology.
Maintain and update websites to meet modern web standards.
Monitor web traffic.
2. List the advantages of HTTP/2 over HTTP 1.1.
Hypertext Transfer Protocol (HTTP) is a set of standard protocols allowing internet users to exchange website knowledge on WWW (World Wide Web). HTTP has gone through four iterations since it was introduced in 1991 i.e., HTTP/0.9, HTTP/1.0, HTTP/1.1, and HTTP/2.0. In 2015, HTTP/2 was released as a major revision to HTTP/1.1. HTTP/2.0 has the following advantages over HTTP/1.1:
Increased performance: It was designed specifically to speed up page loading and reduce round-trip time (RTT) for resource-intensive websites.
Handle multiple resources: With HTTP 1.1, the web pages were manageable simply by using HTML markups and images. But with HTTP 2.0, there are now multiple resources available for web pages, including images, fonts, scripts, and more. HTTP 1.1 was not designed to handle such a large amount of resources today.
Multiplexing: Multiplexing is fully implemented in HTTP/2. It means that multiple requests are sent between browsers and servers simultaneously over a single TCP connection. Consequently, several elements of a web page can be delivered via a single TCP connection. As a result, the HTTP/1.1 head-of-line blocking problem is resolved, in which a packet at the front of the line blocks the transmission of other packets.
Header Compression: HTTP 2.0 has the ability to compress HTTP headers to reduce overhead. When HTML headers on web pages are compressed, they can be sent between the browser and server in one trip, over a single TCP connection.
Server push: HTTP/2 servers are able to push resources into a browser's cache even before they are requested. By doing this, browsers can display content without requiring additional requests.
Binary protocols: HTTP/2 use binary protocols, not textual. HTML/2's binary protocols consume less bandwidth, can be parsed more efficiently, and are less error-prone compared to HTTP/1.1's textual protocols.
3. Explain CORS (Cross-Origin Resource Sharing) and Write its Importance.
CORS stands for Cross-origin resource sharing. It is basically defined as a browser mechanism that enables web pages from one domain to have controlled access to resources that are located at different domains (cross-domain request). In other words, it allows scripts running on a browser client to interact with and access resources from other origins. It provides and extends flexibility to the SOP (Same-Origin Policy). A same-origin policy restricts a website's ability to access resources outside its source domain. For example, if a JavaScript app wanted to call an API (Application Programming Interface) running on another domain, it would be blocked and prevented from doing so because of the SOP. Due to restrictions caused by the same-origin policy, CORS was introduced.
When a website's CORS policy is set up poorly, it also poses the risk of cross-domain attacks. As such, it cannot prevent cross-origin attacks such as CSRF (Cross-Site Request Forgery).
4. What do you mean by ETag (Entity Tag) and how does it work?
The ETag (entity tag) is a part of the HTTP protocol. This is one of several mechanisms that HTTP provides to validate Web caches, which allows conditional requests to be made from a browser to resources. Moreover, Etags make sure that simultaneous updates of the same resource don't overwrite each other (mid-air collisions).
ETags are opaque identifiers assigned by a server to a specific version of a resource found at a specific URL. Every time the resource representation at that URL changes, an entirely new ETag is assigned. As such, ETags can be compared in the same way as fingerprints and determine if two representations of a resource are identical.
Syntax:
ETag: W/"<etag_value>"
ETag: "<etag_value>"
5. Explain Webpack.
Webpack is a tool that bundles JavaScript modules, also known as static module bundlers. Modules are reusable chunks of code that are built from the JavaScript, node_modules, images, and CSS styles of your application, and packaged so that they can be easily added to your website. If you have a large number of files, Webpack generates a single (or a few) file that runs your application.
When Webpack processes your application or package, it generates a dependency graph, which consists of various modules that your webapp needs in order to function as expected. Based on this graph, it then creates a new package that contains only the bare minimum files required, often only one or a few bundle.js files which can be easily plugged into the HTML file and used in the application.
6. List out newly introduced input types, APIs, form elements, and elements that support media content in HTML5.
List out newly introduced input types, APIs, form elements, and elements that support media content in HTML5.
HTML5 has been updated repeatedly in the last few years, and the addition of input types has greatly simplified its use. Among some of these input types are
Colour: Enable users to select or choose a colour using the colour picker.
Date: Enable users to select or choose a date from a drop-down calendar.
Datetime-local: Enable users to select or choose both local date and time.
Email: Enable users to enter an email address.
Month: Enable users to select or choose a month and year from a drop-down calendar.
Week: Enable users to select or choose week and year from a drop-down calendar.
HTML5 introduces the following new form elements:
: Specifies a list of options for input controls.
: Creates an encryption key.
: Defines the result or output of an expression.
: Heads in the direction of 100% of the maximum value.
: Provides a gauge that shows a general value within a range.
The following are some of the new APIs introduced in HTML5:
History API: Provides programs with access to the browser's history.
Page visibility API: Enables us to determine the current visibility state of a page.
Battery Status API: Displays the current battery status of the device.
User Timing API: Provides programmers with high-precision timestamps for measuring application performance.
Vibration API: Provides access to the device's vibration functionality.
HTML5 includes five elements that support media as follows: