WT Oral Questions
WT Oral Questions
1. What is HTML?
HTML stands for Hyper Text Markup Language. It is a language of World Wide Web. It is a standard text
formatting language which is used to create and display pages on the Web. More details...
HTML tags are composed of three things: opening tag, content and ending tag. Some tags are unclosed tags.
content, and
tags
Content is placed between tags to display data on the web page. More details...
No. There are some HTML tags that don't need a closing tag. For example: <image> tag, <br> tag.
HTML elements communicate to the browser to render text. When the elements are surrounded by brackets
<>, they form HTML tags. Most of the time, tags come in pair and surround content.
No, you can use hyperlinks on text and images both. More details...
A style sheet is used to build a consistent, transportable, and well designed style template. You can add
these templates on several different web pages.
Yes. To create a multicolor text on a web page you can use <font color ="color"> </font> for the specific
texts you want to color.
The color of the bullet is always the color of the first text of the list. So, if you want to change the color of the
bullet, you must change the color of the text.
Web Technology
Unit wise/ Oral Questions
Marquee is used to put the scrolling text on a web page. You should put the text which you want to scroll
within the <marquee>......</marquee> tag. More details...
There are three tags used to separate the texts. i.e. usually <br> tag is used to separate line of texts. Other
tags are<p> tag and <blockquote> tag.
To make a picture a background image on a web page, you should put the following tag code after the
</head> tag.
1. <body background = "image.gif">
Here, replace the "image.gif" with the name of your image file which you want to display on your web page.
Syntax: <iframe src="URL"></iframe>
Example: <iframe src="demo_iframe.html" width="200px" height="200px"></iframe>
15. What are the different new form element types in HTML 5?
Color
Date
Datetime-local
Email
Time
Url
Range
Telephone
Number
Search
16. Is there any need to change the web browsers to support HTML5?
No. Almost all browsers (updated versions) support HTML 5. For example: Chrome, Firefox, Opera, Safari, IE
XML is called Extensible Markup Language which is designed to carry or transport and store data. XML
tags are not as predefined as HTML, but we can define our own user tags for simplicity. It mainly
concentrates on storing of data, not on displaying of data.
Web Technology
Unit wise/ Oral Questions
HTML XML
Markup language used to display data Markup language used to store data
Case Insensitive Case sensitive
Designing web pages Used to transport and store data
Predefined Tags Custom Tags
Does not Preserve white spaces Preserve white spaces
Static Dynamic
XML Document object represents the whole XML document, and it is the root of a document tree. It gives
access to entire XML document – Nodes and Elements, and it has its own properties.
• XML structure is traversable, and it can be randomly accessed by traversing the tree.
• XML structure is modifiable, and values can be added, changed and removed
An XML document contains XML Elements, and it starts from an element’s start tag to end tag. It can
contain:
illegal in XML elements. CDATA section starts with <![CDATA[“ and end with “]]>”.
JSON is a simple data exchange format. JSON means JavaScript Object Notation; it is language and
platform independent.
An object can be defined as an unordered set of name/value pairs. An object in JSON starts with {left
brace} and finish or ends with {right brace}. Every name is followed by: (colon) and the name/value
pairs are parted by, (comma).
One of the common use of JSON is to collect JSON data from a web server as a file or HTTP request, and
convert the JSON data to a JavaScript, ant then it avails the data in a web page.
47. Mention which function is used to convert a JSON text into an object?
JSON.stringify() converts an object into a JSON text and saves that JSON text in a string.
var json = ‘{“name”: “Guru 99”, “Description “: “Learn PHP Interactively with PHP Beginner Tutorials}
obj = $.parseJSON(json);
JavaScript is a scripting language. It is different from Java language. It is object-based, lightweight and cross
platform. It is widely used for client side validation.
Netscape provided the JavaScript language. Microsoft changed the name and called it JScript to avoid the
trademark issue.In other words, you can say JScript is same as JavaScript, but it is provided by Microsoft.
A simple example of JavaScript hello world is given below. You need to place it inside the body tag of html.
<script type="text/javascript">
document.write("JavaScript Hello World!");
</script>
4. How to use external JavaScript file?
I am assuming that js file name is message.js, place the following script tag inside the head tag.
<script type="text/javascript" src="message.js"></script>
DOM stands for Document Object Model. A document object represent the html document. It can be used to
access and change the content of html.
The window object is automatically created by the browser that represents a window of a browser.
It is used to display the popup dialog box such as alert dialog box, confirm dialog box, input dialog box etc.
The history object of browser can be used to switch to history pages such as back and forward from current
page or another page. There are three methods of history object.
1. history.back()
2. history.forward()
3. history.go(number): number may be positive for forward, negative for backward.
9. How to write comment in JavaScript?
2. Multi Line Comment: It is represented by slash with asterisk symbol as /* write comment here */
function function_name(){
//function body
}
11. What are the JavaScript data types?
1. By object literal
2. By creating instance of Object
3. By Object Constructor
Let's see a simple code to create object using object literal.
emp={id:102,name:"Rahul Kumar",salary:50000}
1. By array literal
2. By creating instance of Array
3. By using an Array constructor
14. Difference between Client side JavaScript and Server side JavaScript?
Client side JavaScript comprises the basic language and predefined objects which are relevant to running
java script in a browser. The client side JavaScript is embedded directly by in the HTML pages. This script is
interpreted by the browser at run time.
Server side JavaScript also resembles like client side java script. It has relevant java script which is to run
in a server. The server side JavaScript are deployed only after compilation.
The storage of cookies on the hard disk depends on OS and the browser.
The Netscape navigator on Windows uses cookies.txt file that contains all the cookies. The path is : c:\
Program Files\Netscape\Users\username\cookies.txt
The Internet Explorer stores the cookies on a file [email protected]. The path is: c:\Windows\Cookies\
[email protected].
20. Is jQuery a W3C standard?
Ans: No. jQuery is not a W3C standard.
21. What is the basic need to start with jQuery?
Ans: To start with jQuery, one need to make reference of it's library. The latest version of jQuery can be
downloaded from jQuery.com.
22. Which is the starting point of code execution in jQuery?
Ans: The starting point of jQuery code execution is $(document).ready() function which is executed
when DOM is loaded.
Only one object at the time of first request by servlet or web container.
1. Servlet is loaded
2. servlet is instantiated
3. servlet is initialized
4. service the request
5. servlet is destroyed
3. What are the life-cycle methods for a servlet?
Method Description
public void init(ServletConfig config) It is invoked only once when first request comes
for the servlet. It is used to initialize the servlet.
public void service(ServletRequest It is invoked at each request.The service() method
request,ServletResponse)throws is used to service the request.
ServletException,IOException
public void destroy() It is invoked only once when servlet is unloaded.
4. Who is responsible to create the object of servlet?
bar. bar.
3) Can be bookmarked Cannot be bookmarked
4) Idempotent Non-Idempotent
5) It is more efficient and used than Post It is less efficient and used
The GenericServlet is protocol independent whereas HttpServlet is HTTP protocol specific. HttpServlet
provides additional functionalities such as state management etc.
Session Tracking is a way to maintain state of an user.Http protocol is a stateless protocol.Each time user
requests to the server, server treats the request as the new request.So we need to maintain the state of an
user to recognize to particular user.
A cookie is a small piece of information that is persisted between the multiple client requests. A cookie has a
name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum
age, and a version number.
Java Server Pages technology (JSP) is used to create dynamic web page. It is an extension to the servlet
technology. A JSP page is internally converted into servlet.
public void jspInit() It is invoked only once, same as init method of servlet.
The jsp comment is called hide comment whereas html comment is called output comment. If user views the
Web Technology
Unit wise/ Oral Questions
source of the page, the jsp comment will not be shown whereas html comment will be shown.
1) The include directive includes the 1) The include action includes the content at
content at page translation time. request time.
2) The include directive includes the 2) The include action doesn't include the original
original content of the page so page size content rather invokes the include() method of
increases at runtime. Vendor provided class.
3) It's better for static pages. 3) It's better for dynamic pages.
Yes. JSP technology is extensible through the development of custom actions, or tags, which are
encapsulated in tag libraries.
18. How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of
using it?
You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is
done by adding the directive <%@ page isThreadSafe="false" %> within your JSP page.
19. How can I prevent the output of my JSP or Servlet pages from being cached by the browser?
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setHeader ("Expires", "0"); //prevents caching at the proxy server
%>
What is PHP?
PHP is a web language based on scripts that allows developers to dynamically create generated web pages.
Web Technology
Unit wise/ Oral Questions
javascript is a client side scripting language, so javascript can make popups and other things happens on
someone’s PC. While PHP is server side scripting language so it does every stuff with the server.
1) What is AJAX?
AJAX stands for Asynchronous JavaScript and XML. It is a group of related technologies to display data
Web Technology
Unit wise/ Oral Questions
4) What are the real web applications of AJAX currently running in the market?
Twitter
Facebook
Gmail
Javatpoint
Youtube etc.
Synchronous request blocks the user until response is retrieved whereas asynchronous doesn't block the
user.
responseXML
JSON stands for JavaScript Object Notation. It is easy to understand and data exchange is fast than XML. It
supports array.
There are two most widely used tools for debugging AJAX applications.
Firebug for Mozilla Firefox
Fiddler for IE (Internet Explorer)
JavaScript makes a request to the server and waits for the response. It consumes more bandwidth as it
reloads the page.
AJAX sends a request to the server and doesn't wait for the response. It doesn't reload the page so consumes
less bandwidth.
Web Technology
Unit wise/ Oral Questions
1) What is AngularJS?
AngularJS is a JavaScript framework i.e. used to create single web page application. It follows MVC (Model
View Controller) pattern. It is open source, cross browser compliant and easy to maintain.
supports animation
open source
JavaScript Dependent: If end user disables JavaScript, AngularJS will not work.
Not Secured: It is JavaScript based framework so it is not safe to authenticate user through
AngularJS only.
Eclipse
Visual Studio
WebStorm
TextMate etc.
6) What are the features of AngularJS?
1. MVC
2. Validations
3. Modules
4. Directives
5. Templates
6. Scope
7. Expressions
8. Data Binding
Web Technology
Unit wise/ Oral Questions
9. Filters
10. Services
11. Routing
12. Dependency Injection
13. Testing
7) What are directives in AngularJS?
Directives are the markers on DOM element that is used to specify behavior on that DOM element. All
AngularJS directives start with the word "ng". There are many in-built directives in AngularJS such as "ng-
app", "ng-model", "ng-controller", "ng-repeat" etc.
1. <input type="text" id="empName" ng-model="EmpName"/>
Controllers are JavaScript functions that are used to provide data and logic to HTML UI. It acts as an
interface between Server and HTML UI.
Data Binding is the automatic synchronization of data between model and view. There are two ways of data
binding:
One way data binding (used in classical template)
Two way data binding (used in AngularJS template)
Services are objects that can be used to store and share data across the application. AngularJS offers many
built-in services such as $http i.e. used to make XMLHttpRequest.
Each AngularJS application can have only one root scope but can have multiple child scopes.
A template consists of HTML, CSS and AngularJS directives that are used to render dynamic view.
Expressions are the code snippets that resolves to a value. AngularJS expressions are placed inside
{{expression}}. For example:
Web Technology
Unit wise/ Oral Questions
1. {{1+1}}
A filter is used to format the value of expression to display the formatted output. AngularJS enables us to
write our own filter.
Node.js is a Server side scripting which is used to build scalable programs. Its multiple advantages over
other server side languages, the prominent being non-blocking I/O.
Node.js works on a v8 environment, it is a virtual machine that utilizes JavaScript as its scripting language
and achieves high output via non-blocking I/O and single threaded event loop.
I/O is the shorthand for input and output, and it will access anything outside of your application. It will be
loaded into the machine memory to run the program, once the application is started.
In computer programming, event driven programming is a programming paradigm in which the flow of the
program is determined by events like messages from other programs or threads. It is an application
architecture technique divided into two sections 1) Event Selection 2) Event Handling
A generic piece of code which runs in between several asynchronous function calls is known as control flow
function.
9) Explain the steps how “Control Flow” controls the functions calls?
Web Technology
Unit wise/ Oral Questions
For async processing, Node.js was created explicitly as an experiment. It is believed that more performance
and scalability can be achieved by doing async processing on a single thread under typical web loads than
the typical thread based implementation.
13) Using the event loop what are the tasks that should be done asynchronously?
a) I/O operations
b) Heavy computation
c) Anything requiring blocking
Node.js is quickly gaining attention as it is a loop based server for JavaScript. Node.js gives user the ability to
write the JavaScript on the server, which has access to things like HTTP stack, file I/O, TCP and databases.
To process and handle external events and to convert them into callback invocations an event loop is used.
So, at I/O calls, node.js can switch from one request to another .
Pros: a) If your application does not have any CPU intensive computation, you can build it in Javascript
top to bottom, even down to the database level if you use JSON storage object DB like MongoDB.
b) Crawlers receive a full-rendered HTML response, which is far more SEO friendly rather than a single
Web Technology
Unit wise/ Oral Questions
Cons: a) Any intensive CPU computation will block node.js responsiveness, so a threaded platform is a
better approach.
b) Using relational database with Node.js is considered less favourable
Node.js solves this problem by putting the event based model at its core, using an event loop instead of
threads.
The difference between Node.js and Ajax is that, Ajax (short for Asynchronous Javascript and XML) is a
client side technology, often used for updating the contents of the page without refreshing it. While,Node.js
is Server Side Javascript, used for developing server software. Node.js does not execute in the browser but
by the server.
Emphasizing on the technical side, it’s a bit of challenge in Node.js to have one process with one thread to
scale up on multi core server.
In node.js “non-blocking” means that its IO is non-blocking. Node uses “libuv” to handle its IO in a platform-
agnostic way. On windows, it uses completion ports for unix it uses epoll or kqueue etc. So, it makes a non-
blocking request and upon a request, it queues it within the event loop which call the JavaScript ‘callback’ on
the main JavaScript thread.
Web Services work on client-server model where client applications can access web services over the
network. Web services provide endpoint URLs and expose methods that can be accessed over network
through client programs written in java, shell script or any other different technologies.
Web services are stateless and doesn’t maintain user session like web applications.
1. SOAP Web Services: Runs on SOAP protocol and uses XML technology for sending data.
2. Restful Web Services: It’s an architectural style and runs on HTTP/HTTPS protocol almost all the
time. REST is a stateless client-server architecture where web services are resources and can be
identified by their URIs. Client applications can use HTTP GET/POST methods to invoke Restful web
services.
What is SOAP?
SOAP stands for Simple Object Access Protocol. SOAP is an XML based industry standard protocol for
designing and developing web services. Since it’s XML based, it’s platform and language independent. So our
server can be based on JAVA and client can be on .NET, PHP etc. and vice versa.
WSDL document provides contract and technical details of the web services for client applications
without exposing the underlying implementation technologies.
SOAP uses XML data for payload as well as contract, so it can be easily read by any technology.
SOAP protocol is universally accepted, so it’s an industry standard approach with many easily
available open source implementations.
Only XML can be used, JSON and other lightweight formats are not supported.
SOAP is based on the contract, so there is a tight coupling between client and server applications.
SOAP is slow because payload is large for a simple string message, since it uses XML format.
Anytime there is change in the server side contract, client stub classes need to be generated again.
REST is the acronym for REpresentational State Transfer. REST is an architectural style for developing
applications that can be accessed over the network. REST architectural style was brought in light by Roy
Fielding in his doctoral thesis in 2000.
REST is a stateless client-server architecture where web services are resources and can be identified by
their URIs. Client applications can use HTTP GET/POST methods to invoke Restful web services. REST
doesn’t specify any specific protocol to use, but in almost all cases it’s used over HTTP/HTTPS. When
compared to SOAP web services, these are lightweight and doesn’t follow any standard. We can use XML,
JSON, text or any other type of data for request and response.
Since there is no contract defined between service and client, it has to be communicated through
other means such as documentation or emails.
https://www.javatpoint.com/ejb-interview-questions
1) What is EJB?
EJB stands for Enterprise Java Bean. It is a server-side component to develop scalable, robust and secured
enterprise applications in java. More details...
Session Bean encapsulates business logic. It can be invoked by local, remote or web service client.
There are 3 types of session bean.
1. Stateless Session Bean
Web Technology
Unit wise/ Oral Questions
Stateful session bean is a business object that maintains conversational state with the client.
Singleton session bean is instantiated only once for the application. It exists for the life cycle of the
application.
Entity Bean is a server side component that represents the persistent data. Since EJB 3.x, it is replaced by
JPA.
Java Server Faces or JSF : It is a java based web application framework to make the user interface simple
for JEE applications. Instead of traditional request driven MVC framework it uses component based
approach.
JSF is designed on the MVC (Model-View-Controller) framework and this allows for applications to be scaled
better. A JSF application is same like other Java technology based web application, it runs in a JAVA servlet
container and it contains
JavaBeans components as models consisting data and application-based functionality
Custom tag library for representing validators and event handlers
Custom tag library for rendering UI components
UI components signified as stateful objects on the server
Server side helper classes
Event handlers, validators and navigation handlers
Application configuration resource file for organizing and configuring application resources
Restore view phase: During this phase binding of components to its event handlers and validators
are executed and view is saved in the FacesContext object
Apply request values phase: The motive of this phase is to retrieve its current date for each
component
Process validation phase: During this phase, local values saved for the component in the tree are
compared to the components validation rules registered
Update model value phase: After verifying, that data is genuine or valid in the previous phase, local
Web Technology
Unit wise/ Oral Questions
Invoke application phase: Prior to this phase the component values have been transformed,
validated and applied to the bean objects, so that you can avail them to run the application’s
business logic
Render response phase: JSP container renders the page back to the user in this phase
When it comes to JSF there are Reference Implementation (RI) by Sun Microsytems; Apache MyFaces is an
open source JavaServer Faces (JSF) implementation and for Oracle there is ADF Faces.
JSF action methods can be applied in Java Struts actions are restricted to struts
objects API only
JSF has event model which reacts on actions, There are no such event models in
value changes and phase changes in JSF struts
lifecycle
Struts tag generates HTML directly
JSF component tag does not produce HTML-
instead they declare a component renderer To define navigation struts uses the
pair on the server notation
Web Technology
Unit wise/ Oral Questions
1) What is Spring?
It is a lightweight, loosely coupled and integrated framework for developing enterprise applications in java.
Bootstrap is a HTML, CSS, and JS framework for building the rich web applications with minimal effort. This
framework emphasis more on building mobile web applications.
There are few reason why we choose Bootstrap for building websites
Mobile Support: For mobile devices it provides full support in one single file rather than in separate
file. It supports the responsive design including adjusting the CSS based on the different types of
device, size of the screen etc. It reduces extra effort for developers.
Easy to learn: Writing application in bootstrap is easy if you know CSS and HTML
Browser Support: It supports all the popular browsers like Firefox, Opera, Safari, IE etc.
Scaffolding : It provides a basic structure with Grid system , link styles and background
Customize: To get your own version of framework you can customize your components
What is JNDI?
JNDI stands for Java Naming and Directory Interface. JNDI allows distributed applications to look up
services in an abstract, resource-independent way.
What is JNDI Lookup?
lookup() attempts to find the specified object in the given context. It looks for a single, specific object and
either finds it in the current JNDI context or it fails.
What is WordPress?
Word press is a best Open Source CMS which allows it to be used free of cost. You can use it on any
kind of personal or commercial website without have to pay a single penny for it. It is built on
PHP/MySQL (which is again Open Source) and licensed under GPL.