Get Latest Exam Updates, Free Study materials and Tips

Exit Intent

[MCQ’s]Internet Programming

Module 01

1. Architectural design is a creative process satisfying only functional-requirements of a system.
a) True
b) False
Answer: b
Explanation: In architectural design you design a system organization satisfying the functional and non-functional requirements of a system.

2. A ________ view shows the system hardware and how software components are distributed across the processors in the system.
a) physical
b) logical
c) process
d) all of the mentioned
Answer: a
Explanation: A physical view is implemented by system engineers implementing the system hardware.

3. The UML was designed for describing _________
a) object-oriented systems
b) architectural design
c) SRS
d) Both object-oriented systems and Architectural design
Answer: d
Explanation: The UML was designed for describing object-oriented systems and, at the architectural design stage, you often want to describe systems at a higher level of abstraction.

4. Which of the following view shows that the system is composed of interacting processes at run time?
a) physical
b) development
c) logical
d) process
Answer: d
Explanation: This view is useful for making judgments about non-functional system characteristics such as performance and availability.

5. Which of the following is an architectural conflict?
a) Using large-grain components improves performance but reduces maintainability
b) Introducing redundant data improves availability but makes security more difficult
c) Localizing safety-related features usually means more communication so degraded performance
d) All of the mentioned
Answer: d
Explanation: High availability architecture can be affected by several design factors that are required to be maintained to ensure that no single points of failure exist in such design.

6. Which of the following is not included in Architectural design decisions?
a) type of application
b) distribution of the system
c) architectural styles
d) testing the system
Answer: d
Explanation: Architectural design decisions include decisions on the type of application, the distribution of the system, the architectural styles to be used, and the ways in which the architecture should be documented and evaluated.

7. Architecture once established can be applied to other products as well.
a) True
b) False
Answer: b
Explanation: Systems in the same domain often have similar architectures that reflect domain concepts.

8. Which of the following pattern is the basis of interaction management in many web-based systems?
a) architecture
b) repository pattern
c) model-view-controller
d) different operating system
Answer: c
Explanation: Model-View-Controller pattern is the basis of interaction management in many web-based systems.

9. What describes how a set of interacting components can share data?
a) model-view-controller
b) architecture pattern
c) repository pattern
d) none of the mentioned
Answer: c
Explanation: The majority of systems that use large amounts of data are organized around a shared database or repository.

10. Which view in architectural design shows the key abstractions in the system as objects or object classes?
a) physical
b) development
c) logical
d) process
Answer: c
Explanation: It is possible to relate the system requirements to entities in a logical view.

11. Which of the following examples is/are models of application architectures?
a) a means of assessing components for reuse
b) a design checklist
c) a vocabulary for talking about types of applications
d) all of the mentioned
Answer: d
Explanation: Application architectures encapsulate the principal characteristics of a class of systems.

12. ERP stands for
a) Enterprise Research Planning
b) Enterprise Resource Planning
c) Enterprise Resource Package
d) Enterprise Research Package
Answer: b
Explanation: None.

13. Which of the following type describes application architectures?
a) Transaction processing applications
b) Language processing systems
c) Client management systems
d) Transaction processing applications and Language processing systems
Answer: d
Explanation: Transaction processing applications are database-centered applications that process user requests for information and update the information in a database, while language processing systems are systems in which the user’s intentions are expressed in a formal language.

14. All the operations in a transaction need to be completed before the database changes are made ________
a) functional
b) available to the users
c) permanent
d) none of the mentioned
Answer: b
Explanation: This ensures that failure of operations within the transaction does not lead to inconsistencies in the database.

15. Systems that involve interaction with a shared database can be considered as.
a) software-based
b) transaction-based
c) server-based
d) client-based
Answer: b
Explanation: Such systems with a shared database are also referred to as transaction based information systems.

16. What translates a natural or an artificial language into another representation of that language and, for programming languages also execute the resulting code?
a) ERP systems
b) Transaction-based information systems
c) Language processing systems
d) None of the mentioned
Answer: c
Explanation: In software engineering, compilers translate an artificial programming language into machine code.

17. Properties of a system such as performance and security are independent of the architecture used.
a) True
b) False
Answer: b
Explanation: Properties such as performance, security, and availability are influenced by the architecture used.

18. Which of the following is/are commonly used architectural pattern(s)?
a) Model-View-Controller
b) Layered Architecture
c) Client–server
d) All of the mentioned
Answer: d
Explanation: Commonly used architectural patterns include Model-View-Controller, Layered Architecture, Repository, Client–server, and Pipe and Filter.

19. A language-processing systems may translate an XML data description into
a) a machine code
b) an alternative XML representation
c) machine code and alternative XML representation
d) a software module
Answer: c
Explanation: Such is the property and function of language processing system.

20. Transaction processing systems may be organized as a _________ architecture with system components responsible for input, processing, and output.
a) Repository
b) Client–server
c) Model-View-Controller
d) Pipe and Filter
Answer: d
Explanation: None.

21. URL is ___________
a) web address
b) source code
c) user’s address
d) an attribute
Answer: a
Explanation: URL is the second name of a web address. It is composed of IP (Internet Protocol) address or words. Its full form is Uniform Resource Locators. Generally entering name while surfing is easy as numbers are hard to remember.

22. What is the correct syntax of web address?
a) path://prefix.port:domain/filename/scheme
b) scheme://prefix.domain:port/path/filename
c) prefix://scheme.port:domain/filename/path
d) port://domain.filenmae:path/scheme/prefix
Answer: b
Explanation: The correct syntax for a web address is scheme://prefix.domain:port/path/filename, where scheme is for https or http, prefix is for domain like www, domain denotes domain name, port defines port number, path defines path at server, filename is for name of the document.

23. Which scheme is used for secure HyperText Transfer Protocol?
a) ftp
b) http
c) https
d) file
Answer: c
Explanation: https scheme is for secure or encrypted web pages, http is HyperText Transfer Protocol used for common web pages which are not encrypted, ftp is file transfer protocol for downloading and uploading of documents.

24. ASCII is _____________
a) 6-bit character set
b) 7-bit character set
c) 9-bit character set
d) 3-bit character set
Answer: b
Explanation: ASCII consists 7-bit character set which has 128 characters. There are numbers 0-9, upper and lower case letters from A-Z, and also include special characters. Including modern computers, internet these characters are used in HTML also.

25. In URL encoding replaces non-ASCII characters with ________
a) “*”
b) “&”
c) “%”
d) “+”
Answer: c
Explanation: In URL encoding non-ASCII characters are replaced with “%” which is followed by hexadecimal digits. URL can only contain ASCII character set. There should be no space in the URL, space is replaced by %20 or “+” in URL encoding.

26. Which function is used in JavaScript for URL encoding?
a) encodeURI()
b) Server.URLEncode()
c) rawurlencode()
d) UREncoding
Answer: a
Explanation: There are some built in functions in JavaScript, ASP and PHP for URL encoding. JavaScript use encodeURI() function. ASP uses Server.URLEncode() function, rawurlencode() function is used by PHP. Space is encoded as %20 by JavaScript function.

27. What is URL encode of ‘&’?
a) %24
b) %2c
c) %3d
d) %26
Answer: d
Explanation: URL encoding of ‘&’ is %26, its Decimal value is 38 and the Hex value is 26. %24 is URL encode of ‘$’ whose Decimal value is 36 and Hex value is 24, %2c is URL encode of ‘,’ its Decimal value is 44 and Hex value is 2c, %3d is URL encode of ‘=’, its Decimal value is 61 and Hex value is 3d.

28. Which of the following is not a reserved character?
a) &
b) >
c) +
d) @
Answer: b
Explanation: Reserved characters are ‘@’, ‘=’, ‘?’, ‘:’, ‘;’, ‘/’, ‘,’, ‘+’, ‘$’, ‘&’. Unsafe characters are space, ‘”’, ‘>’, ‘<’, ‘#’, ‘%’, ‘{‘, ‘}’, ‘~’, ‘^’, ‘[‘, ‘|’, ‘\’, ‘`’, ‘]’. There is a URL Encode for all of these characters. Apart from URL Encode there is Decimal and Hex value also for the characters.

29. What is the URL Encode for tab character?
a) %09
b) %08
c) %0d
d) %0a
Answer: a
Explanation: For tab character URL encode is %09, its Decimal value is 9 and Hex value is 09, %08 is URL encode for backspace, its Decimal value is 8 and Hex value is 08, %0d is URL Encode for carriage return, Decimal value is 13 and Hex value is 0d, %0a is URL encode for linefeed, Decimal value is 10 and Hex value is 0a.

30. Which of the following is not encode by encodeURI() function?
a) >
b) [
c) \
d) :
Answer: d
Explanation: encodeURI() function is JavaScript function. It encodes special characters. The characters that can’t be encoded are ‘,’, ‘?’, ‘/’, ‘@’, ‘=’, ‘&’, ‘$’, ‘+’, ‘#’, ‘:’. Its syntax is encodeURI(uri), uri is the URI that to be encoded.

31. The entire hostname has a maximum of ___________
a) 255 characters
b) 127 characters
c) 63 characters
d) 31 characters
Answer: a
Explanation: An entire hostname can have a maximum of 255 characters. Although each label must be from 1 to 63 characters long. Host name is actually a label that is given to a device in a network.

32. A DNS client is called _________
a) DNS updater
b) DNS resolver
c) DNS handler
d) none of the mentioned
Answer: b
Explanation: DNS client also known as DNS resolver also known as DNS lookup helps to resolve DNS requests using an external DNS server.

33. Servers handle requests for other domains _______
a) directly
b) by contacting remote DNS server
c) it is not possible
d) none of the mentioned
Answer: b
Explanation: Whenever a request is received at server from other domains, it handles this situation by contacting remote DNS server.

34. DNS database contains _______
a) name server records
b) hostname-to-address records
c) hostname aliases
d) all of the mentioned
Answer: d
Explanation: Domain Name system not only deals with mapping IP addresses with the hostname but also deals with exchange of information in the server.

35. If a server has no clue about where to find the address for a hostname then _______
a) server asks to the root server
b) server asks to its adjcent server
c) request is not processed
d) none of the mentioned
Answer: a
Explanation: Root name servers are actually very important and critical as they are the first step in translating human readable hostnames into IP addresses for carrying out communication.

36. Which one of the following allows client to update their DNS entry as their IP address change?
a) dynamic DNS
b) mail transfer agent
c) authoritative name server
d) none of the mentioned
Answer: a
Explanation: Dynamic DNS or in short DDNS or DynDNS helps in automatically updating a name server in the DNS. This does not require manual editing.

37. Wildcard domain names start with label _______
a) @
b) *
c) &
d) #
Answer: b
Explanation: A wildcard DNS record matches requests to a non existent domain name. This wildcard DNS record is specified by using asterisk “*” as the starting of a domain name.

38. The right to use a domain name is delegated by domain name registers which are accredited by _______
a) internet architecture board
b) internet society
c) internet research task force
d) internet corporation for assigned names and numbers
Answer: d
Explanation: The ICANN (Internet Corporation for Assigned Names and Numbers) deals with IP address space allocation, protocol identifier assignment, generic and country code Top Level domain name system management (gTLD and ccTLD).

39. The domain name system is maintained by _______
a) distributed database system
b) a single server
c) a single computer
d) none of the mentioned
Answer: a
Explanation: A domain name system is maintained by a distributed database system. It is a collection of multiple, logically interrelated databases distributed over a computer network.

40. Which one of the following is not true?
a) multiple hostnames may correspond to a single IP address
b) a single hostname may correspond to many IP addresses
c) a single hostname may correspond to a single IP address
d) none of the mentioned
Answer: c
Explanation: It need not be that a single hostname will correspond to a ip address. For example facebook.com and fb.com both correspond to same ip address. So there can be multiple hostnames for a single ip address.

41. Multiple objects can be sent over a TCP connection between client and server in a persistent HTTP connection.
a) True
b) False
Answer: a
Explanation: Persistent connections are kept active after completing transaction so that multiple objects can be sent over the same TCP connection.

42. HTTP is ________ protocol.
a) application layer
b) transport layer
c) network layer
d) data link layer
Answer: a
Explanation: HTTP is an Application layer protocol used to define how messages are formatted and transmitted through the World Wide Web.

43. In the network HTTP resources are located by
a) uniform resource identifier
b) unique resource locator
c) unique resource identifier
d) union resource locator
Answer: a
Explanation: The Uniform Resource Identifier is a name and locator for the resource to be located by the HTTP. The URLs and URNs are derived through the identifier.

44. HTTP client requests by establishing a __________ connection to a particular port on the server.
a) user datagram protocol
b) transmission control protocol
c) border gateway protocol
d) domain host control protocol
Answer: b
Explanation: HTTP clients perform requests using a TCP connection, because the TCP connection provides a more reliable service. UDP is not a reliable protocol, border gateway protocol is used on top of TCP, while domain host control protocol is a network layer protocol.

45. In HTTP pipelining ________________
a) multiple HTTP requests are sent on a single TCP connection without waiting for the corresponding responses
b) multiple HTTP requests can not be sent on a single TCP connection
c) multiple HTTP requests are sent in a queue on a single TCP connection
d) multiple HTTP requests are sent at random on a single TCP connection
Answer: a
Explanation: HTTP pipelining helps the client make multiple requests without having to waiting for each response, thus saving a lot of time and bandwidth for the client.

46. FTP server listens for connection on port number ____________
a) 20
b) 21
c) 22
d) 23
Answer: b
Explanation: Port 20 is used for FTP data. Port 22 is used for SSH remote login. Port 23 is used for TELNET.

47. In FTP protocol, client contacts server using ____ as the transport protocol.
a) transmission control protocol
b) user datagram protocol
c) datagram congestion control protocol
d) stream control transmission protocol
Answer: a
Explanation: The clients use the Transmission Control Protocol for FTP as it’s more reliable than UDP, DCCP, and SCTP, and reliability of file transfer is required to be as high as possible for FTP.

48. In Active mode FTP, the client initiates both the control and data connections.
a) True
b) False
Answer: b
Explanation: In Passive mode of FTP, the client initiates both data and control connections, while in Active mode, the client initiates the control connection and then the server initiates the data connection.

49. The File Transfer Protocol is built on ______________
a) data centric architecture
b) service oriented architecture
c) client server architecture
d) connection oriented architecture
Answer: c
Explanation: The FTP connection includes a Server and a Client which wish to share files. The server can have multiple clients at the same time while the client communicates with only one server at a time.

50. In File Transfer Protocol, data transfer cannot be done in ___________
a) stream mode
b) block mode
c) compressed mode
d) message mode
Answer: d
Explanation: In Stream mode, the data is transferred in a continuous stream. In Block mode, data is transferred after being divided into smaller blocks. In Compressed mode, data is transferred after being compressed using some compression algorithm

51. Which of the following selector selects all elements of E that have the attribute attr that end with the given value?
a) E[attr^=value]
b) E[attr$=value]
c) E[attr*=value]
d) none of the mentioned
Answer: b
Explanation:
Example: p[title$=“!”] {color: red;}

52. Which of the following selector selects the elements that are checked?
a) E ~ F
b) ::after
c) :checked
d) none of the mentioned
Answer: c
Explanation:
Example: :checked {color: blue;}

53. Which of the following selector selects the elements that are the default among a set of similar elements?
a) :defaultb)
b)   : %
c) :disabled
d) none of the mentioned
Answer: a
Explanation:
Example: :default {background-color: red;}

54. Which of the following selector selects an element that has no children?
a) :empty
b) :nochild
c) :inheritance
d) :no-child
Answer: a
Explanation: None.

55. Which of the following selector selects the elements that are currently enabled?
a) :element
b) :empty
c) :enabled
d) none of the mentioned
Answer: c
Explanation:
Example: input:enabled {background-color:white;}

56. Which of the following selector selects the element that is the first child of its parent that is of its type?
a) :first-of-type
b) :last-child
c) ::first-line
d) ::first-letter
Answer: a
Explanation:
Example: strong:first-of-type {font-size:bigger;}

