100% found this document useful (1 vote)
325 views

Web Developer Interview Questions Answers

This document contains interview questions and answers for a web developer position. It includes common questions about the responsibilities of a web developer, technologies like HTML, CSS, JavaScript, skills and experience required for the role, and how to optimize websites for speed and user experience. Contact details are provided at the bottom for N Software Development House Private Limited.
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
100% found this document useful (1 vote)
325 views

Web Developer Interview Questions Answers

This document contains interview questions and answers for a web developer position. It includes common questions about the responsibilities of a web developer, technologies like HTML, CSS, JavaScript, skills and experience required for the role, and how to optimize websites for speed and user experience. Contact details are provided at the bottom for N Software Development House Private Limited.
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
You are on page 1/ 27

N Software Development House Private Limited

Web Developer Interview Questions


Answers

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Why should you be hired for this role answer for web developer?

You should hire me for this position because of my proven ability to build
efficient front-end user interfaces in line with modern best practices. I am experienced
in using JavaScript, as well as the React framework, to develop front-end applications.
... I would love the opportunity to use my skills for this position.

Why should I hire you for Web development?

Required skills: Excellent interpersonal skill, analytical skill, and problem solving skill.
Profitably, good in team work, sharing ideas, and interacting with customers and clients.
Technically sound and should have excellent computer knowledge.

What are the responsibilities of a web developer?

“A web developer responsibilities are designs, develops, enhances, tests and deploys
web applications with an end goal of creating engaging and user-friendly site layout and
function.

A developer gathers and defines requirements, maintains websites, troubleshoots and


fixes bugs, follows best practices and collaborates with other teams.”

What sparked your interest / Enthusiasm / Motivation / Experience in


web development?
“As a previous marketing coordinator, I frequently used an online tool to create and
customize email campaigns. I found the drag-and-drop feature buggy and discovered
that I could achieve the look I was going for if I edited the HTML instead.

I became fascinated the ability a web developer has to be imaginative, artistic and
technical, while developing a product that benefits and inspires others.”

What is W3C and why is it important?

“W3C stands for World Wide Consortium and it is an international community that
focuses on developing and standardizing the web.

Explain how you optimize and reduce web application load time. (Page load time)

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

“Although there are numerous techniques a web developer can use in reducing load
time, I always rely on optimizing images, enabling browser caching and minimizing
HTTP requests.

My go-to tool for evaluating site speed is Google Page Speed Insights. In one instance,
I successfully reduced page load time from 2.1 seconds to .7 seconds by soley enabling
browser caching.”

What are the differences of using HTTP/2 as opposed to HTTP 1.1?

“HTTP/2 was designed to improve web application performance. A web developer can
appreciate how it makes applications simpler and faster by reducing load times and
improving communication between browsers and servers.

I’m a strong advocate for using HTTP/2, as I’ve analyzed data and seen how HTTP/2
can decrease page load time by up to 20%.”

The major advantages of HTTP 2.0 over HTTP 1.1 include –

 Higher loading speed


 Improvement of web positioning
 Automatic prioritization
 Less broadband consumption
 Immediate presentation

In what programming languages are you proficient? (candidate’s experience, preferences, strengths and

weaknesses )

“I’m proficient in HTML, CSS and PHP, and I have beginner-level proficiency in SQL
and JavaScript. I would love to expand my web developer skills to include Python and
am currently researching the right Python course to take in my free time.”

What steps do you take to balance demanding client requirements?


(Communication skills)

“Keeping a client pleased is a high priority, although I am not interested in producing


buggy code and taking ineffective shortcuts to damage the final product. I keep the
client informed of my progress and work efficiently to complete the task.”

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

How well do you handle constructive criticism about your web development
projects? Can you give me an example?

"Through my years of experience as a web developer, I've learned how important


constructive criticism is in order to deliver products that meet a client's vision.

When I was in an entry-level developer role, I worked on a web application project for
an online store. I was really proud of my work and felt I'd done everything I could to
meet the original client criteria.

After two rounds of corrections, I realized that constructive feedback is a way for clients
to refine their needs. Receiving constructive feedback also helped me hone my skills
and learn more about the client to maximize future projects."

What is a pseudo-class?

It is a CSS technique that sets the style when an element changes its state. E.g. style
changes when mouse hover, different styles for visited or unvisited links, etc.

There are four different types of pseudo-classes:

 Links: These pseudo-classes are used to style the link both in its normal state by
