WT CAT 2 Preaparation Material
WT CAT 2 Preaparation Material
1. When using the POST method, variables are displayed in the URL:
a)True b)False
2. Which super global variable holds information about headers, paths, and script locations?
a)$GLOBALS b)$_GET c)$_SESSION d)$_SERVER
3. What is the correct syntax of the declaration which defines the XML version?
a)<?xml version="1.0" /> b)<xml version="1.0" /> c)<?xml
version="1.0"?>
d) <?xml version="1.0"->
4. Is this a "well formed" XML document?
<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body> Hello Hi!</body>
</note>
a)No b)Yes
5. Examine the statement which is NOT true?
a)White-space is not preserved in XML b)XML elements must be properly nested
c)XML documents must have a root tag d)XML tags are case sensitive
6. Which of the following statement is true for AngularJS?
a) AngularJS is a closed-source front-end web framework b) AngularJS is an open-source front-
end web framework c) AngularJS is an open-source backend web framework d) AngularJS is
a closed-source back-end web framework
7. Identify the correct statement about data binding in AngularJS?
a) Automatic synchronization of data between model and view components
b) Automatic synchronization of data between model and controller components
c) Technique to save html data in the database d) Technique to bind database data to html
control
8. Choose the right directive which is used to bind the application data to the HTML view in
AngularJS?
a)ng-app directive b)ng-model directive c)ng-bind directive d)ng-init directive
9. Node js is written in
a)JavaScript b)C c) C++ d)All of the above
10. Django is a _____________ Python web framework.
a) low-level b) mid-level c) high-level d) None of the above
11. How do you create an array in PHP?
a)$cars = array("Volvo", "BMW", "Toyota"); b)$cars = array["Volvo", "BMW",
"Toyota"];
c)$cars = "Volvo", "BMW", "Toyota"; d)$cars = Volvo , BMW, Toyota;
12. Is this a "well formed" XML document?
<?xml version="1.0"?>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body> Hello Hi!</body>
a)Yes b)No
13. What does XSL stand for?
a)eXtensible Stylesheet Language b)eXtra Style Language c)eXtensible Style Listing
d)eXpandable Style Language
14. For the XML parser to ignore a certain section of your XML document, which syntax is
correct?
a)<![CDATA[ Text to be ignored ]]> b)<xml:CDATA[ Text to be ignored ]>
c)<CDATA> Text to be ignored </CDATA> d)<PCDATA> Text to be ignored
</PCDATA>
15.What is a correct way of referring to a stylesheet called "mystyle.xsl" ?
a)<?xml-stylesheet type="text/xsl" href="mystyle.xsl" ?>
b)<stylesheet type="text/xsl" href="mystyle.xsl" />
c)<link type="text/xsl" href="mystyle.xsl" />
d)<link type="text/xsl" href="mystyle.xsls" />
16.Which of the following is the correct syntax for writing AngularJS expressions?
a) {{expression}} b) {{expression | filter1 | filter2 | …}} c) Both of the mentioned
d) None of the mentioned
17.What is a Model in MVC?
a) the lowest level of the pattern responsible for maintaining data
b) represents server-side data c) represents data stored in a database d) None of the
mentioned
18.Which of the following is used to share data between controller and view in AngularJS?
a)using Model b)using services c)using factory d)using $scope
19.What does the REPL stand for?
a)REPL stands for "Read Eval Print Loop." b)REPL stands for "Research Eval Program Learn."
c)REPL stands for "Read Earn Point Learn." d)REPL stands for "Read Eval Point Loop."
20.What is the base principle of MVT in Django?
a)Model, Template, View b)Model, View, Template c)Template, Model, View
d)Template, View, Model
PART B
1. What is session tracking? list the methods to store the session.
A session is a conversation between the server and a client. A conversation consists series
of continuous request and response. Session Tracking is a way to maintain state (data) of
an user. It is also known as session management in servlet.
Session tracking methods:
User authorization
Hidden fields
URL rewriting
Cookies
Session tracking API
2. List the different data types in PHP?
Data Types define the type of data a variable can store. PHP allows eight different types of
data types. All of them are discussed below. There are pre-defined, user-defined, and
special data types.
The predefined data types are:
Boolean Integer Double String
The user-defined (compound) data types are:
Array Objects
The special data types are:
NULL resource
3. Differentiate DTD and XSD.
5. Can you describe the difference between user interface (UI) design and UX design?
User interface (UI) design refers to the aesthetic elements by which people interact with a
product, such as buttons, icons, menu bars, typography, colors, and more. User experience
(UX) design refers to the experience a user has when interacting with a product.
The key differentiator between UI and UX is what they focus on, and how the user interacts
with them. UI focuses on visual interface elements such as typography, colors, menu bars,
and more, while UX focuses on the user and their journey through the product.
6. Show the steps to store cookies in Javascript.
Following are the steps to store a cookie:
Step 1: document.cookie object, make a string value for assigning it to the respective
object.
Step 2: Example: document.cookie = “Attempt1 = input1;Attempt2 = input2; expires =
date”;
Mentioning the data field is optional. If a particular time or data is specified in the
respective field, the cookie will be deleted on the mentioned time or data. The cookie, after
getting deleted, will not be available for any further use.
It is important to know that character values such as semicolons, or commas, or any
whitespace cannot be included while defining the value of a cookie.
7. State the purpose of DTD and give an example.
The purpose of a DTD is to define the legal building blocks of an XML document. It defines
the document structure with a list of legal elements. A DTD can be declared inline in your
XML document, or as an external reference.
Example:
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
8. Indicate the use XML Namespace?
An XML namespace is a collection of names that can be used as element or attribute names
in an XML document. The namespace qualifies element names uniquely on the Web in
order to avoid conflicts between elements with the same name
9. What is Docker Container? Give example for creating a Docker container.
A container is a standard unit of software that packages up code and all its dependencies
so the application runs quickly and reliably from one computing environment to another.
A Docker container image is a lightweight, standalone, executable package of software that
includes everything needed to run an application: code, runtime, system tools, system
libraries and settings.
10. How will you maintain the sessions in MVC?
The sessions of an MVC can be maintained in 3 possible ways:
View data
Temp data and
View bag
PART C
1. Create an XML file which will display the book information which include the following:
1.Title of the book
2.Author name
3.Publisher name
4.Edition
5.Price
Write a Document Type Definition (DTD) to validate the above XML file and Use DOM
to parse the strings.
Answer:
Write a Document Type Definition (DTD) to validate the XML file.
PROGRAM:
<bookstore>
<book>
<title>web programming</title>
<author>chrisbates</author>
<ISBN>123-456-789</ISBN>
<publisher>wiley</publisher>
<edition>3</edition>
<price>350</price>
</book>
<book>
<title>internet worldwideweb</title>
<author>ditel&ditel</author>
<ISBN>123-456-781</ISBN>
<publisher>person</publisher>
<edition>3</edition>
<price>450</price>
</book>
</bookstore>
This driver named as MySQL's Connector/J driver is a Type 4 driver. Because of the proprietary
nature of their network protocols, database vendors supply type 4 drivers.
3. Develop a PHP program:
a) To print each element of an array (5)
b) To Find The Product of Elements In An Array (5)
4. Briefly discuss about MVC architecture and its advantages.