57. Which of the following selector selects elements that do not match the selector s?
a) :!(s)
b) :nth-child(s)
c) :not(s)
d) none of the mentioned
Answer: c
Explanation:
Example: *:not(h1) {color: black;}

58. Which of the following selector selects an element if it’s the only child of its parent?
a) :root
b) :nth-oftype
c) :only-child
d) none of the mentioned
Answer: c
Explanation:
Example: h1:only-child {color: blue;}

59. Which of the following selector selects the element that is the target of a referring URI?
a) :target
b) :selection
c) ::selection
d) :URI
Answer: a
Explanation:
Example: :target{color:red;}

60. Which of the following selector applies styles to elements that are valid per HTML5 validations set either with the pattern or type
attributes?
a) :valid
b) :required
c) :optional
d) :invalid
Answer: a
Explanation:
Example: :valid {color: green;}

61. What type of selector is used in this case?
p {line-height: 150%;}

a) class Selectors
b) element Selectors
c) id Selectors
d) none of the mentioned
Answer: b
Explanation: These selectors are called element selectors and are simply used
as follows: element-name { /* properties */ }

62. By applying an ___________ a style can be applied to just a single tag.
a) class rule
b) element rule
c) id rule
d) none of the mentioned
Answer: c
Explanation: By applying an id rule, a style can be applied to just a single tag. For example, if we name a tag with a unique id attribute as follows

<tag id=“id-value”>Affected Text</tag>

3. The _____________ attribute is used to define the name(s) of the class(es) to which a particular tag belongs.
a) class
b) element
c) id
d) none of the mentioned
Answer: a
Explanation: Self-explainatory.

64. What will be the output of below mentioned code snippet?
p strong {background-color: yellow;}

a) Strong have yellow background
b) Strong element within a p element have a yellow background
c) Both p and strong have yellow background
d) None of the mentioned
Answer: b
Explanation: All occurrences of the strong element within a p element have a yellow background.

65. A similar rule called the ____________ is specified using the plus sign (+) and is used to select elements that would be siblings of each other.
a) class selectors
b) attribute selectors
c) adjacent-sibling selector
d) none of the mentioned
Answer: c
Explanation: Self-explainatory.

66. Which of the following selectors selects any tag with an id attribute set?
a) E#id
b) .class
c) #id
d) *
Answer: c
Explanation: Example:#test {color: green;}
/* makes a tag with id=’test’ green */

67. Which of the following selectors selects direct descendents?
a) E &gt; F
b) E F
c) E + F
d) E ~ F
Answer: a
Explanation: Example:
body > p {background-color: yellow;}

/* makes all p tags that have the
body tag as their immediate parent
have the background color yellow */

68. Which of the following selectors selects siblings?
a) E.class
b) E ~ F
c) *
d) E, F, G
Answer: b
Explanation: Example:
p ~ strong {font-style: italic;}

/* sets the font style to italic on
all strong tags that have a p tag
as a preceding sibling */

69. Which of the following selectors selects the specified elements of type E with a particular class value?

a) E.class
b) E ~ F
c) *
d) E, F, G

Answer: a
Explanation: Example:
h1.note {text-decoration: underline;}

/* underlines all h1 tags with
class='note' */

70. Which of the following selectors selects adjacent siblings?

a) E &gt; F
b) E F
c) E + F
d) E ~ F

Answer: c
Explanation: Example:

h1 + p {color: red;}
/* makes all p tags that are
immediately preceded by an h1 tag
red */

71. The unordered collection of properties, each of which has a name and a value is called _________
a) String
b) Object
c) Serialized Object
d) Array
Answer: b
Explanation: Objects in JavaScript may be defined as an unordered collection of related data, of primitive or reference types, in the form of “key:value” pairs. Hence each of the property has a name and value.

72. The object has three object attributes namely ________
a) Class, parameters, object’s extensible flag
b) Prototype, class, objects’ parameters
c) Prototype, class, object’s extensible flag
d) Native object, Classes and Interfaces and Object’s extensible flag
Answer: c
Explanation: Every object has three associated object attributes:

  1. An object’s prototype is a reference to another object from which properties are inherited.
  2. An object’s class is a string that categorizes the type of an object.
  3. An object’s extensible flag specifies whether new properties may be added to the object.

73. What will be the firstname and surname of the following JavaScript code?
var book = {

              "main title": "JavaScript", 
              'sub-title': "The Definitive Guide", 
              "for": "all audiences", 
              author: { 
                         firstname: "David", 
                         surname: "Flanagan" 
                      }
           };

a) properties
b) property values
c) property names
d) objects
Answer: c
Explanation: The above code snippet contains an object inside another object. firstname and surname are the property names. The value of that particular property is itself an object.

74. A linkage of series of prototype objects is called as ________
a) prototype stack
b) prototype chain
c) prototype class
d) prototypes
Answer: b
Explanation: Consider an example, Date.prototype inherits properties from Object.prototype, so a Date object created by new Date() inherits properties from both Date.prototype and Object.prototype. This linked series of prototype objects is known as prototype chain.

75. In the following syntax, the data type within the square brackets must be ___________
book[datatype]=assignment_value;

a) An integer
b) A String
c) An object
d) Floating point
Answer: b
Explanation: The value inside the square bracket is used to access that data element or the property of the object. When using square bracket notation, the expression inside the square brackets must evaluate to a string or a value that can be converted to a string.

76. To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________
a) isPrototypeOf() method
b) equals() method
c) === operator
d) ==opertor
Answer: a
Explanation: Prototype is a global property which is available with almost all the objects. To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the isPrototype() method. To find out if p is the prototype of o write p.isPrototypeOf(o).

77. What is the prototype represents in the following JavaScript code snippet?
function f() {};

a) Function f
b) A custom constructor
c) Prototype of a function
d) Not valid
Answer: b
Explanation: All object instances have a constructor property that point to the constructor function that created it. A custom constructor is a constructor which requires no arguments and is created automatically by the compiler at the time of object creation if not created by the user.

78. The purpose of extensible attribute is to __________
a) make all of the own properties of that object non configurable
b) to configure and bring a writable property
c) “lock down” objects into a known state and prevent outside tampering
d) to include new properties into the object
Answer: c
Explanation: Extensible attributes determines whether the object can have new properties or not. Therefore extensible attribute will allow an object to include and write properties into them.

79. Identify the process done in the following JavaScript code snippet?
o = {x:1, y:{z:[false,null,“”]}}; s = JSON.stringify(o); p = JSON.parse(s);

a) Object Encapsulation
b) Object Serialization
c) Object Abstraction
d) Object Encoding
Answer: b
Explanation: Object serialization is the process of converting an object’s state to a string from which it can later be restored. The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string.

80. The basic purpose of the toLocaleString() is to _________
a) return a localised object representation
b) return a parsed string
c) return a local time in the string format
d) return a localized string representation of the object
Answer: d
Explanation: .toLocaleString is a predefined function in javascript which is used to return a localized string representation of the object. For example the date.toLocaleString() is an inbuilt function in JavaScript which is used to convert a date and time to a string.

81. What is the reason for avoiding the attributes property in the HTML DOM?
a) Found unnecessary
b) Attributes don’t have attributes
c) Attributes have attributes
d) Considered irrelevant
Answer: b
Explanation: When a web page is loaded, the browser creates a Document Object Model of the page. The reason for avoiding the attributes property in the HTML DOM is because Attributes don’t have attributes.

82. What is the purpose of the method nodeMap.setNamedItem()?
a) Sets ID
b) Sets attribute node
c) Sets element name
d) Sets element type
Answer: b
Explanation: The setNamedItem() method adds the specified node to the NamedNodeMap. The method nodeMap.setNamedItem() sets the specified attribute node (by name).

83. How is everything treated in HTML DOM?
a) Node
b) Attributes
c) Elements
d) Arrays
Answer: a
Explanation: The HTML DOM model is constructed as a tree of Objects. In the HTML DOM (Document Object Model), everything is a node:

  • The document itself is a document node.
  • All HTML elements are element nodes.
  • All HTML attributes are attribute nodes.
  • Text inside HTML elements are text nodes.
  • Comments are comment nodes.

84. What does the NamedNodeMap object represent in the HTML DOM?
a) Unordered collection of elements
b) Unordered collection of attributes
c) Unordered collection of nodes
d) Unordered collection of arrays
Answer: d
Explanation: In the HTML DOM, the NamedNodeMap object represents an unordered collection of an elements attribute nodes. The nodes in the NamedNodeMap can be accessed through their name.

85. What is the purpose of the Attr object in the HTML DOM?
a) Used to focus on a particular part of the HTML page
b) HTML Attribute
c) Used to arrange elements
d) CSS attribute
Answer: b
Explanation: When a web page is loaded, the browser creates a Document Object Model of the page. In the HTML DOM, the Attr object represents an HTML attribute.

86. What is the work of the form control elements in the HTML DOM?
a) User Interface elements
b) All the possible elements
c) Debugging elements
d) Collecting elements
Answer: a
Explanation: Form control elements: The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes. The elements collection returns a collection of all elements in a form.

87. How are the objects organized in the HTML DOM?
a) Class-wise
b) Queue
c) Hierarchy
d) Stack
Answer: c
Explanation: The HTML DOM model is constructed as a tree of Objects. The objects are organized in the hierarchy format in the HTML DOM.

88. Which of the following is a type of HTML DOM?
a) Legacy DOM
b) W3C DOM
c) IE4 DOM
d) All of the mentioned
Answer: d
Explanation: IE4 document object model was introduced in Version 4 of Microsoft’s Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features. All of the above mentioned are types of HTML DOM.

89. What is the purpose of the Legacy DOM?
a) Makes the scripting easier
b) Allows access to few keys and elements
c) Modify the nodes
d) Making the script modular
Answer: b
Explanation: The Legacy DOM: This is the model which was introduced in early versions of JavaScript language. It is well supported by all browsers but allows access only to certain key portions of documents, such as forms, form elements, and images.

90. Which object is the top of the hierarchy?
a) Window Object
b) Document Object
c) Form Object
d) Form Control Elements
Answer: a
Explanation: The DOM is arranged in the form of tree with every node as an object. Window object is the top of the hierarchy. It is the outmost element of the object hierarchy.

91. The type that specifies what kind of event occurred is ____________
a) event type
b) even target
c) both event type and even target
d) interface
Answer: a
Explanation: The event type is a string that specifies what kind of event occurred. The type “mousemove”, for example, means that the user moved the mouse.

92. Which is the object on which the event occurred or with which the event is associated?
a) event type
b) event target
c) both event type and even target
d) interface
Answer: b
Explanation: The event target is the object on which the event occurred or with which the event is associated. When we speak of an event, we must specify both the type and the target. The target property of the Event interface is a reference to the object that dispatched the event.

93. In general, event handler is nothing but ____________
a) function
b) interface
c) event
d) handler
Answer: a
Explanation: An event handler is in general, a function that handles or responds to an event. For example onclick, onkeypress, onload etc are event handler functions.

94. When will the browser invoke the handler?
a) Program begins
b) Any event occurs
c) Specified event occurs
d) Webpage loads
Answer: c
Explanation: When an event of the specified type occurs on the specified target, the browser invokes the handler. For example onclick function is executed when mouse is clicked.

95. Which property specifies the property of the event?
a) Type
b) Target
c) Manner
d) Program
Answer: a
Explanation: All event objects have a type property that specifies the event type. Event type is a string that specifies what kind of event occurred.

96. The process by which the browser decides which objects to trigger event handlers on is ____________
a) Event Triggering
b) Event Listening
c) Event Handling
d) Event propagation
Answer: d
Explanation: Event propagation is the process by which the browser decides which objects to trigger event handlers. Event propagation is a way to describe the “stack” of events that are fired in a web browser.

97. Which form of event propagation handles the registered container elements?
a) Event Propagation
b) Event Registration
c) Event Capturing
d) Default Actions
Answer: c
Explanation: Event bubbling and capturing are two ways of event propagation in the HTML DOM API. With bubbling, the event is first captured and handled by the innermost element and then propagated to outer elements. With capturing, the event is first captured by the outermost element and propagated to the inner elements.

98. The events that are directly tied to a specific input device are ____________
a) Device-independent input events
b) Device-dependent input events
c) User interface events
d) State change events
Answer: b
Explanation: These are events that are directly tied to a specific input device, such as the mouse or keyboard) They include legacy event types such as “mousedown”, “mousemove”, “mouseup”, “keydown”, “keypress”, and “keyup” and also new touch specific events like “touchmove” and “gesturechange”.

99. The high-level events among the following events are ____________
a) User interface events
b) Device-independent events
c) Device-dependent events
d) Stage event change
Answer: a
Explanation: UI events are higher-level events, often on HTML form elements that define a user interface for a web application. They include the focus event (when a text input field gains keyboard focus), the change event when the user changes the value displayed by a form element, and the submit event when the user clicks a Submit button in a form.

100. The events that are not directly tied to a specific input device are _____________
a) User interface events
b) Device-independent events
c) Device-dependent events
d) Stage event change
Answer: b
Explanation: These are input events that are not directly tied to a specific input device. The click event, for example, indicates that a link or button (or other document element) has been activated) This is often done via a mouse click, but it could also be done by keyboard or (on touch-sensitive devices) by gesture.

101. In which part does the form validation occur?
a) Client
b) Server
c) Both Client and Server
d) User side
Answer: b
Explanation: The data information from the client side is first sent to the server side. Form validation used to occur at the server after the client had entered all necessary data and then pressed the Submit button.

102. What would happen if the data in the client had been wrong?
a) Sends back the data
b) Waits for correction
c) Sends back the data and Waits for correction
d) Returns the data instantly
Answer: c
Explanation: The only way to obtain data is from the server side which is used to perform further operations on the data. If some of the data that had been entered by the client had been in the wrong form or was simply missing, the server would have to send all the data back to the client and request that the form is resubmitted with correct information.

103. What is the purpose of the basic validation?
a) Data correctness
b) Mere data existence
c) Both Data correctness and Mere data existence
d) Data modification
Answer: b
Explanation: The data entered through the server side is used for validation. First of all, the form must be checked to make sure data was entered into each form field that required it. This would need just loop through each field in the form and check for data.

104. What is the purpose of data format validation?
a) Data correctness
b) Mere data existence
c) Both Data correctness and Mere data existence
d) Data modification
Answer: a
Explanation: The data entered through the server side is used for validation. The data that is entered must be checked for correct form and value. This would need to put more logic to test the correctness of data.

105. Which is the function that is called to validate a data?
a) validate()
b) valid()
c) validation()
d) no predefined function for data validation
Answer: d
Explanation: There is no such function to validate a data but, you can write a function with any name to validate the data. Hence there is no predefined function for data validation.

106. How to find the index of a particular string?
a) position()
b) index()
c) indexOf()
d) positionof()
Answer: c
Explanation: The indexOf() function can be used to find out the index of a particular character or a string. This method return an integer telling the address of the particular character.

107. How do you focus a particular part of the HTML page in JavaScript?
a) hover()
b) focus()
c) on()
d) focuson()
Answer: b
Explanation: The focus() function can be used to focus a particular part of the HTML page in JavaScript. It sets the element as the active element in the current document. It can be applied to one html element at a single time in a current document.

108. Which of the following is the child object of the JavaScript navigator?
a) Navicat
b) Plugins
c) NetRight
d) Plugs
Answer: b
Explanation: The JavaScript navigator object is used for browser detection. The JavaScript navigator object includes a child object called plugins.

109. Which of the following is not the properties of a plug-in entry?
a) name
b) filename
c) mimeTypes
d) value
Answer: d
Explanation: Plugins are reusable portions of code which help you write even less Javascript to achieve specific features on the client side. Each plug-in has an entry in the array. Each entry has the following properties:

  • name – is the name of the plug-in.
  • filename – is the executable file that was loaded to install the plug-in.
  • description – is a description of the plug-in, supplied by the developer.
  • mimeTypes – is an array with one entry for each MIME type supported by the plug-in.

