Web Developer Interview Questions PDF
Web Developer Interview Questions PDF
Web Developer Interview Questions PDF
Contents
1 Introduction 1
2 General Questions 2
4 CSS Questions 6
5 Javascript Questions 11
6 jQuery Questions 13
7 PHP Questions 15
8 Conclusion 18
Web Developer Interview Questions iii
Preface
Web development is a broad term for the work involved in developing a web site for the Internet (World Wide Web) or an intranet
(a private network). Web development can range from developing the simplest static single page of plain text to the most complex
web-based internet applications, electronic businesses, and social network services.
A more comprehensive list of tasks to which web development commonly refers, may include web engineering, web design,
web content development, client liaison, client-side/server-side scripting, web server and network security configuration, and e-
commerce development. Among web professionals, "web development" usually refers to the main non-design aspects of building
web sites: writing markup and coding. Most recently Web development has come to mean the creation of content management
systems or CMS. (Source: https://en.wikipedia.org/wiki/Web_development)
The aim of this article is to provide a wide range of questions that a web developer can be asked during a job interview. Preparing
for a job interview can be a daunting process if the scope of what is to be asked is so large. Web development includes a
considerable set of skills and langauges, and an interview of this scale is sure to be all inclusive regarding the various web
technologies.
Web Developer Interview Questions v
Fabio is a passionate student in web tehnologies including front-end (HTML/CSS) and web design. He likes exploring as much
as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering,
at the same time he works as a freelancer on both web programming and graphic design.
Web Developer Interview Questions 1 / 18
Chapter 1
Introduction
Web developers are responsible for managing the way content appears to the users on a particular website. The field includes
working with programming languages to create web applications that combine databases and other tools to create companys
web managment systems. However, apart from the complex part, it can also be about creating static pages and designing stuff.
As big data is more and more part of systems, its manipulation and maintenance may as well come with errors, which then will
have to be debugged by members of the web development team in companies. In a general viewpoint, web developers are the
ones who work behind the scenes to provide not just sites, but services people use everyday. While there are a lot to be asked in
such interviews, let us have a look at what most of these questions might be.
Web Developer Interview Questions 2 / 18
Chapter 2
General Questions
1. How would you use persistent storage on browsers? What options would you use?
For HTML browsers, a good choice would be local storage and persistent storage. For non-HTML ones, cookies are the best bet.
2. What is W3C?
W3C stands for World Wide Web Consortium which is the international standard for World Wide Web. W3C is constantly busy
trying to standardize the web and to make it accessible to all users. The company was created in 1994.
3. What are two common ways in which you can reduce the load time of a web application?
There are quite a lot of ways you can reduce load time:
Minify resources
Minimize HTTP Requests
Reduce redirects
Prioritization of requests
Data compression of HTTP headers
An important operational benefit of HTTP/2 is that it avoids the head-of-line blocking problem in HTTP 1.
Chapter 3
which would result in the words BACK TO TOP appearing on the webpage and links to a bookmark named top. We can then
create a separate tag like:
<a name=top></a>
somewhere on the same webpage so that the user will be linked to that place when clicking on BACK TO TOP.
Web Developer Interview Questions 6 / 18
Chapter 4
CSS Questions
31. What are the possible ways to apply CSS styles to a web page?
CSS can be applied in the following three ways:
Linked: Create a separate .css file and add all the style for the web page there. Make sure the file is linked to the HTML
document(s) using the link tag
Embedded: Inside the HTML document, open a style tag and inside that, add all styles just like youd do on a linked file.
35. What is a Class selector and how does it differ from an ID selector?
Class selectors are used to apply style to multiple HTML elements identified with the same class. Class selectors are called
within the CSS document by a ., followed by the class name, like this:
.class {
color: black;
}
Web Developer Interview Questions 9 / 18
The difference between classes and IDs is that a HTML element can accept multiple classes, but only one ID. That means IDs
are unique for HTML elements.
36. What is the difference between visibility:hidden and display:none?
Although these two properties seem similar, there is quite an important difference between the two:
visibility:hidden hides the element, but it will still takes up space, this way affecting the layout of the document.
display:none also hides the element, but will not take up space and the page will appear as if the element is not present.
However, there are also some disadvantages like updating issues and debugging difficulties.
38. What are child selectors in CSS?
Child selectors represent a way of grouping (for styling) a set of elements that descend from a parent element. Example:
section > span {
background-color: #eee;
}
39. What are grid systems and why do we use them in web pages?
Grid systems are structured rules that enable content to be stacked horizontally and vertically in a consistent and sustainable way.
They find heavily usage in todays websites because they offer increased producitvity while coding, theyre versatile and ideal
for responsive layouts.
40. How do we use shorthand properties and why?
Shorthand properties cannot be applied to any css property but only a few like: border, outline, padding, background etc. Short-
hand properties reduce file size thus improving page load time. The trick stands for listing all property values on a single line, in
a pre defined order that must be respected. An example would be:
div {
background-color: #ccc;
background-image: url("img.png");
background-repeat: no-repeat;
background-position: right top;
}
42. List some of the new CSS propertied introduced with CSS3?
The following is a list of new properties added in CSS3:
border-radius
box-shadow
text-shadow
text-stroke
background-size
text-overflow
resize
transition
Also, other features like multiple backrounds which allows you to have two or more background in the very same selector and
flexible box model which ensures that elements behave predictably when the page layout must accommodate different screen
sizes and different display devices.
43. Explain what pseudo-classes are and their usage.
Pseudo clasess are used to define a special state of an element. Do note that pseudo classes are not defined in the markup. They
can be used for:
44. What is the CSS selector which allows you to target every element in a web page?
Called the universal selector and signed with an asterix (*), it sets all HTML element the same styling rules as defined in the
property declarations. For example:
* {
margin: 0;
padding: 10px;
}
45. What are media queries and how are they used?
A media query consists of a media type and at least one expression that limits the style sheets scope by using media features,
such as width, height, and color. Media queries, added in CSS3, let the presentation of content be tailored to a specific range of
output devices without having to change the content itself. The usage of media queries is similar to this:
@media (max-width: 768px) {
.problem-class {
property: smaller;
}
}
Web Developer Interview Questions 11 / 18
Chapter 5
Javascript Questions
Undeclared variables are variables that do not exist in a program and are not declared. If the program tries to read the value of
an undeclared variable, then a runtime error is generated.
Undefined variables are variables that are declared in the program but have not been given any value. If the program tries to
read the value of an undefined variable, an undefined value is returned.
parseInt()
parseFloat()
Number()
wcg() creates a local variable name and then a function called displayMessage(). displayMessage() is an inner
function that is defined inside wcg() and is only available within the body of that function.displayMessage() has no local
variables of its own, however it has access to the variables of outer functions and so can use the variable name declared in the
parent function.
Web Developer Interview Questions 13 / 18
Chapter 6
jQuery Questions
Text File
HTML
JSON Object
69. How can you find out that an AJAX request has been completed?
We can use the ReadyState property to check whether AJAX request has been completed. If the property is equal to 4, the request
has been completed and data is now available.
70. Do AJAX requests retain PHP session info, when calling multiple times?
Yes, PHP retains the session info over multiple ajax calls. The duration of the php session depends on SESSION configuration.
Web Developer Interview Questions 15 / 18
Chapter 7
PHP Questions
74. How can we create a session in PHP? How do we set and unset values in sessions?
PHP provides the following to work with sessions:
75. How would you connect to MySQL database from a PHP script?
Using the mysql_connect() function we can connect to a MySQL database like so:
$database = mysql_connect("HOST", "USER_NAME", "PASSWORD"); mysql_select_db("DATABASE_NAME" -
,$database);
Web Developer Interview Questions 16 / 18
76. What are the main differences between GET, POST and REQUEST methods?
GET and POST are used to send information from client browser to web server. In case of GET the information is send via GET
method in name/value pair and is URL encoded. The default GET has a limit of 512 characters. The POST method transfers
the information via HTTP Headers. The POST method does not have any restriction in data size to be sent. POST is used for
sending data securely and ASCII and binary types data. The $_REQUEST contains the content of both $_GET, $_POST and
$_COOKIE.
77. How can we find the length of a string in PHP? What about the length of an array?
PHP provides the strlen() function to find the length of a string and count() function for finding the array length.
78. What is an associative array?
Associative arrays are arrays that use named keys that you assign to them. An example would be:
$langauges=array("Front-End"=>"Javascript", "Back-End"=>"PHP", "Framework"=>"AngularJS");
MD5: The MD5 hash algorithm is implemented using the md5 function like so: $encrypted_string =md5($stri
ng);
mcrypt_encrypt: Encrypts plaintext with given parameters. The standard structure is: string mcrypt_encrypt (
string $cipher , string $key , string $data , string $mode [, string $iv ] )
Three expressions go into this kind of assignment, the condition and two operands describing what should be executed when the
condition is true or false.
85. How can we create a text file using PHP?
Most programming languages like C and Java let you create files. In PHP, the way we create files is:
$filename = "/directory/newfile.txt";
$file = fopen ($filename, "w"); // open with writing permissions
Web Developer Interview Questions 17 / 18
This is it. The file is created, and weve even granted access to write in it. Additionaly, we can check if the file can be opened:
if ($file == false) {
echo ("File cannot be opened");
exit();
}
Chapter 8
Conclusion
To conclude, it is crucial to know the basic concepts and combine logic and creativity to become the ultimate web developer and
have a potential career growth. In this article, we had a look at some of the most essential questions web developers should keep
in mind while in job interviews. HTML, CSS, Javascript and PHP are really the building blocks of the modern web and believe
me, they will be for a long time. So, knowing and expanding on these technologies/languages will surely make you confident in
the endless path of web development.