default and when it has already been visited
 Dynamic: Dynamic pseudo-classes can be applied to any element to define how
they are shown when the cursor is located on them, or by clicking on them or
when they are selected
 Structural: Structural pseudo-classes allow to style elements based on an exact
numerical position of the element
 Others: Some elements can be styled differently based on the language or what
type of label they are not.

Q. What is Namespacing in JavaScript?

It is usually not a good practice to use global variables in programming languages


including JavaScript. However, you may have to use global variables sometimes. So,
JavaScript introduces the concept of namespacing which ties down a part of the code
and registers it with a unique name.

The namespace is nothing more than a container name where we hold classes,
functions, and variables that can be repeated with the same name in other namespaces
or namespace without involving an error.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. How can you reduce page loading time?

These are the following ways you can reduce web page loading time –

 Reduce the image size


 Use the latest generation formats for images
 Minify HTML, CSS, and Javascript
 Postpone uploading off-screen images
 Create Accelerated Mobile Pages ( AMPs)
 Remove unnecessary widgets
 Avoid multiple redirects
 Place CSS at the top and script referencing at the bottom or external files
 Reduce lookups
 Minimize redirects and caching
 Check the current speed of the website
 Finding a good hosting to host your website
 Clean the web code

Q. 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.

Q. How do you take into account SEO, maintainability, UX, performance, and
security when you’re building a web application?

If your organization handles vital data, then security will be your top priority. If it is a
medium-sized online business, SEO and UX might be your top priority, and so on.

Q. What are the new form elements introduced in HTML5?

The new form elements introduced in HTML5 are:

 <datalist> – specifies a list of options for input controls


 <keygen> – generates an encryption key
 <output> – defines the result of an expression
 <progress> – heads only in the direction of 100% of the max value
 <meter> – provides for a gauge, displaying a general value within a range

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What’s the best way to integrate 5 different stylesheets into a website?

 It usually depends on how the site is laid out. However, the most efficient way
would be using just one file called styles.css (or similar). If you want to change
the style, you just open up styles.css, scroll to find the relevant section, and
modify the CSS. You can link the sheet in your HTML as –

 <link rel=”stylesheet” href=”styles.css”>

Q9. What’s the difference between Canvas and SVG?

Canvas is an HTML5 element that can draw graphics on the fly with the help of
JavaScript. SVG (Scalable Vector Graphics) is used to display vector-based graphics
on the web. The major differences are –

Canvas SVG

Pixel-based (dynamic .png) Based form

Single HTML element. Multiple graphic elements, which


become part of the DOM
(Inspect the element in the Developer Tool.
You can see only the canvas tag)

Modified via script only Modified via script and CSS

The interaction between the event model and The interaction between the event
the user is granular (x, y) model and the user is summarized
(rect, path)

Performance is better with a smaller Performance is better with a smaller


footprint, a larger number of objects (> 10k), number of objects (<10k), a larger
or both surface, or both

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What is the default border size of a Canvas?

There is no default border size of a Canvas. We can adjust using CSS.

Q. What is the difference between IDs and Classes?

ID’s Class

They are unique They are not unique

Each element can have only one ID You can use the same class on multiple
elements.

Each page can have only one element with that ID You can use multiple classes on the same
element

Find and modify the style to any single element Find and modify the style to any number of
elements

Q. What is your preferred development environment?

if you are flexible to work in any environment. So, give them a hint that you are able to
adapt to any environment with the core skills that you have.

Q. Which are the new APIs provided by HTML5?

The new APIs are – API is the acronym for Application Programming Interface, which
is a software intermediary that allows two applications to talk to each other.

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

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What are your key responsibilities in your current organization?

 You can talk about your current job role in a reply to this question. usually, the
most common job responsibilities of a web developer include –
 To write well designed, testable, efficient code by using best software
development practices
 To create website layout/user interface by using standard HTML/CSS practices
 To integrate data from various back-end services and databases
 To gather and refine specifications and requirements based on client’s
requirements
 To create and maintain software documentation
 To maintain, expand, and scale the websites
 To stay plugged into emerging technologies/industry trends, and apply them to
operations and activities
 To meet with clients or management to discuss the needs and design of a
website
 To cooperate with web designers to match visual design intent
 To create and test applications for a website
 To write code for the website, using programming languages such as HTML or
XML
 To integrate graphics, audio, and video into the website

Q. 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.

Q. What are the web technologies that you are proficient in?

