Web Developer Interview Questions

Here are the top 50 commonly asked questions in Web Developer interviews. Whether you’re just starting your preparation or need a quick refresher, these questions and answers will boost your confidence for the interview.

Web Developer Interview Questions with Answers

1. What is the use of HTTP in web?

HTTP stands for Hypertext Transfer Protocol. This is the protocol being used to transfer hypertext documents that makes the World Wide Web possible. A standard web address such as sanfoundry.com is called a URL and here the prefix http indicates its protocol. HTTP is a request-response protocol in the client-server computing model.

2. What is the difference between HTTP and HTTPS?

HTTP is an application layer protocol and uses TCP as underlying protocol for communicating and making connections. As I said it uses default port 80 for communication. HTTPS stands for Hypertext Transfer Protocol Secure. HTTPS is a protocol which uses an encrypted HTTP connection by transport-layer security. HTTPS is a protocol which encrypts the data between you and the website, so for example when you send your password nobody should be able to decrypt it, while HTTP is plain text and it’s not secure.

3. What is the difference between FTP and SMTP?

FTP stands for File Transfer Protocol. It is used to send/receive file from the remote computer. FTP establishes two connections between client system and server system. SMTP stands for Simple Mail Transfer Protocol. SMTP provides a protocol for two computers to exchange electronic mail using a TCP connection. FTP user can send and receive file to and from the computer, While SMTP is used to deliver the mail to the user’s mail box configured in the e-mail server.

4. What are the different types of network topologies?

Network topology refers to the arrangement of various network elements (nodes) in a network. There are three types of topologies.

  • Physical topology – Physical topology refers to the physical connections and mapping between the network nodes
  • Signal topology – Signal topology is the mapping of different nodes in a network based on the paths by which the signals pass through.
  • Logical topology – Logical topology refers to the mapping of nodes based on the paths taken by actual data in the network.

5. What is web application?

A web application or web app is a client–server software application in which the client (or user interface) runs in a web browser. It is an application program that is stored on a remote server and delivered over the Internet through a browser interface. Web applications primarily allow the user to perform actions.

6. What kind of security is needed for web services?

The security level for web services should be more than that of what we say Secure Socket Layer (SSL). This level of security can be only achieved from Entrust Secure Transaction Platform. Web services need this level of security to ensure reliable transactions and secure confidential information.

advertisement
advertisement

7. What is Web Service?

A Web service is a service offered by an electronic device to another electronic device, communicating with each other via the World Wide Web. A web service is a kind of software that is accessible on the Internet. It makes use of the XML messaging system and offers an easy to understand, interface for the end users. XML is used to encode all communications to a web service.

8. What is SOAP service?

SOAP stands for Simple Object Access Protocol. SOAP is an application communication protocol. SOAP is a format for sending and receiving messages. SOAP is platform independent SOAP is an open-standard, XML-based messaging protocol for exchanging information among computers.

9. What is WSDL?

WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint.

10. What is UDDI?

UDDI (Universal Description, Discovery, and Integration) is an XML-based registry for businesses worldwide to list themselves on the Internet. It is an XML-based standard for describing, publishing, and finding Web services. UDDI provides IT administrators the level of indirection required for dynamic binding. With dynamic binding, an application queries the UDDI registry to determine the current binding information for the services it needs, instead of having a hard-coded endpoint.

11. What is service oriented architecture?

A service-oriented architecture (SOA) is an architectural pattern in computer software design in which application components provide services to other components via a communications protocol, typically over a network. The principles of service-orientation are independent of any vendor, product or technology.

12. What is the purpose of HTML in web?

HTML is a markup language for describing web documents (web pages). HTML stands for Hyper Text Markup Language. A markup language is a set of markup tags. HTML documents are described by HTML tags. Each HTML tag describes different document content.

13. What is the difference between a component and a container?

A component is an object, like a button or a scroll bar which has a visual representation in a screen window. A container is a window-like component that can contain other components. Every component has a unique container that directly contains it.