110. What is the purpose of the mimeTypes property of a plug-in entry?
a) Contains MIME properties
b) Contains MIME sizes
c) Contains MIME types
d) Contains MIME methods
Answer: c
Explanation: MIME stands for Multi-purpose Internet Mail Extensions. mimeTypes is an array with one entry for each MIME type supported by the plug-in.

111. Cookies were originally designed for __________
a) Client-side programming
b) Server-side programming
c) Both Client-side & Server-side programming
d) Web programming
Answer: b
Explanation: Cookies are data, stored in small text files, on your computer. Cookies were originally designed for server-side programming, and at the lowest level, they are implemented as an extension to the HTTP protocol.

112. The Cookie manipulation is done using which property?
a) cookie
b) cookies
c) manipulate
d) modify
Answer: a
Explanation: The cookie property sets or returns all name/value pairs of cookies in the current document. There are no methods involved: cookies are queried, set, and deleted by reading and writing the cookie property of the Document object using specially formatted strings.

113. Which of the following explains Cookies nature?
a) Non Volatile
b) Volatile
c) Intransient
d) Transient
Answer: d
Explanation: Cookies are transient by default; the values they store last for the duration of the web browser session but are lost when the user exits the browser. When a web server has sent a web page to a browser, the connection is shut down, and the server forgets everything about the user.

114. Which attribute is used to extend the lifetime of a cookie?
a) higher-age
b) increase-age
c) max-age
d) lifetime
Answer: c
Explanation: If you want a cookie to last beyond a single browsing session, you must tell the browser how long (in seconds) you would like it to retain the cookie by specifying a max-age attribute. A number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately.

115. Which of the following defines the Cookie visibility?
a) domain Path
b) local & session storage
c) server storage
d) transient Path
Answer: b
Explanation: sessionStorage, localStorage and Cookies all are used to store data on the client-side. Each one has its own storage and expiration limit. Cookie visibility is scoped by document origin as localStorage and sessionStorage are, and also by document path.

116. Which of the following can be used to configure the scope of the Cookie visibility?
a) path
b) domain
c) both path and domain
d) server
Answer: c
Explanation: The Cookie visibility scope is configurable through cookie attributes path and domain. Domain attribute in the cookie is used to specify the domain for which the cookie is sent.path includes the Path attribute in the cookie to specify the path for which this cookie is sent.

117. How can you set a Cookie visibility scope to localStorage?
a) /
b) %
c) *
d) //
Answer: a
Explanation: Setting the path of a cookie to “/” gives scoping like that of localStorage and also specifies that the browser must transmit the cookie name and value to the server whenever it requests any web page on the site.

118. Which of the following is a boolean cookie attribute?
a) bool
b) secure
c) lookup
d) domain
Answer: b
Explanation: The final cookie attribute is a boolean attribute named secure that specifies how cookie values are transmitted over the network. By default, cookies are insecure, which means that they are transmitted over a normal, insecure HTTP connection. If a cookie is marked secure, however, it is transmitted only when the browser and server are connected via HTTPS or another secure protocol.

119. Which of the following function is used as a consequence of not including semicolons, commas or whitespace in the Cookie value?
a) encodeURIComponent()
b) encodeURI()
c) encodeComponent()
d) encode()
Answer: a
Explanation: Cookie values cannot include semicolons, commas, or whitespace. For this reason, you may want to use the core JavaScript global function encodeURIComponent() to encode the value before storing it in the cookie.

120. What is the constraint on the data per cookie?
a) 2 KB
b) 1 KB
c) 4 KB
d) 3 KB
Answer: c
Explanation: Each cookie can hold up to only 4 KB. In practice, browsers allow many more than 300 cookies total, but the 4 KB size limit may still be enforced by some. Whereas storage of session is around a minimum of 5mb.

 

Module 02

1. Which element is used to define a discrete unit of content such as a blogpost, comment, and so on?
a) section
b) class
c) article
d) media
Answer: c
Explanation: Sections in document is made by the section tag. The class attribute specifies one or more class names to HTML. An article element is semantic element and it contains a standalone piece of content that would make sense if syndicated as an RSS item, for example a news item.

2. HTML5 documents may contains a ___________ element, which is used to set the header section of a document.
a) header
b) footer
c) section
d) drive
Answer: a
Explanation: Section element is used to make sections in document. The copyright/footer information is provided by footer element in HTML5. A header for document section is given by header element. The header tag is used to contain the header content of a site.

3. Which element may be used within content to represent material that is tangential?
a) aside
b) cite
c) article
d) class
Answer: a
Explanation: <cite> tag defines the title of work. The class attribute specifies one or more class names to HTML. An article tag is similar to <section> or <header> which contains information. The aside tag defines a block of content that is related to the main content around it, but not central to the flow of it.

4. ____________ contains the navigation menu, or other navigation functionality for the page.
a) section
b) header
c) nav
d) aside
Answer: c
Explanation: The nav element is for marking up the navigation links or other constructs (eg a search form) that will take you to different pages of the current site, or different areas of the current page. Header contains section of headings. Section element is used to make sections in document. The aside tag defines a block of content that is related to the main content around it, but not central to the flow of it.

5. Which of the following attribute is used to display date/time content?
a) time
b) datetime
c) date
d) year
Answer: b
Explanation: To provide both human and machine-friendly date/time content, the element supports a datetime attribute, which should be set to the previously mentioned date format of YYYY-MM-DDThh:mm:ssTZD. Time tag defines date and time (human readable) while datetime tag display machine readable date/time.

6. The element ___________ simply groups items within an enclosed dd tag, though it may associate them with a caption defined by a dt tag.
a) object
b) figure
c) embed
d) collect
Answer: a
Explanation: HTML documents are delivered as “documents”.These are then parsed, which turns them into the Document Object Model (DOM) internal representation, within the web browser. A self-contained information like images, diagrams are specified by figure tag in HTML. External applications are embed using embed tag.

7. Which of the following element is used for highlighting content similarly to how a highlighter pen might be used on important text in a book?
a) em
b) strong
c) mark
d) bold
Answer: c
Explanation: <em> tag convert the font in italic one. The <strong> tag is used to denote the importance of text. <bold> tag is used to make the text bold in font size. The mark tag defines marked text and is used to highlight parts of your text.

8. To insert a video, we use a video tag and set its src attribute to a local or remote URL containing a playable movie.
a) True
b) False
Answer: a
Explanation: To show a video in HTML, video element is used. One of the attribute of video called src is used to provide the location of video i.e. it’s URL address.

9. Which tag is used to encapsulate navigation and then style the elements appropriately as menu items?
a) ul
b) li
c) nav
d) both ul and li
Answer: d
Explanation: Conventionally, many web developers have use <ul></ul> and <li></li> tags to encapsulate navigation and then styled the elements appropriately as menu items. This seems to introduce quite a bit of ambiguity in markup because it may be difficult to determine the difference between a list that has links in it and a list that is simply navigation.

10. Which feature was already introduced before HTML5?
a) Canvas/SVG
b) Video
c) Geolocation
d) Frames
Answer: d
Explanation: Until recently you could not draw on the web and graphics were not very interactive but canvas/SVG which were introduced by HTML5 solved all the problems. Video, Geolocation were also new features introduced by HTML5. Frames were already there before the launch of HTML5.

11. Which tag is used with JavaScript?
a) <canvas>
b) <table>
c) <article>
d) <footer>
Answer: a
Explanation: <canvas> tag is basically used for graphics via scripting i.e. usually with Java Script (scripting language, basically used to create animations). Other tags like <table>, <article>, <footer> can be used simply with HTML.

12. What application can one create even before the introduction of HTML5?
a) Web applications
b) Mobile applications
c) Forms
d) Browser based games
Answer: c
Explanation: With the help of HTML5 and JavaScript it became possible to create excellent mobile applications, browser based games, web applications and many more other applications. Forms were already introduced before HTML5.

13. What is the correct syntax of doctype in HTML5?
a) <!doctype html>
b) <doctype html!>
c) <doctype html>
d) </doctype html>
Answer: a
Explanation: The correct syntax of HTML5 doctype is <!doctype html>, doctype is the very first thing to write in HTML5. <!doctype html> or <!DOCTYPE HTML> both are same because ‘doctype’ keyword is not case sensitive.

14. What if one does not use the doctype in the starting of HTML document?
a) Browser finds the document in quirky mode
b) Browser finds a document in standard mode
c) Browser stops working
d) Browser crashes after showing the page
Answer: a
Explanation: If the browser finds <!doctype html> in the starting of an HTML document it sets the document in standard mode but if one does not use a doctype, the browser goes to quirky mode. In this mode, certain content will not be displayed as per one wrote that. So it is always recommended to write a doctype at the very start of the HTML document.

15. Which of the following is not semantic element for text in HTML5?
a) <mark>
b) <time>
c) <wbr>
d) <article>
Answer: d
Explanation: Semantic elements used for text are <mark>, <time>, <wbr> whereas <article>, <aside>, <figure>, <footer>, <header> etc. are the semantic elements for structuring a page in HTML5.

16. Which tag supports Non-English language?
a) <input>
b) <audio>
c) <embed>
d) <bdo>
Answer: d
Explanation: <bdo>, <rp>, <rt>, <ruby> are some tags which support Non-English language. <input> is for web forms and <audio>, <embed> are the tags for audio and plug-ins.

17. Which element was not removed by HTML5?
a) <strike>
b) <center>
c) <small>
d) <big>
Answer: c
Explanation: Although HTML5 adds new elements, it also kicked out some old elements like <big>, <center>, <font>, <tt>, <strike>. HTML5 adapted many elements also <small> is one among these. The <small> element represents “small print”.

18. Which of the following defines the title of a work?
a) <cite>
b) <hr>
c) <a>
d) <address>
Answer: a
Explanation: The <cite> tag defines the title of a work. The <hr> tag is used to give a horizontal break. When we want to link one page to another, then <a> tag is used. The <address> tag is used to define the contact information about owner of document.

19. Which element is design to wrap a single piece of information?
a) <time>
b) <nav>
c) <footer>
d) <header>
Answer: a
Explanation: <time> tag wrap single piece of information i.e. it defines date, month and year. The <nav> element identifies a set of navigation links, <footer> is introduced in HTML5 which is present at the end of page and do conatins footer information i.e copyright information.

20. What an article element should not contain?
a) Main element
b) Text or embedded content
c) Image
d) Video & Audio
Answer: a
Explanation: The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element. The article element may contain audio/video clips, images and also text or embedded content.

21. Which of the following statement is true?
a) Canvas Contains built-in animations
b) SVG needs scripts to draw elements
c) In canvas, drawing is done with pixels
d) SVG don’t support to event handlers
Answer: c
Explanation: In SVG drawing is done with vectors and it support event handlers. Canvas doesn’t contains any built-in-animations and drawing is done with pixels.

22. What does <main> include?
a) Header
b) Sidebar
c) Article
d) Footer
Answer: c
Explanation: <header> element contains navigation links. Slidebar is for hoverable/sliding text. <footer> is introduced in HTML5 which is present at the end of page and do contains footer information i.e copyright information. Main content is the entire article which wraps the <article> element. It holds the page’s main content. It can be useful for screen readers. E.g. <main> <article>…………</article> </main>

23. Which of the following is not sectioning elements?
a) <article>
b) <aside>
c) <nav>
d) <header>
Answer: d
Explanation: The <section> element represents a section of a document or application. Tags like <article>, <aside>, <nav>, <section> are the ones that create a nested, new outline inside the page.

24. How many times can HTML5 events be fired?
a) Multiple
b) One
c) Only two
d) Zero
Answer: a
Explanation: We can call events like drag, ondragover, etc multiple times in HTML5.

25. Which element is used to get highlighted text in HTML5?
a) <highlight>
b) <b>
c) <mark>
d) <u>
Answer: c
Explanation: The <mark> element is used to highlight a section of text. It is useful for quoting a text or if one wants to bring attention to the text. The <b> tag is used to make text/paragraph bold. <u> tag is used to underline the text you wanted.

26. Which protocol is supported by Android browsers?
a) HTTPS
b) HLS
c) RTMP
d) FTP
Answer: b
Explanation: HTTPS i.e. Hypertext Transfer Protocol Secure is used on internet. HLS which stands for Hypertext Transfer Protocol Live Streaming invented by Apple Inc., a new streaming protocol which is supported by android browsers. RTMP stands for Real-Time Messaging Protocol, FTP stands for File Transfer Protocol.

27. __________ is a JavaScript library that implements the most common user interface elements and interactions like sliders, accordions, tabs, and so on.
a) JavaScript
b) JQuery UI
c) VTS
d) JCL
Answer: b
Explanation: JQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. JavaScript is a scripting language. VTS is a powerful rendering engine browser for JavaScript. JCL is Job Control Language which is also named as scripting language.

28. In HTML Audio/Video DOM, __________ sets or returns whether the audio/video should be loaded when the page loads.
a) preload
b) autoplay
c) buffered
d) controller
Answer: a
Explanation: Autoplay, preload, buffered, controller etc are the different kinds of attribute of video/audio element. Using autoplay, video/audio automatically begins to play. The preload property allows the author to provide a hint to the browser about what he/she thinks will lead to the best user experience. This attribute may be ignored in some instances.

29. Which of the following is not a HTML5 tag?
a) <video>
b) <source>
c) <track>
d) <slider>

Answer: d
Explanation: <video> tag is used to display video clips in HTML5. Multiple media resources for media elements is specified by <source> tag. Text track for media elements i.e. <audio> & <video> is provided by <track> tag in HTML5. There is no such thing as slider tag in HTML5.

30. What will happen if height and width of video are not set while video loads?
a) page flickers
b) page does not load
c) page crash
d) page closes
Answer: a
Explanation: If height and width are not set, the browser does not know the size of the video. The effect will be that the page will change (or flicker) while the video loads.

31. Which of the following HTML Video – Media Type is not supported in IE?
a) WebM
b) MP4
c) Ogg
d) MP4 FLAC
Answer: c
Explanation: The Ogg container format with the Theora video codec and the Vorbis audio codec is supported in desktop/mobile Gecko (Firefox), Chrome, and Opera, and support for the format can be added to Safari (but not on iOS) by installing an add-on. The format is not supported in Internet Explorer in any way. The most widely used format for HTMl video i.e MP4 format is supported in IE.

32. In HTML Audio/Video DOM, __________ sets or returns the default speed of the audio/video playback.
a) currentTime
b) duration
c) defaultPlaybackRate
d) playbackRate
Answer: c
Explanation: CurrentTime set or returns current playback position while playing audio/video. The length of the current audio/video is set or returned by duration. Default speed of playback is given by defaultPlaybackRate while playback returns speed of the audio/video.

33. In HTML Audio/Video DOM, __________ sets or returns the CORS settings of the audio/video.
a) currentTime
b) duration
c) defaultPlaybackRate
d) crossOrigin
Answer: d
Explanation: CurrentTime set or returns current playback position while playing audio/video. The length of the current audio/video is set or returned by duration. Default speed of playback is given by defaultPlaybackRate. The purpose of the crossorigin attribute is to allow you to configure the CORS requests for the element’s fetched data.

34. In HTML Audio/Video DOM, __________ returns a TimeRanges object representing the buffered parts of the audio/video.
a) preload
b) networkState
c) buffered
d) controller
Answer: c
Explanation: Preload is used to set or return whether the video/ audio has been loaded on page. Current network of audio/video has been set or returned by networkState. A buffered range is a time-range of buffered audio/video. The user gets several buffered ranges if he/she skips in the audio/video. Media controller of current video/audio is given or returned by controller.

35. There is an audio format supported across all browsers.
a) True
b) False
Answer: b
Explanation: There are 3 formats that are used in HTML5 Audio and are .mp3, .m4a AAC also known as H.264 format.

36. Which of the following tag is used for audio in HTML5?
a) <bgsound>
b) <audio>
c) <video>
d) <canvas>