As already mentioned, you must have expert skills in three technologies: HTML5,
CSS3, and JavaScript. Apart from that, you should be able to have at least some
working knowledge of some of the other technologies like popular frameworks, APIs,
and database management.

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

There are three 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.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. 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.

Q. What is the difference between ‘==’ and ‘===’ operators?

Though both of them belong to the comparison operator category, the ‘==’ operator
checks the value whereas, the ‘===’ operator checks both the value and the type.

Q. By which mechanism in JavaScript can you detect the operating system on a


client machine?

The operating system on a client system can be known by using the JavaScript property
navigator.appVersion.

Q. Which one do you use the most, CSS Animations or JavaScript Animations?

Both. CSS animation and JavaScript animation are the two primary ways of creating
web animations. As per the project requirement and the kind of the desired effect, I
have used both of them.

Cases when CSS animations work well:

 When the transitions are simple. For example, toggling within the element states.
 When the UI elements are self-contained. Like in showing a tooltip.

Cases when JavaScript animations work well:

 When advanced animation effects are expected in the project, like bouncing, stop pause,
etc.
 When a superior level of control is required, JS animation works well.
 Helpful when drawing in HTML canvas.

Q. Have you used Git for pushing live changes on the website?

Yes, Git is a great help to streamline live updates on the website. For this, I made use of
a post-receive hook. Through this, I was able to copy updates from the remote server
repo and update them onto the live site.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. Which web development tools do you use?

There are several web development tools available and being into the role of a web
developer, I have used multiple of them like:

 GitHub to work together with a team on a particular project.


 CodeKit to minify, combine, and syntax-check in JavaScript.
 JS to structure the web application and even develop a one-page application.
 CodePen to deploy a website and build test cases.
 Grunt for automating repetitive tasks.

Q. As a web developer, how do you optimize your site’s loading time?

As a developer, I will optimize the site by –

 Implementing caching
 Minifying CSS, HTML, and JavaScript codes

Q. How is HTML different from XHTML?

Ans. 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.

Q. Have you gone through our website? Please mention what you didn’t like about the
site?

Now, this is a tricky question and here the interviewer is checking your skills to identify
what is good as per you and as a developer how in-depth knowledge do you have about
the site’s functionality. So, the first thing is that you must visit their website before
appearing for the interview as this will show your interviewer that you are serious about
the role and at the same time you are well-prepared.

Next, you need to do is observe some good points about the site from a developer’s
point of view and also make a checklist of pitfalls. Note, please mention only genuine
points where your expertise can be of help.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. How do you handle a client who is unhappy with your team’s web delivery?

For every company, the client is the king and no one wants to lose his or her clients at
any cost. Therefore, when appearing for a web developer interview round, you must be
well prepared as the recruiter can shoot this question.

You can start by narrating any previous incident that is related to client handling. Define
the issues the client was facing, and later narrate the solutions, which you or your team
had performed to help the client. This will let the recruiter know that you have the
capability to handle and nurture clients.

Q. What do you know about HTTP/3?

HTTP/3 is the new third-generation HTTP standard that was recently made available in
late 2019. It is known for its new standards, fast, reliable, and secure connection.
HTTP/3 promises a faster web experience as it uses QUIC. This new internet transport
protocol introduces first-class citizens. Brands like Google and Facebook are now using
QUIC because of its swift ability to speed up the web.

Q. What will you do when an image or a hyperlink is not displaying correctly?

Ans. Many times it happens that some images are not properly displayed on the page
and that severely affects the SEO and if happens multiple times, it hampers the overall
rankings. So, I keep on checking things like missing href and alt tags.

Q. Do you have any experience in developing multilingual websites?

It is not necessary that you hold experience in developing multilingual sites but you
must know the basics of how it is done. You can tell the recruiter the process that
involves Unicode encoding and usage of the ‘lang’ attribute.

Q: What are the different HTTP request types supported in Restful Web Services?
Can you explain the purpose of each?

Restful web services supported HTTP request types are GET, POST, PUT, and
DELETE.

The purpose of each of the HTTP request types in Restful web service is:

1. GET
Also known as the idempotent method, GET retrieves data from the server.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

2. POST
POST is used for creating a new entity i.e. a resource without an ID. On the creation of
a request, the ID of the newly created entity is returned as part of the response to this
HTTP request. It is often used while uploading a file or submitting a completed web
form.
3. PUT
It is used to update an existing entity.
4. DELETE
It is used for removing the resource from the server.

Q. What is Type Coercion in JavaScript?