14. Why do we need CSS in web development?

CSS is a stylesheet language that describes the presentation of an HTML (or XML) document. CSS describes how elements must be rendered on screen, on paper, or in other media. The CSS code allows Web developers to take control of many aspects of your site, such as fonts, colors, positioning and styling of data.

15. What is the purpose of javascript in HTML pages?

JavaScript is a high-level, dynamic, untyped, and interpreted programming language. It adds interactivity to your website. It has been standardized in the ECMAScript language specification. JavaScript is not “Interpreted Java”. In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction.

advertisement

16. What is AJAX?

Ajax stands for asynchronous JavaScript and XML. It is a set of web development techniques using many web technologies on the client-side to create asynchronous Web applications. With Ajax, web applications can send data to and retrieve from a server asynchronously without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object.

17. What is server side scripting language?

Server-side scripting is a technique used in web development which involves employing scripts on a web server which produce a response customized for each user’s (client’s) request to the website. The alternative is for the web server itself to deliver a static web page. Two different client side scripting languages are JSP and PHP.

18. What is client side scripting language?

Client-side refers to operations that are performed by the client in a client–server relationship in a computer network. Client-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user’s web browser, instead of server-side. Two different client side scripting languages are JavaScript and VBScript.

19. What is web application framework?

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources and web APIs. Web frameworks aim to alleviate the overhead associated with common activities performed in web development.

20. What is the difference between web server and web browser?

  • Web server is essential to store all information and data of websites. While web browser are used to access and locate these information and data.
  • Web browser is used to search something on the internet via websites. While web server is used to make the links between websites and web browser.
  • Web browser is a software or application which is used for collection and presentation of data in shape of websites while web server is a program server on computer or in cloud on internet that gives the data.

21. What is the difference between DNS and URL?

Web server contains all the web pages. Each web server will have a specific IP address. It is difficult to memorize IP addresses of the entire servers. So we can map the IP address to a particular name. This is known as domain name. The domain name is mapped to the IP address using DNS (Domain Naming Systems). Address of the webpage is structured by URL. For example, the URL for Sanfoundry is www.sanfoundry.com. The resource of web pages is uniquely identified by URL. The clients require this URL to access the web pages.

advertisement

22. What are the contents of HTTP response?

The initial line of HTTP response contains:

  • The protocol version (which can be like HTTP/1.0 or HTTP/1.1).
  • Status code, which stand for the status of the http request and the document.
  • Status description, which describes the status code.

23. What is the difference between GET and POST method?

A GET request retrieves data from a web server by specifying parameters in the URL portion of the request. This is the main method used for static document retrieval. A POST request is used to send data to the server, for example customer information, file upload etc using HTML forms. GET is the default HTTP method whereas we need to specify method as POST to send request with POST method. GET method is not secure because data is exposed in the URL and we can easily bookmark it and send similar request again, POST is secure because data is sent in request body and we can’t bookmark it.

24. What are the different HTTP request methods?

  • HEAD – Same as GET but returns only HTTP headers and no document body
  • PUT – Uploads a representation of the specified URI
  • DELETE – Deletes the specified resource
  • OPTIONS – Returns the HTTP methods that the server supports
  • CONNECT – Converts the request connection to a transparent TCP/IP tunnel

25. Explain three tier client-server architecture.

Three-tier client-server architecture is generally used in web based applications.
The three tiers are: presentation tier, application tier and data tier.

  • Presentation tier: Presentation layer which is the highest layer in the application takes care of the display in the browser. It can communicate with other tiers. Web servers are the main components of presentation tier.
  • Application tier: Application tier takes care of the business logic. That means the basic functionality of the application is carried out by the application tier.
  • Data tier: Data is stored in this tier. Data tier mainly consists of Database Servers.

Advanced Web Developer Interview Questions with Answers

26. What is the difference between XML and HTML?

HTML is a markup language that is used to design web pages. XML is the acronym from Extensible Markup Language. XML is a resembling language with HTML. XML is designed to carry data – with focus on what data is. HTML is designed to display data – with focus on how data looks. HTML describes presentation and XML describes content.