Answer: b
Explanation: <video> tag is used for video clips in HTML5. <canvas> is for graphical user interface. The audio tag defines sound, such as music or other audio streams.

37. Which tag is used to defines multiple media resources for media elements audio and video?
a) <source>
b) <canvas>
c) <audio>
d) <video>
Answer: a
Explanation: <video> tag is used for video clips in HTML5. <canvas> is for graphical user interface. The audio tag defines sound, such as music or other audio streams.defines multiple media resources for media elements, such as <video> and <audio>.

38. Which of the following browser does not support wav file format?
a) Opera
b) Firefox
c) Chrome
d) Internet Explorer
Answer: d
Explanation: Opera, firefox, chrome and internet explorer are different kinds of browsers. Out of which audio file format named wav is not supported by internet explorer.

39. In HTML Audio/Video DOM __________ sets or returns the volume of the audio/video.
a) src
b) volume controls
c) volume
d) video Tracks
Answer: c
Explanation: Src attribute gives current source of audio/video element. The videoTrack list is returned representing available video tracks by video track attribute. Volume attribute sets the current volume of video/audio.

40. Which of the following attribute adds audio controls, like play, pause, and volume?
a) audio
b) controls
c) source
d) src
Answer: b
Explanation: The audio attribute defines sound, such as music or other audio streams. Source attribute defines multiple media resources for media elements, such as <video> and <audio>. Src attribute gives current source of audio/video element. The controls attribute is a boolean attribute. When present, it specifies that audio controls should be displayed.

41. In HTML Audio/Video DOM __________ sets or returns whether the audio/video should start playing as soon as it is loaded.
a) controls
b) audio Tracks
c) autoplay
d) currentSrc
Answer: c
Explanation: Control attribute is used to set whether audio/video should display controls. AudioTrack list representing audio tracks is set by audio track. The autoplay attribute is a boolean attribute. When present, the audio will automatically start playing as soon as it can do so without stopping. A current src of audio/video is returned by currentSrc.

42. In HTML Audio/Video DOM __________ sets or returns whether the audio/video should start over again when finished.
a) loop
b) autoplay
c) seeking
d) played
Answer: a
Explanation: The loop attribute is a boolean attribute. When present, it specifies that the audio will start over again, every time it is finished. With autoplay, it ensures whether video/audio should play immediately after loading page. Seeking returns whether user is currently seeking video/audio. Timeranges representing played parts of audio/video is set by played attribute.

43. In HTML Audio/Video DOM __________ returns a MediaError object representing the error state of the audio/video.
a) ended
b) seeking
c) error
d) mediaGroup
Answer: c
Explanation: Seeking returns whether user is currently seeking video/audio. Ended attribute fires up when current playing playlist is finished. The error property returns a MediaError object. The MediaError object has a code property containing the error state of the audio/video. The group to which audio/video belongs is returned by mediaGroup.

44. In HTML Audio/Video DOM __________ returns a TextTrackList object representing the available text tracks.
a) readyState
b) startDate
c) videoTracks
d) textTracks
Answer: d
Explanation: The current ready state of video/audio is set by readyState. StartDate sets current date representing current time offsets. VideoTrack returns video track list representing available video tracks. The textTracks property returns a TextTrackList object. The TextTrackList object represents the available text tracks for the audio/video. Each available text track is represented by an TextTrack Object.

45. Which of the following is a server-side solution for implementing responsive images?
a) http://adaptive-images.com
b) http://github.com/scottjehl/picturefill
c) http://www.netmagazine.com
d) http://offroadcode.com
Answer: a
Explanation: Instead of implementing ideal responsive image with <picture> element, we can use a server-side solution with Adaptive image i.e. http://adaptive-images.com/. It was created by Matt Wilcox (http://mattwilcox.net/).

46. Which of the following is not included in the framework?
a) font sizes
b) css reset
c) button styles
d) forms
Answer: d
Explanation: If we use the framework it can save a lot of time. Framework generally includes a width of the grid, button styles, CSS reset and many more other aspects to build a website.

47. How many columns are there in the basic grid of a skeleton?
a) 17
b) 12
c) 16
d) 10
Answer: b
Explanation: Skeleton is a minimal responsive framework. It is 960 pixels wide with 12 columns in its basic grid. The grid is responsive by integrating CSS3 media queries. It is also called the 960.gs framework. It is a good place for starting with the Grid System.

48. Bootstrap was first introduced in ______
a) google
b) twitter
c) instagram
d) snapchat
Answer: b
Explanation: Bootstrap was built by Mark Otto and for internal use in Twitter. It was launched as a free software for the public. Bootstrap is packed with styled user interface components such as button navigation, forms, custom jQuery plugins like popover, model box and carousal.

49. Which is not a tool to build responsive websites?
a) skeleton
b) bookmarklets
c) code editors
d) web browsers
Answer: a
Explanation: We need several tools to build our website. To build a responsive website we need web browsers, responsive bookmarklets, code editors for responsive design testing.

50. Linux does not have code editor ___________
a) Geany
b) Gedit
c) BlueFish
d) WebMatrix
Answer: d
Explanation: Code editor is equipment for developing a website. There are many editors available in Windows, Linux and OS X. Linux has Geany, Gedit, BlueFish. Windows have WebMatrix, TextPad, Notepad++. OS X has MacVim, Brackets, TextWrangler.

51. Which is not bookmarklet?
a) Screen Fly
b) Resizer
c) Screenqueri.es
d) Brackets
Answer: d
Explanation: Bookmarklet is a sort of emulator tool for testing responsive design. It resizes the dimension of viewable area in the browser. There are various bookmarklets available like Screenqueri.es, Resizer, Adobe Edge Inspect, Screen Fly, RWD demonstration, ResponsivePX, Responsinator.

52. Which of the following is not a CSS preprocessor?
a) LESS
b) Sass
c) Stylus
d) Screen Fly
Answer: d
Explanation: CSS capabilities can be extended by CSS preprocessors. By using it we can compose CSS in more dynamic ways. They allow us to use variables and functions in programming languages like JavaScript, PHP. There are several CSS preprocessors available such as LESS, Stylus, Sass.

53. For style foundation Bootstrap uses ____________
a) LESS
b) Sass
c) Resizer
d) Stylus
Answer: a
Explanation: These are some CSS preprocessors that have been adopted in responsive frameworks. Bootstrap utilizes LESS as its style foundation. Foundation uses Sass in styling.

54. Which of the following is not a CSS preprocessor compiler?
a) LESS.app
b) Screenqueri.es
c) ScoutApp
d) Simpless
Answer: b
Explanation: LESS and Sass are written in a language that browsers do not recognize. So there are compilers available to compile CSS preprocessors. Some of them are Less.js, WinLESS, LESS.app, Simpless, ScoutApp, ChrunchApp, Terminal or Command Prompt, Codekit, CompassApp.

55. Which of the following css property should be used to make a responsive image?
a) float
b) max-width
c) margin-right
d) all of the mentioned
Answer: d
Explanation: Self-explainatory.

56. What should be written in the blank of the code for resizing elements in Responsive Web Design with Transitions
Code:

body { background-image: url(fog.jpg); background-size: cover;
background-repeat: no-repeat; color: #fff; font-family: Avenir, Arial, sans-serif;
}
h1 { font-family: 'Calluna Sans', Arial, sans-serif; text-align: center;
font-size: 10rem; margin: 8rem auto;
}
h1 { font-family: 'Calluna Sans', Arial, sans-serif;
text-align: center; font-size: 10rem; margin: 8rem auto; transition: 1s font-size linear;
}
______________ and (max-width: 1100px) {
h1 { font-size: 8rem; }

a) @media
b) @media screen
c) div
d) transform
Answer: b
Explanation: None.

57. What should be written in the blank of the code for JQuery Code Used to Apply CSS3 Animations?
Code:

_________ leftmove {
100% { transform: translateX(-70px); opacity: 1; }
}
_________ rightmove {
100% { transform: translateX(70px); opacity: 1; }
}
<script>
$(function() {
var footerBottom = $("#articlefooter").offset().top + $("#articlefooter").height();
$(window).scroll(function() {
if ($(this).scrollTop() > (footerBottom - $(window).height())) {
131
$("#prevpage").css('animation', 'leftmove 1s 2s forwards');
$("#nextpage").css('animation', 'rightmove 1s 1s forwards');
});
});
</script>

a) @media
b) @keyframes
c) animation-name
d) !important
Answer: b
Explanation: None.

58. Which of the following CSS framework is used to create a responsive design?
a) larawell
b) bootstrap
c) rails
d) django
Answer: b
Explanation: Bootstrap is a free and open-source collection of tools for creating websites and web applications. It contains HTML- and CSS-based design templates for typography, forms, buttons, navigation and other interface components, as well as optional JavaScript extensions. It aims to ease the development of dynamic websites and web applications.

59. Which of the following code set the webpage correctly displayed on a device?
a) <meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
b) <meta name=“viewport” content=“width=device-width, initial-scale=2.0”>
c) <meta name=“viewport” content=“width=device-width, initial-scale=’parent-size'”>
d) <meta name=“viewports” content=“width=device-width, initial-scale=1.0”>
Answer: a
Explanation: Self-explainatory.

60. What does this code do?
Code:

 @media only screen and (max-width: 500px) {
    body {
        background-color: lightblue;
    }
}

a) If the browser window is smaller than 500px, the background color will change to lightblue:
b) If the browser window is larger than 500px, the background color will change to lightblue:
c) The background color will change to lightblue
d) Nothing happens
Answer: a
Explanation: Self-explainatory.

61. What does this code do?
Code:

@media only screen and (orientation: landscape) {
    body {
        background-color: lightblue;
    }
}

a) web page will have a lighblue background if the orientation is in landscape mode
b) web page will have a lighblue background if the orientation is not in landscape mode
c) web page will have a red background if the orientation is in landscape mode
d) None of the mentioned
Answer: a
Explanation: Self-explainatory.

62. Which of the following css propery defines a relationship between bound elements(s) and some code or content?
a) @import
b) @media
c) url-bind
d) binding
Answer: d
Explanation:
Syntax: binding: none | url(bindingfile)

63. What does this code do?
Code:

@media only screen and (max-width: 768px) {
    class*="col-"] {
        width: 100%;
    }
}

a) When the screen gets larger than 768px, each column should have a width of 100%.
b) When the screen gets smaller than 768px, each column should have a width of 100%.
c) Error occured
d) None of the mentioned
Answer: b
Explanation: Self-explainatory.

64. Which of the following css propery define the properties that will be animated in an animation rule?
a) @keyframes
b) animation-origin
c) transform
d) animation
Answer: d
Explanation:  Syntax: @keyframes: keyframe-name {percentage | from | to {cssrules}}

65. Which of the following media feature describes the number of entries in the color lookup table of the output device
a) color
b) color-index
c) color-value
d) color-@media
Answer: b
Explanation: The ‘color-index’ media feature describes the number of entries in the color lookup table of the output device. If the device does not use a color lookup table, the value is zero

66. Which of the following Viewport Property sets the initial scaling factor?
a) scale
b) initial-scale
c) minimum-scale
d) user-scale
Answer: b
Explanation: Self-explainatory.

67. Which of the following Viewport Property determines whether the display can be zoomed in
and out?
a) scale
b) set-scale
c) adjust-scale
d) user-scalable
Answer: d
Explanation: Self-explainatory.

68. Which of the following @viewport Property sets the viewport height in the same way as width?
a) height
b) width
c) viewpor-width
d) none of the mentioned
Answer: a
Explanation: Self-explainatory.

69. Which of the following @viewport Property locks the document in the specified orientation, portrait or landscape?
a) orientation
b) resolution
c) landscape
d) portrait
Answer: a
Explanation: Self-explainatory.

70. Which of the following Media Query describe the ratio of the device width to the device height of the media?
a) device-aspect
b) device-aspect-ratio
c) device-aspect-query
d) none of the mentioned
Answer: c
Explanation: Self-explainatory.

71. Which of the following Media Query determines if output is grid, like a simple terminal or phone, or bitmap, like a standard monitor or printer?
a) monochrome
b) grid
c) resolution
d) device-height
Answer: b
Explanation: Self-explainatory.

72. Which of the following Media Query describes the scanning method of a TV?
a) orientation
b) scan
c) resolution
d) none of the mentioned
Answer: b
Explanation: Self-explainatory.

73. Which of the following Media Query determines if output is monochrome and how many bits are used for gray display?
a) gray
b) chrome
c) monochrome
d) none of the mentioned
Answer: c
Explanation: Self-explainatory.

74. A media query consists of a media type and zero or more expressions that check for the conditions of particular media features. State true or false.
a) True
b) False
Answer: a
Explanation: Self-explainatory.

75. Which of the following CSS property is used to set the text formatting?
a) font
b) font-style
c) text-decoration
d) all of the mentioned
Answer: c
Explanation: Self-explainatory.

76. Which of the following sets the color of any text decoration, such as underlines, overlines, and strike throughs?
a) text-font
b) text-format
c) text-color
d) text-decoration-color
Answer: d
Explanation: Self-explainatory.

77. Which of the following sets what kind of line decorations are added to an element, such as underlines, overlines, etc?
a) text-style
b) text-decoration
c) text-line
d) text-decoration-line
Answer: a
Explanation: Self-explainatory.

78. Which of the following text-decoration value specifies each line of text has a line above it?
a) line
b) underline
c) overline
d) blink
Answer: c
Explanation: Self-explainatory.

79. Which of the following
a) text-overline
b) text-overline-decoration
c) text-overline-width
d) text-decoration-overline-width
Answer: c
Explanation: Self-explainatory.

80. Which of the following CSS property determines how overflowed content that is not displayed is signaled to the users?
a) text-flow
b) text-underflow
c) text-overflow
d) none of the mentioned
Answer: c
Explanation: Self-explainatory.

81. Which of the following sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not?
a) text-decoration
b) text-mode-overflow
c) text-mode
d) text-overline-mode
Answer: b
Explanation: Self-explainatory.

82. Which of the following specifies what parts of an element’s content are skipped over when applying any text decoration?
a) @font-text
b) font-style
c) text-skip
d) text-decoration-skip
Answer: d
Explanation: Self-explainatory.

83. Which of the following is not a appropriate value for text-overline-width?
a) thin
b) medium
c) <number>
d) none of the mentioned
Answer: d
Explanation: Self-explainatory.

84. Which of the following property applies one or more drop shadows to the text?
a) text-shadow
b) text-effect
c) text-format
d) text-decoration-shadow
Answer: a
Explanation: Self-explainatory.

85. Which of the following CSS3 Color Feature can be used as a macro for whatever the current color is?
a) CurrentColor keyword
b) HSLa Color
c) HSL Color
d) RGB Color
Answer: a
Explanation: This is useful if you want to dynamically change one color and have other related colors change.

86. Which of the following CSS3 Color Feature like RGB color but adds an alpha channel value to specify the opacity of the color?
a) RGB
b) RGBa
c) RGBaplha
d) AlphaRGB
Answer: b
Explanation: An RGBa is specified via a function style rgba(r,g,b,a) value, where colors r, g, and b are specified as a decimal value from 0 to 255 or a percentage from 0 to 100%, and the alpha channel value for defining opacity is a number between 0 (fully transparent) and 1 (fully opaque). Values outside this range will be rounded up or down to fit the closest value.

87. Which of the following Color Format is a CSS’s six-digit hexadecimal format is the same as color defined in (X)HTML?
a) 6-Hex Color
b) 3-Hex Color
c) RGBS
d) RGBa
Answer: a
Explanation: The format specifies color as #rrggbb, where rr is the amount of red, gg the amount of green, and bb the amount of blue, all specified in a hexadecimal value ranging from 00 to FF.

88. Which of the following Color Format is a CSS2 introduced named color keywords which allows Web page colors to be matched to an operating system’s color use?
a) HSLa Color
b) Commonly defined named colors
c) System Color Names
d) Specificationdefined named colors
Answer: c
Explanation: None.