Type coercion refers to the conversion of a value from one type to another (e.g Number
to String, String to Number, or Boolean to Number) with similar content. In case the
behavior of the implicit conversion is not sure, then the constructors of a data type can
be used to convert any value to that datatype.

Q. What is an ETag and how does it work?

An entity-tag or an ETag is an HTTP header that is used for web cache validation and
conditional requests from browsers for resources. It is allocated by a web server to a
specific version of a resource found at a URL. When the server reads the ETag from
the client request, the server can then tell whether to send the file or tell the client just to
use their local copy.

Q34. What is npm? [Node.js]

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.

Q. What is Webpack?

Webpack is a static module bundler for JavaScript. It is a build tool that is used is to
bundle JavaScript files for usage in a browser. It puts the bundles of assets, such as
codes, images, fonts, and files in a dependency graph, and enables you to use require()
in your source code to point to local files, like images, and decide how they’re
processed in the final Javascript bundle.

While a webpack may slow you down at the beginning, it can give you great speed
benefits when used correctly.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What is DOM (Document Object Model)? [CSS]

The Document Object Model (DOM) is a cross-platform programming interface that


represents HTML and XML documents as nodes and objects. In simple terms, it defines
the logical structure of documents and the way the documents are accessed and
manipulated. DOM enables programmers to create, modify, and delete the document
structure, style, and content.

When a document is displayed on a browser, the content of the document must be


combined with its style information. The browser converts HTML and CSS into the
DOM. The DOM combines the document’s content with its style.

Q. What is Cross-site Scripting (XSS)?

Cross-site scripting (XSS) is a security exploit that enables an attacker to introduce


malicious client-side code into a website. When the untrusted links are unintentionally
clicked by the victims, the cookies information is passed to the attackers so that they
can bypass access controls.

Q. What is the difference between responsive design and adaptive design?

The responsive design follows the principle of flexibility. It adapts to the size of the
screen and offers the optimal viewing experience of a website regardless of what type
of device is used to see it. Responsive websites use CSS media queries and flexible
grids to change styles based on different factors related to the device, such as display
type, width, and height.

Adaptive design uses static designs instead of flexible layouts. Its design is based on
breakpoints that do not respond once they are initially loaded. It detects the type of
device used and its other features, then provides the feature and layout based on a
predefined set of characteristics.

Similarity: Both responsive and adaptive designs optimize the user experience across
different target devices. Both adjust for different viewport sizes, resolutions, and control
mechanisms.

Q: What is progressive rendering in HTML?

Progressive Rendering or Progressive Server Side Rendering is a technique with which


you can sequentially update small parts of the entire webpage and stream it to the client
in parts without waiting for the whole page to be rendered.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

It means that when you start rendering the critical content on the server, you can stream
it to the client without waiting for non-critical content to be rendered. It bridges the
benefits of both CSR (Client Side Rendering) and SSR (Server Side Rendering).

Q. Explain the functional and non-functional requirements?

Ans. 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.

Non-functional requirements do not affect the basic functionality of the system. The
system will continue to perform its basic purpose, even if the non-functional
requirements are not met.

Q. What is the difference between span and div tag in HTML5?

The following are the differences between <Div> tag and <Span> tag.

<DIV> tag <SPAN> tag

It is a block-level element. The <span> tag is an inline element.

It is usually used / attached to wrap a This tag is typically used to wrap any specific word (a
section that you want to highlight on the small section of a line) that you want to highlight on
webpage. the webpage.

This tag accepts the align attribute. <span> tag does not accept the align attribute.

Q. What are CSS selectors? Name some.

CSS selectors are a part of a CSS ruleset. With CSS selectors, you can “find” HTML
elements you want to style. They select HTML elements according to their id, class,
type, attribute, etc.

There are several different types of selectors in CSS.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

 Element Selector
 Id Selector
 Class Selector
 Universal Selector
 Attribute selectors
 Pseudo-Classes
 Pseudo-Elements
 Combinator

Q. Explain quirks, full standards, and almost standards mode.

Quirks, full standards, and almost standards mode are the three modes for layout
engines in web browsers.

In quirks mode, the layout emulates nonstandard behavior in Navigator 4, Internet


Explorer 5. This is typically used for the websites that were built before the introduction
of web standards.

In full standards mode, the behavior is described by the HTML and CSS specifications.
Most of modern browsers use this mode.

In almost standards mode, there is only a small number of quirks implementation.