27. What are the various elements provided by HTML5 for media content?

The tags introduced in HTML5 are:

  • audio – It defines sound content
  • video – It defines a video or a movie
  • source – This tag defines the multiple media resources for video and audio
  • embed – It provides a container for an external application or interactive content
  • track – It defines text tracks for video and audio

28. Why do we use the XMLHttpRequest object in AJAX?

  • Javascript uses the XMLHttpRequest object to manipulate XML and other text data between client and server.
  • AJAX applications use the XMLHttpRequest object to avoid the postback of entire page when the browser is communicating with server.
  • The XMLHttpRequest object enables a client-side script to execute an HTTP request.

29. What are different ways to integrate a CSS into a Web page?

There are three ways to integrate CSS into a Web page

  • Inline: HTML elements may have CSS applied to them via the STYLE attribute.
  • Embedded: By placing the code in a STYLE element within the HEAD element.
  • External: Place the CSS in an external file and link it via a link element.

30. Explain security issues with AJAX?

  • AJAX can have security problems if it doesn’t handle user input carefully. Hackers could put harmful code into a website, and if it’s not checked properly, it could run when other people visit the site.
  • If AJAX requests go to different places (origins) without permission, it might let bad actors access sensitive stuff.
  • Sometimes, AJAX requests can be tricked into doing things they shouldn’t by bad websites. This could lead to unwanted actions on a website.
  • AJAX might accidentally give away secret information if it’s not careful about how it sends and receives data.
  • If AJAX doesn’t use secure ways of talking to servers, like HTTPS, someone could listen in on the conversation and maybe change things.

31. Explain cross site scripting in web applications?

Cross-site Scripting (XSS) is a technique by which malicious content is injected in the form of HTML/JavaScript code. XSS exploits can be used for triggering various other attacks like cookie theft, account hijacking, phishing, and denial of service. Also, an XSS attack could send requests for specific pages other than the page the user is currently looking at. This allows the attacker to actively look for certain content, potentially accessing the data.

32. What is javascript library?

A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. jQuery is “The Write Less, Do More” JavaScript Library.It is the most popular javascript library for web application.

33. What are the advantages of PHP language?

Advantages of PHP are as follows:

  • Open source: It is developed and maintained by a large group of PHP developers, this will helps in creating a support community, abundant extension library.
  • Speed: It is relative fast since it uses much system resource.
  • Easy to use: It uses C like syntax, so for those who are familiar with C, it’s very easy for them to pick up and it is very easy to create website scripts.
  • Stable: Since it is maintained by many developers, so when bugs are found, it can be quickly fixed.
  • Powerful library support: You can easily find functional modules you need such as PDF, Graph etc.
  • Built-in database connection modules: You can connect to database easily using PHP.

34. Explain SQL code injection technique in web pages?

SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution. Injected SQL commands can alter SQL statement and compromise the security of a web application. The only proven way to protect a web site from SQL injection attacks, is to use SQL parameters.

35. What is the difference between synchronous web service and asynchronous web service?

Synchronous Web Services provides an immediate response to a query. In this situation, the client will wait until the server sends back the response message. The advantage of using the synchronous service is that the client application knows the status of the Web service operation in a very short time.
Asynchronous Web Services (SOAP Web Services Only) may require a significant amount of time to process a request. However, the client that invoked the Oracle E-Business Suite Web service can continue with other processing in the meantime rather than wait for the response.Asynchronous operation is extremely useful for environments in which a service, such as a loan processor, can take a long time to process a client request.

36. Explain Bootstrap with respect to responsive web design?

Responsive Web Design makes your web page look good on all devices. Bootstrap also gives you the ability to easily create responsive designs. Bootstrap is a free front-end framework for faster and easier web development. Bootstrap includes HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modals, image carousels and many other, as well as optional JavaScript plugins.

37. What is the purpose of DOM in web application?

The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML, and XML documents. The nodes of every document are organized in a tree structure, called the DOM tree. The DOM defines methods that allow access to the tree, so that they can change the document structure, style and content.

38. What is the difference between REST and RESTful web service?

Representational state transfer (REST) is a style of software architecture. REST is an “architectural style” that basically exploits the existing technology and protocols of the Web. RESTful is typically used to refer to web services implementing such an architecture. Web service APIs that adhere to the REST architectural constraints are called RESTful APIs.

39. What is DOCTYPE?

The term DOCTYPE tells the browser which type of HTML is used on a webpage. In turn, the browsers use DOCTYPE to determine how to render a page. Failing to use DOCTYPE or using a wrong DOCTYPE may load your page in Quirks Mode.

40. What is the difference between cookies, sessionStorage, and localStorage?

Cookies are small text files that websites place in a browser for tracking or login purposes. Meanwhile, localStorage and sessionStorage are new objects, both of which are storage specifications but vary in scope and duration. Of the two, localStorage is permanent and website-specific whereas sessionStorage only lasts as long as the duration of the longest open tab.

41. What is the difference between echo and print in PHP?

The only differences are as follows:

  • echo does not return a value whereas print does return a value of 1 (this enables print to be used in expressions).
  • echo can accept multiple parameters (although such usage is rare) while print can only take a single argument.

42. What is the difference between XML DTD and schema?

DTD, or Document Type Definition, and XML Schema, which is also known as XSD, are two ways of describing the structure and content of an XML document.

  • XML Schema is namespace aware, while DTD is not.
  • XML Schemas are written in XML, while DTDs are not.
  • XML Schema is strongly typed, while DTD is not.
  • XML Schema has a wealth of derived and built-in data types that are not available in DTD.

43. What is the difference between HTML and XHTML?

XHTML stands for EXtensible HyperText Markup Language. XHTML is almost identical to HTML. XHTML is stricter than HTML. XHTML is HTML defined as an XML application. XHTML is supported by all major browsers. XHTML is part of the family of XML markup languages. It mirrors or extends versions of the widely used HTML, the language in which Web pages are formulated.

44. What is the basic difference between ASP and ASP.NET?

Active Server Pages (ASP), also known as Classic ASP, is a Microsoft’s server-side technology, which helps in creating dynamic and user-friendly Web pages. ASP.NET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services. The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language.

45. What is the difference between session cookies and persistent cookies?

A session cookie exists only in memory. If a user closes the web browser, the session cookie delete permanently. A persistent cookie, on the other hand, can available for months or even years. When you create a persistent cookie, the cookie is stored permanently by the user’s browser on the user’s computer.

46. What are the different method of navigation in ASP.NET?

Page navigation means moving from one page to another page in your web site and another. There are many ways to navigate from one page to another in ASP.NET.

  • Client-side navigation
  • Cross-page posting
  • Client-side browser redirect
  • Client-Side Navigation

47. What are the advantages of JSP over pure Servelets?

It is more convenient to write regular HTML than to have plenty of println statements that generate the HTML. Other advantages are:

  • Embedding of Java code in HTML pages.
  • Platform independence.
  • Creation of database-driven Web applications.
  • Server-side programming capabilities.

48. What is the difference between JspWriter and PrintWriter?

The JspWriter object contains most of the same methods as the java.io.PrintWriter class. However, JspWriter has some additional methods designed to deal with buffering. Unlike the PrintWriter object, JspWriter throws IOExceptions.

49. What is the purpose of JSF in java server pages?

JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It was formalized as a standard through the Java Community Process and is part of the Java Platform, Enterprise Edition. JSF is intended to simplify development integration of web-based user interfaces.

50. Explain JSP lifecycle methods?

Methods are as follows:

  • jsplnit(): The container calls this to initialize servlet instance. It is called only once for the servlet instance and preceded every other method.
  • jspService(): The container calls this for each request and passes it on to the objects.
  • jspDestroy(): It is called by the container just before destruction of the instance.

Useful Resources:

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.