89. Which of the following Color Format are a 17 defined colors under CSS 2.1?
a) HSLa Color
b) Commonly defined named colors
c) System Color Names
d) Specificationdefined named colors
Answer: d
Explanation:
maroon (#800000) red (#ff0000)
orange (#ffA500) yellow (#ffff00)
olive (#808000) purple (#800080)
fuchsia (#ff00ff ) white (#ffffff)
lime (#00ff00) green (#008000)
navy (#000080) blue (#0000ff)
aqua (#00ffff) teal (#008080)
black (#000000) silver (#c0c0c0)
gray (#808080)
Other color keywords may be commonly used but are ad hoc in their definition.

90. Which of the following Color Format is a CSS colors can also be defined using the keyword rgb, followed by three numbers between 0 and 255, contained in parentheses and separated by commas, with no spaces between them?
a) RGB Color
b) RGBa Color
c) HSL Color
d) HSLa Color
Answer: a
Explanation: RGB color values can also be defined using percentages. The format is the same, except that the numbers are replaced by percentage values between 0% and 100%.

91. Which of the following Color Format is a CSS3 HSL value with a fourth value to set the alpha channel value for the color to define the opacity of the element?
a) RGB Color
b) RGBa Color
c) HSL Color
d) HSLa Color
Answer: d
Explanation: None.

92. Which of the following Selector selects an element if it’s the only child of its parent with its type?
a) @media
b) :target
c) ::selection
d) :only-of-type

Answer: d
Explanation: None.

93. Which of the following Selector same as :firstline; changed under CSS3 to make pseudoelements obvious?
a) :first-letter
b) :last-child
c) :first-line
d) ::first-line
Answer: d
Explanation: None.

94. What does HSL stands for?
a) Hue Specified Lightness
b) Hue Spot Lightness
c) Hue Saturation Lightness
d) None of the mentioned
Answer: c
Explanation: None.

Module 03

1. What is the purpose of the radix parameter in the parseInt() method?
a) Numeral system not to be used
b) Numeral system to be used
c) Conversion mode
d) Parsing mode
Answer: b
Explanation: function parseInt() method parses a string and returns an integer. The radix parameter is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number.

2. What will be the radix value of the parseInt() method when the string begins with 0?
a) 6
b) 7
c) 8
d) 9
Answer: c
Explanation: If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal). This feature is deprecated.

3. What is the purpose of the method JSON.parse()?
a) Parses a string to integer
b) Parses a string to JSON
c) Parses a string from JSON to JSON2
d) Parses integer to string
Answer: b
Explanation: The JSON.parse() method parses a string as JSON, optionally transforming the value produced by parsing. The function parseInt() method parses a string and returns an integer.

4. What is the return type of the method parseInt()?
a) String
b) Float
c) Integer
d) Date
Answer: c
Explanation: The function parseInt() method parses a string and returns an integer. The method parseInt() returns an integer.

5. What are the parameters of the method JSON.parse()?
a) text
b) reviver
c) both text and reviver
d) object
Answer: c
Explanation: The JSON.parse() method can optionally transform the result with a function. The parameters of the method JSON.parse() are :

  • text : The string to parse as JSON.
  • reviver : If a function, prescribes how the value originally produced by parsing is transformed, before being returned.

6. What will be the radix value of the parseInt() method when the string begins with any other value other than 0x and 0?
a) 8
b) 9
c) 10
d) 11
Answer: c
Explanation: The radix value will be 10 when the string of the method parseInt() begins with any other value other than 0x and 0. If the string begins with 0x, then the radix value will be 16.

7. What kind of an exception will be thrown if the string to parse is not valid JSON?
a) SyntaxError
b) ArrayOutOfBoundException
c) Both SyntaxError and ArrayOutOfBoundException
d) Compilation error
Answer: a
Explanation: The JSON.parse() method parses a string and returns a JavaScript object. The method JSON.parse()throws a SyntaxError exception if the string to parse is not valid JSON.

8. Which of the following is a JavaScript Compressor?
a) Esprima
b) UgilifyJS
c) Acron
d) Compressify
Answer: b
Explanation: UgilifyJS is a JavaScript compressor/minifier written in JavaScript. It also contains tools that allow one to automate working with JavaScript code.

9. What is the purpose of the UgilifyJS?
a) Exposes a simple API
b) Minification
c) Both Exposes a simple API and Minification
d) Compilation
Answer: c
Explanation: UglifyJS is a JavaScript compressor/minifier written in JavaScript. UglifyJS2 is an excellent tool to help you minify your JavaScript! It’s a tried and tested tool, used by libraries such as jQuery.

10. Which of the following is the fastest JavaScript parser?
a) JSLint
b) Esprima
c) Acron
d) Traceur
Answer: c
Explanation: Acorn is a JavaScript parser written in JavaScript. : Acron is the fastest JavaScript parser written in JavaScript which takes only 96.9ms when compared to all the JavaScript parsers available. Acron is the fastest JavaScript parser written in JavaScript which takes only 96.9ms when compared to all the JavaScript parsers available.

11. Which of the following algorithm is used by Google to determine the importance of a particular page?
a) SVD
b) PageRank
c) FastMap
d) All of the mentioned
Answer: b
Explanation: Content on pages is scanned up to a certain number of words and placed into an index.

12. Point out the correct statement.
a) With PaaS, the goal is to create hosted scalable applications that are used in a Software as a Service model
b) Applications built using PaaS tools need to be standards-based
c) In Wolf, the data and transaction management conforms to the business rules you create
d) All of the mentioned
Answer: d
Explanation: Wolf lets you work with Adobe Flash or Flex or with Microsoft Silverlight.

13. Which of the following figure correctly describe major features provided by Google App Engine?
a)
b)
c)
d) All of the mentioned
Answer: d
Explanation: For an application to run on GAE, it must comply with Google’s platform standards, which narrows the range of applications that can be run and severely limits those applications’ portability.

14. Based on PageRank algorithm, Google returns __________ for a query that is parsed for its keywords.
a) SEP
b) SAP
c) SERP
d) Business Objects Build
Answer: c
Explanation: SERP stands for Search Engine Results Page.

15. Point out the wrong statement.
a) Wolf Frameworks uses a C# engine and supports both Microsoft SQL Server and MySQL database
b) Applications built in Wolf are 50-percent browser-based and support mashable and multisource overlaid content
c) Google applications are cloud-based applications
d) None of the mentioned
Answer: b
Explanation: Wolf has architected its platform so applications can be built without the need to write technical code.

16. Which of the following protocol lets a Web site list in an XML file information?
a) Sitemaps
b) Mashups
c) Hashups
d) All of the mentioned
Answer: a
Explanation: Sitemaps can be useful in allowing content that isn’t browsable to be crawled.

17. Which of the following is not provided by “Deep Web”?
a) Database generated Web pages
b) Private or limited access Web pages
c) Pages without links
d) All of the mentioned
Answer: d
Explanation: Online content that isn’t indexed by search engines belongs to what has come to be called the “Deep Web”.

18. Dynamic content presented in Google _______ crawling isn’t normally indexed.
a) AJAX
b) Java
c) Javascript
d) All of the mentioned
Answer: a
Explanation: Google now has a procedure that helps the Google engine crawl this information.

19. Which of the following google product sends you periodic email alerts based on your search term?
a) Alerts
b) Blogger
c) Calendar
d) All of the mentioned
Answer: a
Explanation: By creating a Google Alert, you can get email notifications any time Google finds new results on a topic that interests you.

20. Which of the following is a payment processing system by Google?
a) Paytm
b) Checkout
c) Code
d) All of the mentioned
Answer: b
Explanation: Google Checkout was an online payment processing service provided by Google aimed at simplifying the process of paying for online purchases.

Module 04

1. What will be the output of the following PHP code?

  1. <?php
  2. $x;
  3. if ($x)
  4.     print "hi" ;
  5. else
  6.     print "how are u";
  7. ?>

a) how are u
b) hi
c) error
d) no output
Answer: a
Explanation: Uninitialized x is set to 0, thus if condition fails.

2. What will be the output of the following PHP code?

  1. <?php
  2. $x = 0;
  3. if ($x++)
  4.     print "hi";
  5. else
  6.     print "how are u";
  7. ?>

a) hi
b) no output
c) error
d) how are u
Answer: d
Explanation: x is incremented after if which evaluates to false.

3. What will be the output of the following PHP code?

  1. <?php
  2. $x;
  3. if ($x == 0)
  4.     print "hi" ;
  5. else
  6.     print "how are u";
  7.     print "hello"
  8. ?>

a) how are uhello
b) hihello
c) hi
d) no output
Answer: b
Explanation: else condition without brackets performs the following statements only.

4. What will be the output of the following PHP code?

  1. <?php
  2. $x = 0;
  3. if ($x == 1)
  4.     if ($x >= 0)
  5.         print "true";
  6.     else
  7.         print "false";
  8. ?>

a) true
b) false
c) error
d) no output
Answer: d
Explanation: The nested for loop is not entered if outer condition is false.

5. What will be the output of the following PHP code?

  1. <?php
  2. $a = 1;
  3. if ($a--)
  4.     print "True";
  5. if ($a++)
  6.     print "False";
  7. ?>

a) true
b) false
c) error
d) no output
Answer: a
Explanation: Due to post increment and post decrement only the first condition is satisfied.

6. What will be the output of the following PHP code?

  1. <?php
  2. $a = 1;
  3. if (echo $a)
  4.     print "True";
  5. else
  6.     print "False";
  7. ?>

a) true
b) false
c) error
d) no output
Answer: c
Explanation: echo does not return anything so if condition is empty.

7. What will be the output of the following PHP code?

  1. <?php
  2. $a = 1;
  3. if (print $a)
  4.     print "True";
  5. else
  6.     print "False";
  7. ?>

a) true
b) false
c) error
d) no output
Answer: a
Explanation: print returns 1 if it prints anything.

8. What will be the output of the following PHP code?

  1. <?php
  2. $a = 10;
  3. if (1)
  4.     print "all";
  5. else
  6.     print "some"
  7. else
  8.     print "none";
  9. ?>

a) all
b) some
c) error
d) none
Answer: c
Explanation: Hanging else statement.

9. What will be the output of the following PHP code?

  1. <?php
  2. $a = 10;
  3. if (0)
  4.     print "all";
  5.  if
  6.  else
  7.      print "some"
  8. ?>

a) all
b) some
c) error
d) no output
Answer: c
Explanation: No else statement to end the if statement.

10. What will be the output of the following PHP code?

  1. <?php
  2. $a = "";
  3. if ($a)
  4.     print "all";
  5. if
  6. else
  7.     print "some";
  8. ?>

a) all
b) some
c) error
d) no output
Answer: b
Explanation: Empty string is evaluated to 0.

11. What will be the output of the following PHP code?

  1. <?php
  2. $a = "a";
  3. if ($a)
  4.     print "all";
  5. else
  6.     print "some";
  7. ?>

a) all
b) some
c) error
d) no output
Answer: a
Explanation: The value of a is evaluated to 1 as it has a value.

12. What will be the output of the following PHP code?

  1. <?php
  2. $x = 10;
  3. $y = 20;
  4. if ($x > $y + $y != 3)
  5.     print "hi" ;
  6. else
  7.     print "how are u";
  8. ?>

a) how are u
b) hi
c) error
d) no output
Answer: b
Explanation: Expression evaluates to true.

13. What will be the output of the following PHP code?

  1. <?php
  2. $x = 10;
  3. $y = 20;
  4. if ($x > $y && 1||1)
  5.     print "hi" ;
  6. else
  7.     print "how are u";
  8. ?>

a) how are u
b) hi
c) error
d) no output
Answer: b
Explanation: Expression evaluates to true.

14. What will be the output of the following PHP code?

  1. <?php
  2. $x = 10;
  3. $y = 20;
  4. if ($x > $y && 1||1)
  5.     print "hi" ;
  6. else
  7.     print "how are u";
  8. ?>

a) how are u
b) hi
c) error
d) no output
Answer: b
Explanation: Expression evaluates to true.

15. What will be the output of the following PHP code?

  1. <?php
  2. if (-100)
  3.     print "hi" ;
  4. else
  5.     print "how are u";
  6. ?>

a) how are u
b) hi
c) error
d) no output
Answer: b
Explanation: Expression evaluates to true.

16. What will be the output of the following PHP code?

  1. <?php
  2. if (0.1)
  3.     print "hi" ;
  4. else
  5.     print "how are u";
  6. ?>

a) how are u
b) hi
c) error
d) no output
Answer: b
Explanation: Expression evaluates to true.

17. What will be the output of the following PHP code?

  1. <?php
  2. if (0.0)
  3.     print "hi" ;
  4. else
  5.     print "how are u";
  6. ?>

a) how are u
b) hi
c) error
d) no output
Answer: a
Explanation: Expression evaluates to false.

18. What will be the output of the following PHP code?

  1. <?php
  2. if (print "0")
  3.     print "hi" ;
  4. else
  5.     print "how are u";
  6. ?>

a) 0how are u
b) 0hi
c) hi
d) how are u
Answer: b
Explanation: Expression evaluates to true as print returns 1.

19. What will be the output of the following PHP code?

  1. <?php
  2. $x = 1;
  3. if ($x == 2)
  4.     print "hi" ;
  5. else if($x = 2)
  6.     print $x;
  7. else
  8.     print "how are u";
  9. ?>

a) error
b) 2
c) hi
d) how are u
Answer: b
Explanation: Enters if else as first condition is false and thus x is set to 2.

20. What will be the output of the following PHP code?

  1. <?php
  2. $x = 1;
  3. if ($x = $x&0)
  4.     print $x ;
  5. else
  6.     print "how are u";
  7. ?>

a) 0
b) 1
c) error
d) how are u
Answer: d
Explanation: x&0 is 0,thus evaluated to false.

21. What will be the output of the following PHP code?

  1. <?php
  2. $x = 1;
  3. if ($x = $x&0)
  4.     print $x ;
  5. else
  6.     print "how are u";
  7. ?>

a) 0
b) 1
c) error
d) how are u
Answer: d
Explanation: x&0 is 0,thus evaluated to false.

22. What will be the output of the following PHP code?

  1. <?php
  2. $x = 1;
  3. if ($x = $x&0)
  4.     print $x;
  5. else
  6.     break;
  7. ?>

a) 0
b) 1
c) error
d) no output
Answer: c
Explanation: break is not defined for a if else ladder.

23. What will be the output of the following PHP code?

  1. <?php
  2. $a = 100;
  3. if ($a > 10)
  4.     printf("M.S. Dhoni");
  5. else if ($a > 20)
  6.     printf("M.E.K Hussey");
  7. else if($a > 30)
  8.     printf("A.B. de villiers");
  9. ?>

a) M.S.Dhoni
b) M.E.K.Hussey
c)M.S.Dhoni
M.E.K.Hussey
A.B.de villiers
d) No output
Answer: a
Explanation: In if else if one condition is satisfied then no other condition is checked.

24. What will be the output of the following PHP code?

  1. <?php
  2. $x = 10;
  3. $y = 5;
  4. $z = 3;
  5. if ($x / $y / $z)
  6.     print "hi";
  7. else
  8.     print "hello";
  9. ?>

a) hi
b) hello
c) error
d) no output
Answer: a
Explanation: In php division returns a float that is a non zero value thus evaluates to true.

25. What will be the output of the following PHP code?

  1. <?php
  2. if (!print "hi")
  3.     if (print "hello")
  4. print "hi";
  5. ?>

a) hi
b) hihellohi
c) hihi
d) no output
Answer: a
Explanation: Print returns true and thus the first if statement also is not executed.

26. What will be the output of the following PHP code?

  1. <?php
  2. if (print "hi" - 1)
  3.     print "hello"
  4. ?>

a) hi
b) hihello
c) error
d) no output
Answer: c
Explanation: print returns true and when 1 is subtracted it is syntax error.

27. What will be the output of the following PHP code?

  1. <?php
  2. $x = 1;
  3. if ($x--)
  4.     print "hi"
  5.     $x--;
  6. else
  7.     print "hello"
  8. ?>

a) hi
b) hello
c) error
d) no output
Answer: c
Explanation: The if statement has no brackets and it expects a else/else if after a if.

28. What will be the output of the following PHP code?

  1. <?php
  2. $a = 10;
  3. $b = 11;
  4. if ($a < ++$a || $b < ++$b)
  5.     print "hello";
  6. else
  7.     print "hi";
  8. ?>

a) hi
b) hello
c) error
d) no output
Answer: a
Explanation: The operator precedence of ++ is higher than <, thus the increment happens first and then compared.

29. What will be the output of the following PHP code?

  1. <?php
  2. $a = 2;
  3. if ($a-- - --$a - $a)
  4.     print "hello";
  5. else
  6.     print "hi";
  7. ?>

a) hi
b) hello
c) error
d) no output
Answer: b
Explanation: Computing the expression in the if clause,it sums upto to 2 which is a positive value.

30. What will be the output of the following PHP code?

  1. <?php
  2. $a = 2;
  3. if ($a-- - --$a - $a)
  4.     print "hello";
  5. else
  6.     print "hi";
  7. ?>

a) hi
b) hello
c) error
d) no output
Answer: b
Explanation: Computing the expression in the if clause, it sums upto to 2 which is a positive value.

31. What will be the output of the following PHP code?

  1. <?php
  2. $a = "hello";
  3. if ($a.length)
  4.     print $a.length;
  5. else
  6.     print "hi";
  7. ?>

a) hellolength
b) 5
c) hi
d) error
Answer: a
Explanation: The . operator appends a string and returns true.

32. What will be the output of the following PHP code?

  1. <?php
  2. $a = "hello";
  3. if (strlen($a))
  4.     print strlen($a);
  5. else
  6.     print "hi";
  7. ?>

a) hellolength
b) 5
c) hi
d) error
Answer: b
Explanation: The function strlen($a) gives the length of the string, 5, which is considered true.

33. What will be the output of the following PHP code?

  1. <?php
  2. $a = "1";
  3. $b = "0";
  4. if ((int)$a && $b)
  5.     print"hi";
  6. else
  7.     print "hello";
  8. ?>

a) hello
b) no output
c) hi
d) error
Answer: a
Explanation: The expression is evaluated with values contained in the string, even without typecasting.

34. What will be the output of the following PHP code?

  1. <?php
  2. $a = "1";
  3. switch ($a)
  4. {
  5. case 1:
  6.     print "hi";
  7. case 2:
  8.     print "hello";
  9. default:
  10.     print "hi1";
  11. }
  12. ?>

a) hihellohi1
b) hi
c) hihi1
d) hi1
Answer: a
Explanation: As break is not provided it executes all the cases.

35. What will be the output of the following PHP code?

  1. <?php
  2. $a = "2";
  3. switch ($a)
  4. {
  5. case 1:
  6.     print "hi";
  7. case 2:
  8.     print "hello";
  9.     break;
  10. default:
  11.     print "hi1";
  12. }
  13. ?>

a) hihellohi1
b) hello
c) hihi1
d) hi1
Answer: b
Explanation: As hello is provided after case2 it breaks the loop.

36. What will be the output of the following PHP code?

  1. <?php
  2. $a = "1";
  3. switch($a)
  4. {
  5. case 1:
  6.     break;
  7.     print "hi";
  8. case 2:
  9.     print "hello";
  10.     break;
  11. default:
  12.     print "hi1";
  13. }
  14. ?>

a) hihellohi1
b) no output
c) hihi1
d) hi1
Answer: b
Explanation: As break is provided before print statement in case 2 it breaks the loop before printing.

37. What will be the output of the following PHP code?

  1. <?php
  2. $a = "1";
  3. $a = 1;
  4. $b = 1;
  5. switch($a)
  6. {
  7. case $a * $b:
  8.     print "hi";
  9.     break;
  10. case $a / $b:
  11.     print "hello";
  12.     break;
  13. default:
  14.     print "hi1";
  15. }
  16. ?>

a) hihellohi1
b) hi
c) hihello
d) hi1
Answer: b
Explanation: It checks the first case, when it finds it equal it will perform it breaks out.

38. What will be the output of the following PHP code?

  1. <?php
  2. $a = 97;
  3. switch($a)
  4. {
  5. case "a":
  6.     print "hi";
  7.     break;
  8. case 97:
  9.     print "hello";
  10.     break;
  11. default:
  12.     print "hi1";
  13. }
  14. ?>

a) hihellohi1
b) hi
c) hihello
d) hello
Answer: d
Explanation: Downcasting does not happen in case, it compares only with its data type.

39. What will be the output of the following PHP code?

  1. <?php
  2. $b = 1;
  3. switch($b)
  4. {
  5. case 1.0:
  6.     print "hi";
  7.     break;
  8. case 1:
  9.     print "hello";
  10.     break;
  11. default:
  12.     print "hi1";
  13. }
  14. ?>

a) hihellohi1
b) hi
c) hihello
d) hello
Answer: a
Explanation: Upcasting does happen in case, it compares it with 1.0 and thus prints hi and exits.

40. What will be the output of the following PHP code?

  1. <?php
  2. const $b = 1;
  3. switch($b)
  4. {
  5. case 1:
  6.     print "hi";
  7.     break;
  8. case 1:
  9.     print "hello";
  10.     break;
  11. default:
  12.     print "hi1";
  13. }
  14. ?>

a) error
b) hi
c) hihello
d) hello
Answer: a
Explanation: Constants cannot be used in switch cases.

41. What will be the output of the following PHP code?

  1. <?php
  2. $b = 1;
  3. switch(print $b)
  4. {
  5. case 2:
  6.     print "hello";
  7.     break;
  8. case 1:
  9.     print "hi";
  10.     break;
  11. default:
  12.     print "hi1";
  13. }
  14. ?>

a) 1hello
b) 1hi
c) 1hi1
d) error
Answer: b
Explanation: Print returns 1, thus it gives case 1.

42. What will be the output of the following PHP code?

  1. <?php
  2. switch($b)
  3. {
  4. case 2:
  5.     print "hello";
  6.     break;
  7. case 1:
  8.     print "hi";
  9.     break;
  10. }
  11. ?>

a) hello
b) hi
c) no output
d) error
Answer: c
Explanation: If that case does not exist then it searches for default and on not finding it does nothing.

43. What will be the output of the following PHP code?

  1. <?php
  2. switch($b)
  3. {
  4. case 2:
  5.     print "hello";
  6.     break;
  7. case b:
  8.     print "hi";
  9.     break;
  10. }
  11. ?>

a) hello
b) hi
c) no output
d) error
Answer: c
Explanation: Case cannot be defined by a variable.

44. What will be the output of the following PHP code?

  1. <?php
  2. $i = 0;
  3. for ($i)
  4. {
  5.     print $i;
  6. }
  7. ?>

a) 0
b) infinite loop
c) no output
d) error
Answer: d
Explanation: Wrong syntax for for loop.

45. What will be the output of the following PHP code?

  1. <?php
  2. $colors = array("red","green","blue","yellow");
  3. foreach ($colors as $value)
  4. {
  5.     echo "$value <br>";
  6. }
  7. ?>

a)red
green
blue
yellow
b) red
c) no output
d) error
Answer: a
Explanation: This runs a for loop for that array.

46. What will be the output of the following PHP code?

  1. <?php
  2. for ($x = 0; $x <= 10; $x++)
  3. {
  4.     echo "The number is: $x <br>";
  5. }
  6. ?>

a)The number is: 0
The number is: 1
The number is: 2
The number is: 3
The number is: 4
The number is: 5
The number is: 6
The number is: 7
The number is: 8
The number is: 9
The number is: 10
b) The number is: 0
c) no output
d) error
Answer: a
Explanation: This runs a for loop from 0 to 10.

47. What will be the output of the following PHP code?

<?php
for ($x = 0; $x <= 10; print ++$x)
{
    print ++$x;
}
?>

a) 123456789101112
b) 12345678910
c) 1234567891011
d) infinite loop
Answer: a
Explanation: The value of x is incremented and printed twice before checking,this last loop it prints 11 and 12.

48. What will be the output of the following PHP code?

<?php
for ($x = 1; $x < 10;++$x)
{
    print "*\t";
}
?>

a) **********
b) *********
c) ***********
d) infinite loop
Answer: b
Explanation: Loop runs from 1 to 9 i.e 9 times.

49. What will be the output of the following PHP code?

<?php
for ($x = -1; $x < 10;--$x)
{
    print $x;
}
?>

a) 123456789101112
b) 12345678910
c) 1234567891011
d) infinite loop
Answer: d
Explanation: The value of x is decremented thus making it an infinite loop.

50. What will be the output of the following PHP code?

<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
    print ++$x;
}
?>

a) -3-4-5
b) -3-4
c) infinite loop
d) no output
Answer: d
Explanation: The loop is not even entered as x is initially 0.

51. What will be the output of the following PHP code?

<?php
for ($i++; $i == 1; $i = 2)
    print "In for loop ";
print "After loop\n";

?>

a) In for loop
b) After for loop
c) In for loopAfter for loop
d) Infinite loop
Answer: c
Explanation: The loop runs only once as value of x is incremented.

52. What will be the output of the following PHP code?

<?php
for (1; $i == 1; $i = 2)
    print "In for loop ";
print "After loop\n";
?>

a) In for loop
b) After for loop
c) In for loopAfter for loop
d) Infinite loop
Answer: b
Explanation: The loop does not run as i initialized in check statement will be zero.

53. What will be the output of the following PHP code?

<?php
for ($i == 2; ++$i == $i; ++$i)
    print "In for loop ";
print "After loop\n";
?>

a) In for loopIn for loopIn for loopIn for loop……infinitely
b) After for loopAfter for loopAfter for loop……..infinitely
c) In for loopAfter for loopIn for loopAfter for loopIn for loopAfter for loop…..infinitely
d) After for loop
Answer: a
Explanation: The loop never exits as the condition ++X == X is always satisfied,evaluated from right to left.

54. What will be the output of the following PHP code?

  1. <?php
  2. for ($x = 1; $x < 10; $x++)
  3.     for ($y = 1; $y < 5; $y++)
  4.         print "Hello";
  5. ?>

a) Hello….36 times
b) Hello….45 times
c) Hello….50 times
d) Hello….40 times
Answer: a
Explanation: 9*4 times is printed.

55. What will be the output of the following PHP code?

  1. <?php
  2. for ($count = 1; $count != 20;$count++)
  3. {
  4.     print $count;
  5.     $count++;
  6. }
  7. ?>

a) Infinite
b) 123…….20
c) 1357…19
d) 13579…21
Answer: a
Explanation: Condition always fails as count takes only odd numbers.

56. What will be the output of the following PHP code?

  1. <?php
  2. for ($count = 1; $count < 20; $count++);
  3.     print $count;
  4. ?>

a) 20
b) 19
c) 12345678910….19
d) 12345678910….1920
Answer: a
Explanation: The for loop has no body, it just runs till condition is satisfied.

57. What will be the output of the following PHP code?

  1. <?php
  2. for ($count = 0; $count < 3;$count++);
  3. {
  4.     print "hi";continue;print "hello";
  5. }
  6. ?>

a) hihihi
b) hihellohihellohihello
c) hellohellohello
d) hi
Answer: a
Explanation: When continue is encountered it skips to the next iteration.

58. What will be the output of the following PHP code?

  1. <?php
  2. for ($count = 0; $count<3;$count++);
  3. {
  4.     print "hi";break;print "hello";
  5. }
  6. ?>

a) hihihi
b) hihellohihellohihello
c) hellohellohello
d) hi
Answer: d
Explanation: When break is encountered it leaves the loop.

59. What will be the output of the following PHP code?

  1. <?php
  2. for(++$i; ++$i; ++$i)
  3. {
  4.     print $i;
  5.     if ($i == 4)
  6.         break;
  7. }
  8. ?>

a) 24
b) 134
c) 1234
d) 1
Answer: a
Explanation: The order of execution is initialization, check, increment/decrement, check, increment/decrement, check, increment/decrement….so on.

60. What will be the output of the following PHP code?

  1. <?php
  2. for ($i = 0;$i = -1;$i = 1)
  3. {
  4.     print $i;
  5.     if ($i != 1)
  6. 	break;
  7. }
  8. ?>

a) 0
b) infinite loop
c) -1
d) 1
Answer: c
Explanation: The order of execution is initialization, check, increment/decrement, check, increment/decrement, check, increment/decrement….so on.

61. What will be the output of the following PHP code?

  1. <?php
  2. for(;;)
  3. {
  4.    print "10";
  5. }
  6. ?>

a) 10
b) infinite loop
c) no output
d) error
Answer: b
Explanation: There is no check condition to stop the execution of the loop.

62. What will be the output of the following PHP code?

  1. <?php
  2. for ($i = 0; -5 ; $i++)
  3. {
  4.     print"i";
  5.     if ($i == 3)
  6.         break;
  7. }
  8. ?>

a) 0 1 2 3 4
b) 0 1 2 3
c) 0 1 2 3 4 5
d) error
Answer: b
Explanation: The break statement after breaks the loop after i=3, does not print anymore.

63. Which one of the following is the very first task executed by a session enabled page?
a) Delete the previous session
b) Start a new session
c) Check whether a valid session exists
d) Handle the session
Answer: c
Explanation: The session variables are set with the PHP global variable which is $_SESSION. The very first task executed by a session enabled page is Check whether a valid session exists.

64. How many ways can a session data be stored?
a) 3
b) 4
c) 5
d) 6
Answer: b
Explanation: Within flat files(files), within volatile memory(mm), using the SQLite database(sqlite), or through user defined functions(user).

65. Which directive determines how the session information will be stored?
a) save_data
b) session.save
c) session.save_data
d) session.save_handler
Answer: d
Explanation: The class SessionHandler is used to wrap whatever internal save handler is set as defined by the session.save_handler configuration directive which is usually files by default.

66. Which one of the following is the default PHP session name?
a) PHPSESSID
b) PHPSESID
c) PHPSESSIONID
d) PHPIDSESS
Answer: a
Explanation: You can change this name by using the session.name directive.

67. If session.use_cookie is set to 0, this results in use of _____________
a) Session
b) Cookie
c) URL rewriting
d) Nothing happens
Answer: c
Explanation: The URL rewriting allows to completely separate the URL from the resource. URL rewriting can turn unsightly URLs into nice ones with a lot less agony and expense than picking a good domain name. It enables to fill out your URLs with friendly, readable keywords without affecting the underlying structure of pages.

68. If the directive session.cookie_lifetime is set to 3600, the cookie will live until ____________
a) 3600 sec
b) 3600 min
c) 3600 hrs
d) the browser is restarted
Answer: a
Explanation: The lifetime is specified in seconds, so if the cookie should live 1 hour, this directive should be set to 3600.

69. Neglecting to set which of the following cookie will result in the cookie’s domain being set to the host name of the server which generated it.
a) session.domain
b) session.path
c) session.cookie_path
d) session.cookie_domain
Answer: d
Explanation: The directive session.cookie_domain determines the domain for which the cookie is valid.

70. What is the default number of seconds that cached session pages are made available before the new pages are created?
a) 360
b) 180
c) 3600
d) 1800
Answer: b
Explanation: The directive which determines this is session.cache_expire.

71. What is the default time(in seconds) for which session data is considered valid?
a) 1800
b) 3600
c) 1440
d) 1540
Answer: c
Explanation: The session.gc_maxlifetime directive determines this duration. It can be set to any required value.

72. Which one of the following function is used to start a session?
a) start_session()
b) session_start()
c) session_begin()
d) begin_session()
Answer: b
Explanation: A session is started with the function session_start() . The session variables are set with the PHP global variable which is $_SESSION.

73. Which function is used to erase all session variables stored in the current session?
a) session_destroy()
b) session_change()
c) session_remove()
d) session_unset()
Answer: d
Explanation: The function session_unset() frees all session variables that is currently registered. This will not completely remove the session from the storage mechanism. If you want to completely destroy the session, you need to use the function session_destroy().

74. What will the function session_id() return is no parameter is passed?
a) Current Session Identification Number
b) Previous Session Identification Number
c) Last Session Identification Number
d) Error
Answer: a
Explanation: The function session_id() will return the session id for the current session or the empty string (” “) if there is no current session.

75. Which one of the following statements should you use to set the session username to Nachi?
a) $SESSION[‘username’] = “Nachi”;
b) $_SESSION[‘username’] = “Nachi”;
c) session_start(“nachi”);
d) $SESSION_START[“username”] = “Nachi”;
Answer: b
Explanation: You need to refer the session variable ‘username’ in the context of the $_SESSION superglobal.

76. What will be the output of the following PHP code? (Say your previous session username was nachi.)

  1.     unset($_SESSION['username']);
  2.     printf("Username now set to: %s", $_SESSION['username']);

a) Username now set to: nachi
b) Username now set to: System
c) Username now set to:
d) Error
Answer: c
Explanation: If someone want to destroy a single session variable then they can use the function unset () to unset a session variable. To delete the session variable ‘username’ we use the unset () function.

77. An attacker somehow obtains an unsuspecting user’s SID and then using it to impersonate the user in order to gain potentially sensitive information. This attack is known as __________
a) session-fixation
b) session-fixing
c) session-hijack
d) session-copy
Answer: a
Explanation: The attack session fixation attempts to exploit the vulnerability of a system that allows one person to set another person’s session identifier. You can minimize this risk by regenerating the session ID on each request while maintaining the session-specific data. PHP offers a convenient function named session_regenerate_id() that will replace the existing ID with a new one.

78. Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?
a) delete_old_file
b) delete_old_session
c) delete_old_session_file
d) delete_session_file
Answer: b
Explanation: The parameter delete_old_session determines whether the old session file will also be deleted when the session ID is regenerated.

79. Which function effectively deletes all sessions that have expired?
a) session_delete()
b) session_destroy()
c) session_garbage_collect()
d) SessionHandler::gc
Answer: d
Explanation: SessionHandler::gc is used to clean up expired sessions. It is called randomly by PHP internally when a session_start() is invoked.

80. Which function is used to transform PHP’s session-handler behavior into that defined by your custom handler?
a) session_set_save()
b) session_set_save_handler()
c) Session_handler()
d) session_save_handler()
Answer: b
Explanation: The function session_set_save_handler() is used to set the user-level session storage functions which are used for storing and retrieving data associated with a session.

81. The session_start() function must appear _________
a) after the html tag
b) after the body tag
c) before the body tag
d) before the html tag
Answer: d
Explanation: Like this: <?php session_start(); ?> <html>

82. What is the return type of session_set_save_handler() function?
a) boolean
b) integer
c) float
d) character
Answer: a
Explanation: Returns TRUE on success or FALSE on failure.

Module 05

1. A piece of icon or image on a web page associated with another webpage is called ______
a) url
b) hyperlink
c) plugin
d) extension
Answer: b
Explanation: URLs are locators for resources present on the World Wide Web. A plugin provides extra functionality to the webpage. An extension provides modification allowance for the core functionality of a webpage. Hyperlink is piece of icon or image on a web page associated with another webpage.

2. Dynamic web page ______
a) is same every time whenever it displays
b) generates on demand by a program or a request from browser
c) both is same every time whenever it displays and generates on demand by a program or a request from browser
d) is different always in a predefined order
Answer: b
Explanation: A dynamic web page provides different content every time the user opens it based on some events like new additions or time of the day. Languages such as JavaScript are used to respond to client-side events while languages such as PHP as used to respond to server-side events.

3. What is a web browser?
a) a program that can display a web page
b) a program used to view html documents
c) it enables user to access the resources of internet
d) all of the mentioned
Answer: d
Explanation: A web browser is an application program that is used to access the World Wide Web resources, applications and websites. Some examples of web browsers are Google Chrome, Internet Explorer and Safari.

4. Common gateway interface is used to _______
a) generate executable files from web content by web server
b) generate web pages
c) stream videos
d) download media files
Answer: a
Explanation: CGI is an interface through servers can run execute console-based executable files on a web server that generates dynamic web pages. A CGI script executes only when a request is made. The script then generates HTML.

5. URL stands for ________
a) unique reference label
b) uniform reference label
c) uniform resource locator
d) unique resource locator
Answer: c
Explanation: The Uniform Resource Locator is a locator for the resource to be located by HTTP on the World Wide Web. The URL is derived from the Uniform Resource Identifier.

6. A web cookie is a small piece of data that is _______
a) sent from a website and stored in user’s web browser while a user is browsing a website
b) sent from user and stored in the server while a user is browsing a website
c) sent from root server to all servers
d) sent from the root server to other root servers
Answer: a
Explanation: A web cookie is a small piece of data sent from a website and stored in user’s web browser while a user is browsing the website and is used to remember stateful information about the user’s operations on the website. This can help the website provide a better browsing experience to the user.

7. Which one of the following is not used to generate dynamic web pages?
a) PHP
b) ASP.NET
c) JSP
d) CSS
Answer: d
Explanation: CSS alone cannot be used to generate dynamic web pages as it does not provide many event handling functions. It can be used along with JavaScript to generate dynamic web pages which are visually compelling.

8. An alternative to JavaScript on windows platform is _______
a) VBScript
b) ASP.NET
c) JSP
d) PHP
Answer: a
Explanation: VBScript is a general-purpose, lightweight and active scripting language which can be used on Microsoft Visual Basic. It was first released in 1996.

9. What is document object model (DOM)?
a) convention for representing and interacting with objects in html documents
b) application programming interface
c) hierarchy of objects in ASP.NET
d) scripting language
Answer: a
Explanation: DOM is a hierarchical model i.e. a tree used to represent an HTML or XML document. Every node of the tree an object that represents a part of the document.

10. AJAX stands for _______
a) asynchronous javascript and xml
b) advanced JSP and xml
c) asynchronous JSP and xml
d) advanced javascript and xml
Answer: a
Explanation: AJAX is a group of technologies that works on the client-side to create asynchronous web applications. It is used to modify only a part of a webpage and not the whole webpage whenever some event occurs.

11. Which of the reasons will force you to use XML data model in SQL Server?
a) Your data is sparse or you do not know the structure of the data
b) Your data represents containment hierarchy
c) Order is inherent in your data
d) All of the Mentioned
Answer: d
Explanation: XML is a good choice if you want a platform-independent model in order to ensure the portability of the data by using structural and semantic markup.

12. Which of the following is not a XML storage option?
a) Native storage as XML data type
b) Mapping between XML and relational storage
c) Small object storage
d) None of the Mentioned
Answer: c
Explanation: XML uses large object storage which uses varchar(max) and varbinary(max).

13. The choice of XML technology, native XML versus XML view, generally depends upon the following factors?
a) Storage options
b) Query capabilities
c) Indexing
d) All of the Mentioned
Answer: d
Explanation: Different XML choices may also have different performance characteristics.

14. In which of the following scenario, using XML native storage would be inappropriate?
a) Fixed schema
b) You want to query and modify your XML data
c) You want to index the XML data for faster query processing
d) Your application needs system catalog views to administer your XML data and XML schema
Answer: a
Explanation: XML is appropriate when we may or may not have a schema for your XML data.

15. XML View Technology is useful in the following situations?
a) Your application needs system catalog views to administer your XML data and XML schema
b) Indexing Capabilities
c) You want to bulk load XML data and decompose them into the underlying tables by using the XML view
d) None of the Mentioned
Answer: c
Explanation: XML bulk load can be used to populate the underlying tables by using the XML view.

16. What is the hybrid model in SQL Server?
a) Combination of relational and XML data type columns
b) Combination of relational and non relational data type columns
c) Using XML with views
d) Using XML with triggers
Answer: a
Explanation: Hybrid model may yield better performance in that you have more control over the indexes created on the relational columns and locking characteristics.

17. Reasons to use native XML features in SQL Server instead of managing your XML data in the file system would be:
a) You need language support for query and data modification for cross-domain applications
b) You want the server to guarantee that the data is well formed and also optionally validate your data according to XML schema
c) You want indexing of XML data for efficient query processing and good scalability, and the use of a first-rate query optimizer
d) All of the mentioned
Answer: d
Explanation: If none of these conditions is satisfied, it may be better to store your data as a non-XML, large object type, such as varchar(max) or varbinary(max).

18. Which of the following part of the XML data stored in an XML column is very important for locking?
a) Granularity
b) Degree of Structure
c) Hierarchy
d) None of the mentione
Answer: a
Explanation: When the granularity is large, locking large XML instances for updates causes throughput to decline in a multi user scenario.

19. XML datatype was introduced in which of the following versions of SQL Server?
a) SQL Server 2000
b) SQL Server 2005
c) SQL Server 2008
d) SQL Server 2012
Answer: b
Explanation: XML data type allows variables and columns to be created to specifically hold xml data, whether it be an entire XML document or just some XML content.

20. Which of the following feature of SQL Server was used before XML technology for semi structured data?
a) Stored Procedure
b) Dynamic management views
c) In memory database
d) None of the mentioned
Answer: a
Explanation: You need to create a stored procedure to process incoming XML from a partner before SQL Server 2005.

21. In distributed system, each processor has its own ___________
a) local memory
b) clock
c) both local memory and clock
d) none of the mentioned
Answer: c
Explanation: None.

22. If one site fails in distributed system then ___________
a) the remaining sites can continue operating
b) all the sites will stop working
c) directly connected sites will stop working
d) none of the mentioned
Answer: a
Explanation: None.

23. Network operating system runs on ___________
a) server
b) every system in the network
c) both server and every system in the network
d) none of the mentioned
Answer: a
Explanation: None.

24. Which technique is based on compile-time program transformation for accessing remote data in a distributed-memory parallel system?
a) cache coherence scheme
b) computation migration
c) remote procedure call
d) message passing
Answer: b
Explanation: None.

25. Logical extension of computation migration is ___________
a) process migration
b) system migration
c) thread migration
d) data migration
Answer: a
Explanation: None.

26. Processes on the remote systems are identified by ___________
a) host ID
b) host name and identifier
c) identifier
d) process ID
Answer: b
Explanation: None.

27. Which routing technique is used in a distributed system?
a) fixed routing
b) virtual routing
c) dynamic routing
d) all of the mentioned
Answer: d
Explanation: None.

28. In distributed systems, link and site failure is detected by ___________
a) polling
b) handshaking
c) token passing
d) none of the mentioned
Answer: b
Explanation: None.

29. The capability of a system to adapt the increased service load is called ___________
a) scalability
b) tolerance
c) capacity
d) none of the mentioned
Answer: a
Explanation: None.

30. Internet provides _______ for remote login.
a) telnet
b) http
c) ftp
d) rpc
Answer: a
Explanation: None.

31. A web service contract is described using :-
a) Web Services Description Language
b) Web Services Description
c) All of the mentioned
d) None of the mentioned
Answer: a
Explanation: In contract-last, you expose an existing service interface as a web service whose service contract is generated automatically.

32. There are two approaches to developing a web service, depending on whether you define the contract first or last.
a) True
b) False
Answer: a
Explanation: A web service contract is described using Web Services Description Language (WSDL). In contract-last, you expose an existing service interface as a web service whose service contract is generated automatically. In contract-first, you design the service contract in terms of XML and then write code to fulfill it.

33. In contrast, the contract-first approach encourages you to think of the service contract first in terms of :-
a) XML
b) XML Schema(.xsd)
c) WSDL
d) All of the mentioned
Answer: d
Explanation: In contrast, the contract-first approach encourages you to think of the service contract first, in terms of XML, using XML schema (.xsd) and WSDL.

34. In some cases, it’s also hard to map an object to XML (e.g., an object graph with cyclic references) because there’s actually an impedance mismatch between an object model and an XML model.
a) True
b) False
Answer: a
Explanation: Just like that between an object model and a relational model.

35. Service exporters that can export a bean as a remote service based on the :-
a) RMI
b) Hessian
c) Burlap
d) All of the mentioned
Answer: d
Explanation: Spring comes with several service exporters that can export a bean as a remote service based on the RMI, Hessian, Burlap, or HTTP Invoker remoting technologies.

36. Spring comes with a service exporter that can export a bean as a SOAP web service.
a) True
b) False
Answer: b
Explanation: Spring doesn’t come with a service exporter that can export a bean as a SOAP web service. We will use Apache CXF, which is the de facto successor to XFire.

37. The standard for deploying web services on the Java EE platform as of Java EE 1.4:-
a) JAX-RPC
b) JAX
c) RPC
d) None of the mentioned
Answer: a
Explanation: The standard for deploying web services on the Java EE platform as of Java EE 1.4 was called JAX-RPC. It supported SOAP 1.0 and 1.1, but didn’t support message-oriented web services.

38. To send objects across the wire, beans need to be encoded using the Java Architecture for XML Binding (JAXB).
a) True
b) False
Answer: a
Explanation: JAXB supports many class types out of the box with no special support.

39. If you are deploying into a Java EE 5 (or better) container, you may simply create a bean that is annotated with:-
a) javax.jws.WebService
b) javax.jws.WebServiceProvider
c) all of the mentioned
d) none of the mentioned
Answer: c
Explanation: If you are deploying into a Java EE 5 (or better) container, you may simply create a bean that is annotated with javax.jws.WebService or javax.jws.WebServiceProvider and deploy that into a container in your web application.

40. If you are using the JAX-RS Reference Implementation, this intermediary step will involve a tool called wsgen.
a) True
b) False
Answer: a
Explanation: It will generate the configuration (a file called sun-jaxws.xml) and wrapper beans required to expose your service.

41. Spring provides a factory that can export beans annotated with:-
a) javax.jws.WebService
b) javax.jws.WebServiceProvider
c) all of the mentioned
d) none of the mentioned
Answer: c
Explanation: Spring provides a factory that can export beans annotated with javax.jws.WebService or javax.jws.WebServiceProvider inside the Spring context and then publishes the services using the JAX-WS runtime.

42. Exposing a stand-alone SOAP endpoint using the:-
a) SimpleJaxWsServiceExporter
b) JAX-WS
c) All of the mentioned
d) None of the mentioned
Answer: c
Explanation: Exposing a stand-alone SOAP endpoint using the SimpleJaxWsServiceExporter or the support for JAX-WS in a Java EE container in conjunction with Spring is simple, but these solutions ignore the largest cross-section of developers—people developing on Tomcat.

43. Tomcat doesn’t support JAX-WS by itself.
a) True
b) False
Answer: a
Explanation: Tomcat doesn’t support JAX-WS by itself, so we need to help it by embedding a JAX-WS runtime. There are many choices, and you’re free to take your pick. Two popular choices are Axis2 and CXF, both of which are Apache projects.

44. CXF represents the consolidation of the Celtix and XFire projects, which each had useful SOAP support.
a) True
b) False
Answer: a
Explanation: For our example, we’ll embed CXF since it’s robust, fairly well tested, and provides support for other important standards like JAX-RS, the API for REST-ful endpoints.

45. Factory to use our Spring bean as the implementation:-
a) jaxws:end
b) jaxws:endpoint
c) all of the mentioned
d) none of the mentioned
Answer: b
Explanation: We tell the jaxws:endpoint factory to use our Spring bean as the implementation. We tell it at what address to publish the service using the address element.

46. Spring-WS supports using XML marshalling technology to marshal and unmarshal objects to and from XML documents.
a) True
b) False
Answer: a
Explanation: This technology is also known as object/XML mapping (OXM) because you are actually mapping objects to and from XML documents.

47. To implement endpoints with an XML marshalling technology, you have to extend the:-
a) AbstractMarshallingPayload
b) AbstractMarshalling
c) AbstractMarshallingPayloadEndpoint
d) None of the mentioned
Answer: c
Explanation: To implement endpoints with an XML marshalling technology, you have to extend the AbstractMarshallingPayloadEndpoint class and configure an XML marshaller for it.

48. Marshaller for JAXB 1.0:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Answer: a
Explanation: JAXB 1.0 org.springframework.oxm.jaxb.Jaxb1Marshaller.

49. Marshaller for JAXB 2.0:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Answer: b
Explanation: JAXB 2.0 org.springframework.oxm.jaxb.Jaxb2Marshaller.

50. Marshaller for Castor:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Answer: c
Explanation: Castor org.springframework.oxm.castor.CastorMarshaller.

51. Marshaller for XMLBeans:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
Answer: d
Explanation: XMLBeans org.springframework.oxm.xmlbeans.XmlBeansMarshaller.

52. Marshaller for JiBX:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.jibx.JibxMarshaller
Answer: d
Explanation: JiBX org.springframework.oxm.jibx.JibxMarshaller.

53. Marshaller for XStream:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.xstream.XStreamMarshaller
d) org.springframework.oxm.jibx.JibxMarshaller
Answer: c
Explanation: XStream org.springframework.oxm.xstream.XStreamMarshaller.

54. Spring-WS supports various XML marshalling APIs.
a) Castor
b) JAXB 1.0
c) XMLBeans
d) All of the mentioned
Answer: d
Explanation: Spring-WS supports various XML marshalling APIs, including JAXB 1.0, JAXB 2.0, Castor, XMLBeans, JiBX, and XStream.

55. For some marshalling APIs, the object model must be generated by them so that they can insert marshalling-specific information.
a) True
b) False
Answer: a
Explanation: Because Castor supports marshalling between XML messages and arbitrary Java objects, you can start creating the following classes by yourself.

56. A marshalling endpoint requires:-
a) marshaller
b) unmarshaller
c) all of the mentioned
d) none of the mentioned
Answer: c
Explanation: A marshalling endpoint requires both the marshaller and unmarshaller properties to be set. Usually, you can specify a single marshaller for both properties. For Castor, you declare a CastorMarshaller bean as the marshaller.

57. Castor requires a mapping configuration file to know how to map objects to and from XML documents.
a) True
b) False
Answer: a
Explanation: You can create this file in the classpath root and specify it in the mappingLocation property (e.g., mapping.xml).

58. Spring-WS supports annotating an arbitrary class as a service endpoint by:-
a) @Endpoint
b) @End
c) @Point
d) None of the mentioned
Answer: a
Explanation: Spring-WS supports annotating an arbitrary class as a service endpoint by the @Endpoint annotation, without extending a framework-specific class.

59. When you are using XML marshalling, WebServiceTemplate requires both the marshaller and unmarshaller properties to be set.
a) True
b) False
Answer: a
Explanation: You can also set them to WebServiceGatewaySupport if you extend this class to have WebServiceTemplate auto-created.

60. A Spring-WS client can also marshall and unmarshal the request and response objects to and from XML messages.
a) True
b) False
Answer: a
Explanation: As an example, we will create a client using Castor as the marshaller so that you can reuse the object models.

61. To publish a REST service with Spring.
a) publishing an application’s data as a REST service
b) accessing data from third-party REST services
c) none of the mentioned
d) all of the mentioned
Answer: d
Explanation: One involves publishing an application’s data as a REST service, the other one involves accessing data from third-party REST services to be used in an application.

62. Publishing an application’s data as a REST service requires.
a) @RequestMapping
b) @PathVariable
c) All of the mentioned
d) None of the mentioned
Answer: c
Explanation: Publishing an application’s data as a REST service revolves around the use of the Spring MVC annotations @RequestMapping and @PathVariable.

63. Spring supports a series of mechanisms to generate a REST service payload.
a) True
b) False
Answer: a
Explanation: This recipe will explore the simplest mechanism, which involves the use of Spring’s MarshallingView class.

64. Annotation added as an input parameter to the handler method.
a) @PathVariable
b) @Path
c) @PathLocale
d) None of the mentioned
Answer: a
Explanation: The @PathVariable annotation is added as an input parameter to the handler method, per Spring’s MVC conventions, in order for it to be used inside the handler method body.

65. Notation for defining REST endpoints.
a) { }
b) *
c) All of the mentioned
d) None of the mentioned
Answer: c
Explanation: In addition to supporting the { } notation, it’s also possible to use a wildcard * notation for defining REST endpoints.

66. General-purpose class that allows a response to be rendered using a marshaller.
a) MarshallingView
b) Marshalling
c) View
d) All of the mentioned
Answer: a
Explanation: The membertemplate view is defined as a MarshallingView type, which is a general-purpose class that allows a response to be rendered using a marshaller.

67. Marshalling is the process of transforming an in-memory representation of an object into a data format.a
a) True
b) False
Answer: a
Explanation: Therefore, for this particular case, a marshaller is charged with transforming a Member object into an XML data format.

68. The marshaller used by MarshallingView belongs to one of a series of XML marshallers.
a) Jaxb2Marshaller
b) XmlBeansMarshaller
c) CastorMarshalle
d) All of the mentioned
Answer: d
Explanation: The marshaller used by MarshallingView belongs to one of a series of XML marshallers provided by Spring—Jaxb2Marshaller. Other marshallers provided by Spring include CastorMarshaller, JibxMarshaller, XmlBeansMarshaller, and XStreamMarshaller.

69. To configure Jaxb2Marshaller marshaller we require.
a) ClassesToBeBound
b) ContextPath
c) All of the mentioned
d) None of the mentioned
Answer: c
Explanation: The Jaxb2Marshaller marshaller requires to be configured with either a property named classesToBeBound or contextPath.

70. In the case of classesToBeBound, the classes assigned to this property, indicate the class (i.e., object) structure that is to be transformed into XML.
a) True
b) False
Answer: a
Explanation: The Jaxb2Marshaller marshaller requires to be configured with either a property named classesToBeBound or contextPath.

71. Annotation which allows the Jaxb2Marshaller marshaller to detect a class’s (i.e., object’s) fields.
a) @XmlRootElement
b) @XmlRoot
c) @NotNull
d) None of the mentioned
Answer: a
Explanation: This annotation allows the Jaxb2Marshaller marshaller to detect a class’s (i.e., object’s) fields and transform them into XML data.

72. Accessing a third-party REST service inside a Spring application.
a) RestTemplate Class
b) ViewResolver
c) InternalViewResolver
d) View
Answer: a
Explanation: Accessing a third-party REST service inside a Spring application revolves around the use of the Spring RestTemplate class.

73. REST service end point comprises an address.
a) starts with http:// and ends with ?
b) starts with http:// and ends with &
c) no certain URL is specified
d) depends upon the platform used
Answer: a
Explanation: The structure of the REST service end point comprises an address, which starts with http:// and ends with ?, as well as a series of parameters that start with ? and are delimited by &, each represented by a key and value divided by =.

74. XML tag which represents information related to a REST service request.
a) Result
b) Title
c) None of the mentioned
d) All of the mentioned
Answer: d
Explanation: The actual meaning of the payload is highly dependent on a REST service. In this case, the XML tags (e.g., Result, Title ) are definitions set forth by Yahoo, while the character data enclosed in each XML tag represents information related to a REST service request.

75. RestTemplate class method which performs an HTTP HEAD operation.
a) headForHeaders(String, Object…)
b) getForObject(String, Class, Object…)
c) postForLocation(String, Object, Object…)
d) postForObject(String, Object, Class, Object…)
Answer: a
Explanation: headforHeaders() is a RestTemplate class method based on HTTP protocol request methods.

76. Payload format for REST services.
a) RSS
b) Atom
c) JSON
d) All of the mentioned
Answer: d
Explanation: JSON, in addition to RSS and Atom, has blossomed into a favorite payload format for REST services.

77. All REST service payloads rely on XML markup.
a) True
b) False
Answer: b
Explanation: JSON is different in the sense that its content is a special notation based on the JavaScript language.

78. Class that forms part of Spring to apply JSON content.
a) MappingJacksonJsonView
b) MappingJsonView
c) MappingJacksonJson
d) JsonView
Answer: a
Explanation: In addition to relying on Spring REST support, we will also use the MappingJacksonJsonView class that forms part of Spring to facilitate the publication of JSON content.

79. The MappingJacksonJsonView class depends on Jackson JSON processor library.
a) org.codehaus.jackson
b) jackson-mapper-asl
c) all of the mentioned
d) none of the mentioned
Answer: a
Explanation: The MappingJacksonJsonView class depends on the presence of the Jackson JSON processor library which can be downloaded at http://wiki.fasterxml.com/JacksonDownload.

80. Information you wish to publishas a JSON Object can be located in a RDBMS or text file, accessed through JDBC or ORM.
a) True
b) False
Answer: a
Explanation: This information can be located in a RDBMS or text file, accessed through JDBC or ORM, inclusively be part of a Spring bean or some other type of construct.

81. JSON payload consists of text and separators like.
a) { , }
b) ( , )
c) :
d) All of the mentioned
Answer: d
Explanation: a JSON payload consists of text and separators like { , }, ( , ), : and “.

82. To access JSON in a Spring application, library used is:-
a) JSON-LIB
b) SpringJSON-lib
c) JSON-lib
d) None of the mentioned
Answer: a
Explanation: Though it’s technically possible to access JSON in a Spring application (i.e., on the server side), using a third-party Java library like JSON-LIB (http://json-lib.sourceforge.net/ ).

83. You are often better served accessing and manipulating REST services with XML payloads in Spring applications.
a) True
b) False
Answer: a
Explanation: The Java platform’s native support for XML, in addition to the fact that XML is more intuitive and does not have the same processing limitations as browsers.

84. Class which is capable of performing a multitude of operations on REST services.
a) RestTemplate
b) XPathTemplate
c) XMLTemplate
d) JavaTemplate
Answer: a
Explanation: Spring RestTemplate class is capable of performing a multitude of operations on REST services in order for their payloads to be used inside Spring applications, processing elaborate XML responses requires using a set of approaches beyond those of this last class.

85. XML query language for selecting nodes from an XML document.
a) XPathTemplate
b) XPath
c) All of the mentioned
d) None of the mentioned
Answer: b
Explanation: XPath—an XML query language for selecting nodes from an XML document— knowledge about Spring HttpConverterMessage, as well as supporting facilities like Spring XPathTemplate.

86. The Handler method assigns the returning XML payload to a String.
a) True
b) False
Answer: a
Explanation: The handler method makes use of the getForObject method of the RestTemplate class and assigns the returning XML payload to a String, which is then added to the handler method Model object.

87. To extract and manipulate payloads in Spring REST in a format other than String.
a) HttpConverter
b) HttpMessage
c) HttpConverterMessage
d) None of the mentioned
Answer: c
Explanation: All objects that are returned and inclusively passed to the methods belonging to the RestTemplate class are converted to and from HTTP messages using a class which implements the HttpConverterMessage interface.

88. To write your own converters relying on the MarshallingHttpMessageConverter interface that would allow the use of custom marshallers.
a) messageConverters
b) messageConvert
c) converters
d) convertersMessage
Answer: a
Explanation: Using custom converters requires registering them with the messageConverters bean property in a Spring application.

89. To override the default implementations registered with the RestTemplate class.
a) messageConverters
b) messageConvert
c) converters
d) convertersMessage
Answer: a
Explanation: It’s also possible to override the default implementations registered with the RestTemplate class using the same messageConverters bean property.

90. To extract and manipulate the contents of a REST service payload.
a) messageConverters
b) StreamSource class
c) converters
d) convertersMessage
Answer: b
Explanation: It becomes easier to extract and manipulate the contents of a REST service payload since it can be done through the more flexible StreamSource class.

Module 06

1. What happens when url.py file is edited while the development server is still running?
a.Development server terminates.
b.The development server automatically restarts.
c.The development server does nothing.
d.The web page is automatically reloaded.
Answer: b

2. Which setting contains the parameter of main-urls file?
a.ROOT_URLCONF
b.MAIN_URLCONF
c.STATIC_URL
d.MEDIA_URL
Answer: a

3. Django is based on which framework?
a.MVC
b.MVVM
c.MVT or MTV (Model-View-Template)
d.None of the above
Answer: c

4. What is the purpose of __init__.py in project directories?
a.It allows Python to recognise the folder as package.
b.It is useless and can be deleted.
c.It is used to initialise any empty values.
d.None of the above
Answer: a

5. Which method is used instead of path() in urls.py to pass in regular expressions as routes?
a.static()
b.re_path()
c.include()
d.url()
Answer: d

6. What is the use of os.path.dirname(__file__) in this method?
a.It is the default value and points to Django settings.py.
b.It is passing some value defined before.
c.It is used to pass the value of current file in which this line is written.
d.None of the above
Answer: c

7. What does happen when you execute this command in Terminal/ PowerShell?
a.It will open interactive interpreter in command line with settings.py file imported.
b.It will run manage.py in command line.
Answer: a

8 What is the value of DEBUG when website is online/ or deployed?
a.False
b.True
c.None
d.Null
Answer: a

9. What does {{ name }} this mean in Django Templates?
a.It will be displayed as name in HTML.
b.The name will be replaced with values of Python variable.
c.{{ name }} will be the output.
d.None of the above
Answer: b

10. Check in-valid template tag.
a.{% If %}/ {% else %}
b.{% ifequal %}
c.{% while %} – wrong
d.{% for key in dictionary %}
Answer: c

11. What does {{ forloop.counter }} prints?
a.It will not print if for loop variable is not defined.
b.It will count the number of times loop ran.
c.It prints the integer value of no. of times the loop executed.
d.None of the above
Answer: c

12. This template {# #} is used for?
a.It is comment in template language.
b.It is used for business logic.
c.It will raise an exception.
d.None of the above
Answer: a

13. What does {% include %} does?

Answer: a

14.What is a Django App?

a.An app is a functionality, including models and views, that lives together in a single Python package.
Answer: d

15.What are Migrations in Django?

Answer: d

16.What is the purpose of __str__() method?

Answer: c

17.What is Post.objects.all() is used for?

Answer: a

18.What would variable m output

Answer: c

19.In Post.models.filter() you can pass multiple parameters in filter() to narrow your result/s.

a.True
Answer: a

20.What effect does _ _ contains does in this parameter?

Answer: a

21.What will happen on execution of this command : > python manage.py createsuperuser

a.It will create an admin superuser.
Answer: c

22.What does admin.autodiscover() do?

a.It will look through INSTALLED_APPS when admin is requested.
Answer: c

23.This is admin.py file in an application. It will register models Post and Like in Django Admin site.

Answer: a

24.What is request.META in request object?

a.It is a python dictionary.
Answer: d

25.What kind of non-HTML outputs can Django generate?

a).epub Files
Answer: a

26.What are request.GET and request.POST objects?

a.Python Dictionaries
Answer: c

27.Which code will give us a text area form field?

a.Field_name = forms.TextAreaField()



Answer: b

28. Suppose you want to count the number of books in Django.
books = Book.objects.all()
Which implementation would be fastest?

Answer: a

29.From the previous question, suppose we want to implement the Query in the template. Choose one option which provides an optimal solution.

a.{{ books | length }}
Answer: b

30.What are some of the ways by which we can improve the site’s performance?

Please select 5 correct answers

Answer: a,b,c,d,e

31.Which of these variables are the settings for django.contib.staticfiles app?

Please select 4 correct answers
Answer: a,b,e,f

32.Which of these commands is not a management command of staticfiles?

a.python manage.py collectstatic
Answer: d

33.What data types and objects are not accepted as an argument by Paginator class?

a.Dictionary
Answer: e

34.Suppose I have a Python class like this. Now, if we pass the obj in a context variable and add the template like this. {{ obj.topic }} Which value will the template engine return?

Answer: a

35.What are some valid forloop attributes of Django Template System?

Please select 3 correct answers
Answer: a,b,f


Prepare For Your Placements: https://lastmomenttuitions.com/courses/placement-preparation/

/ Youtube Channel: https://www.youtube.com/channel/UCGFNZxMqKLsqWERX_N2f08Q

Follow For Latest Updates, Study Tips & More Content!

/lastmomenttuition

/ Last Moment Tuitions

/ lastmomentdost