Q. What is HTML5 Web Storage?

HTML5 web storage enables your web applications to store data locally within the
user’s browser. The data is stored in name/value pairs, and a web page can only
access data stored by itself.

In simple terms, web storage allows large amounts of application data to be stored
locally. It does not affect the performance of your web application.

There are two types of web storage to store data locally:

 Local storage: This stores data with no expiration date. The data once stored in
the local storage will be present even when the user’s browser is closed and
reopened.
 Session storage: It stores data for one session only. The data will be deleted
from the browser once the user’s browser is closed and the session would be
lost.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What is the difference between ES5 and ES6?

Ans. ES5 is an abbreviation of ECMAScript 5 while ES6 is an abbreviation of


ECMAScript 6. ECMA is a trademarked scripting language specification defined by
ECMA International. The difference between ES5 and ES6 are:

ES5 ES6

It is the fifth edition of the ECMAScript. ES6 is the sixth edition of the ECMAScript.

ES5 was introduced in 2009. ES6 was introduced in 2015.

It supports primitive data types – string, In ES6, there are some additions to JavaScript data
number, boolean, null, and undefined. types, such as a new primitive data type ‘symbol’ for
supporting unique values.

In ES5, you can define the variables In ES6, you can define variables in two ways-
only by using the var keyword. let and const.

Both function and return keywords An arrow function is a new feature of ES6 due to which
define a function. you won’t require the function keyword to define the
function.

It has a lower performance than ES6. It has some new features compared to ES5. Thus, it
has a higher performance than ES5.

Q. What is long polling?

Long polling is a technique of having a persistent connection with the server. In long
polling, the client polls the server requesting new information. The server holds a client’s
connection open for as long as possible. The connection is closed only after the data is
sent back to the client or connection timeout occurs.

Long Polling Flow:

 A request is sent to the server.


 The server holds a client’s connection until new data is available.
 The server responds to the request when the new information appears.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

 The browser immediately sends another request.

Q. What is DTD (Document Type Declaration)? What are its advantages?

 DTD (Document Type Declaration) defines the structure of an XML document,


i.e. what elements and attributes are permitted. It can be declared inside an XML
document (inline) or as an external reference.
 Internal DTD Declaration: When a DTD is declared within the file
 External DTD Declaration: When a DTD is declared in a separate file.
 The advantages of DTD are:
 It provides validating parsers with a map of how to validate the XML document.
 It enables you to define your own format for the XML files enabling users and
developers to understand the structure of the data.

Q. Explain what is the difference between local storage and cookies?

The differences between local storage and cookies are:

Local Storage Cookies


 Local Storage is for the client-  These for the client as well as the server side.
side.
 It is larger and can hold  They are smaller and send data to the server-
information on the client-side. side with every HTTP request

 Storage capacity is 5MB per  Storage capacity is 4095 bytes/cookie.


domain.
 It does not have an expiration  They have expiration. Cookie data get deleted
and has to be removed manually. after some time. You can set the expiration
duration.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What are CSS transitions? What are their properties?

Transitions in CSS3 enable the element to smoothly and gradually change from one
state to another. They are easy to use and provide efficient animation effects. Two main
properties that are required in transition:

1. transition-property
2. transition-duration
3. transition-timing-function
4. transition-delay

Q. How to handle type conversion in JavaScript?

JavaScript is a weakly typed language. It means that whenever an operator or


statement expects a particular data-type, JavaScript automatically converts the data to
that type. Javascript supports automatic type conversion. It is the common way of
conversion of types used by JavaScript developers.

Q. Explain the use of media queries in CSS3?

Media queries are used to define styles in CSS. They enable you to format the
documents so that they can be presented correctly on different sizes of output devices
like desktops, smartphones, and tablets.

Media queries are used for the following:

 Orientation: Landscape or Portrait


 Hide Elements
 Change Font Size
 Adjust Height and Width
 Adjust Resolution

Q. What is the use of float property in CSS?

Ans. Float is a popular property in CSS to control the layout and position of an element
on a web page.

CSS Syntax

float: none|left|right|initial|inherit;

Float Property Values

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Float Value Description

none This is the default. The element will not float.

left The element floats to the left of its containing block.

right The element floats to the right

inherit Inherits this property from its parent element.

initial Sets this property to its default value.

Inline-end The element floats on the end side of its containing block.

Q. Explain the difference between <window.onload> and


<onDocumentReady>?

Ans. Both <window.onload> and <onDocumentReady> functions are used to perform


tasks when the page is loaded in the browser. The following are the differences
between them:

<window.onload> <onDocumentReady>

The code in <window.onload> is executed It will execute the code when the DOM tree has
when the DOM tree is ready. All the external been built. It will not wait for other resources
resources like images and videos are loaded. like images and videos to load.

Loading of the external resources delays the <onDocumentReady> reduces any delays in
execution of the actual script when the page actions.
gets displayed.

It is not cross-browser compatible while using It is compatible with all browsers.


something like jQuery.

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What is the use of .each() function in jQuery?

The .each() method is used to iterate over a set of elements in jQuery. It specifies a
function to run for each matched element and allows us to loop through different
datasets such as arrays or objects. To return the loop early, we can return false from
the callback function.

Syntax:

$(selector).each(function(index,element))

The .each() accepts a parameter function(index,element), which is the callback function


that executes for each selected element. This function requires two parameters
(optional), namely, index and element. A callback function needs to be passed to the
.each() method.

Q. What is the content delivery network (CDN) in jQuery? What are its benefits?

A Content Delivery Network (CDN) is an interconnected system of computers that exist


all over the world and cache files for users to access. It provides web content quickly to
users by duplicating or caching the content on multiple servers and directing the content
to users in proximity. A CDN offers many advantages. Some of them are:

1. Faster content delivery.


2. Significantly reduces the load time of a page.
3. Lower network latency and packet loss.
4. Provides higher savings in the bandwidth.
5. Reduces bandwidth consumption.
6. Segmenting the audience becomes easy.
7. Offer better usage analytics.
8. Offer secure storage capacity for content.

Q. What are the different types of CDNs supported in jQuery?

9. Ans. The two most popular CDNs supported in jQuery are:


10. 1. Google:
11. It is used to jQuery from the Google libraries API
12. Code to load jQuery Framework from Google CDN
13. Copy Code<script type=”text/javascript”
src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”>
14. </script>
15.
16. 2. Microsoft:

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

17. It is used to load from jQuery AJAX CDN


18. Code to load jQuery Framework from Microsoft CDN
19. Copy Code<script type=”text/javascript”
20. src=”http://ajax.microsoft.com/ajax/jquery/jquery-1.9.1.min.js”>
21. </script>

Q. What is the use of comments in JavaScript?

1. Ans. JavaScript comments are used to explain the source code and to make
it more readable for the end-user. They also prevent some code lines from
being executed during testing.
2. There are two types of comments in JavaScript:
1. Single-line comments:
3. It is used to comment a part of a line or a full line of code in JavaScript. “//” is
used for single-line comment insertion
4. Example:
5. // Example of a single-line comment
2. Multi-line comments:
6. It is used to leave a long comment or commenting out a block of code. “/* */”
is used to add multi-line comments.
7. Example:
8. /* Example
9. of a
10. multi-line
11. comment*/

Q. What is ‘use strict’? What are its advantages?

Ans. ‘use strict’ is used to enable strict mode to automate stricter parsing and error
handling when JavaScript code is run. This allows us to run a restricted variant of
JavaScript. It enables us to assess the JavaScript code and throw more errors fix issues
that may arise for future JavaScript releases.

The advantages of ‘use strict’ are:

1. Eliminates some unreasonable features of Javascript syntax


2. Eliminates some insecurities in the operation of the code
3. Ensures the security of the code running
4. Improves compiler efficiency

Contact: 0308-8993382, 0305-3376147


N Software Development House Private Limited

Q. What are the methods used to provide effects in jQuery??

Ans. The following are some of the methods used to provide effects in jQuery:

queue() – shows the queued functions on the selected elements

show() – displays the selected elements

hide() – hides the matched or selected elements

delay() – sets a delay for all queued functions on the selected elements

animate() – runs a custom animation on the selected elements

fadeIn() – fades in the selected elements

fadeOut() – fades out the selected elements

toggle() – toggles between the hide() and shows() methods

stop() – stops the currently running animation for the selected elements

Q. What is z-index in CSS?

The z-index property helps to specify the stack order of positioned elements that may
overlap one another. The default value of z-index is zero and can take on either a
positive or negative number. Overlapping elements with a higher z-index cover those
with a lower index.

z-index property can have the following values:

auto – Default value.

initial – sets the property to its default value (0).

number – Integer value. It can be positive or negative.

inherit – Value inherited from the parent element.

Contact: 0308-8993382, 0305-3376147

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy