Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

What will the file_get_contents() return?(a) Server’s response(b) Errors(c) Exception(d) Client’s response

Answer» The correct option is (a) Server’s response

The best explanation: The file_get_contents() is a PHP’s native function used to hit the URL and read the server’s response into

a variable $wpt_response:
52.

Which is the most appropriate database for developers requiring a huge amount of data?(a) Database(b) Datawarehouse(c) Web databases(d) Access

Answer» Correct option is (c) Web databases

To elaborate: Developers who need to work with really huge amounts of data like to use databases, and the most recent browsers have started to integrate client-side database functionality into their browsers. Client data base helps in making the website faster and handling the data easier.
53.

The HTML5 specification does not includes __________(a) Data storage(b) Graphics APIs(c) Other APIs for web apps(d) Networking

Answer» Right option is (d) Networking

The explanation is: The HTML5 specification (which, at the time of this writing, is still in draft form) and related specifications are defining a number of other important APIs for web apps. These include data storage and graphics APIs.The data storage api can store data locally within the user’s browser.
54.

How many parameters does the method plot() accept?(a) 6(b) 7(c) 8(d) 9

Answer» Correct answer is (d) 9

For explanation I would say: Plot() is a generic function, meaning, it has many methods which are called according to the type of object passed to plot(). The method plot() accepts a total of 9 parameters.
55.

The localStorage and sessionStorage belongs to ___________(a) Window object(b) Element object(c) Hash object(d) DOM object

Answer» Correct choice is (a) Window object

For explanation: Browsers that implement the “Web Storage” draft specification define two properties on the Window object: localStorage and sessionStorage. Local storage and Session storage are the web storage objects. Session storage is destroyed once the user closes the browser whereas, Local storage stores data with no expiration date.
56.

Which of the following is defined by the specification?(a) dataMethod(b) input(c) inputMethod(d) inputdataMethod

Answer» Right option is (c) inputMethod

To explain I would say: The specification defines an inputMethod property on the event object and a set of constants representing different kinds of text input (keyboard, paste or drop, handwriting or voice recognition, and so on). prompt function is a kind of input method.
57.

What does a History object contain?(a) URL(b) Parameters(c) Attribute values(d) Property

Answer» Right choice is (a) URL

For explanation: The history object contains the URLs visited by the user. By using history object, you can load previous, forward or any particular page using various methods.
58.

How many methods are there in the History object?(a) 3(b) 4(c) 5(d) 6

Answer» The correct answer is (a) 3

To explain: There are three methods belonging to the History object namely :

back()

forward()

go()

back() loads the previous URL, forward loads the next URL and go() loads a specific URL in the history list.
59.

The necessary globals of a node are defined under which namespace?(a) variables(b) system(c) process(d) using

Answer» Right choice is (c) process

Easiest explanation: The process object is a global that provides information about, and control over, the current Node.js process. Node defines other important globals under the process namespace.
60.

Which is not a form of client-side storage?(a) Web Databases(b) FileSystem API(c) Offline Web Applications(d) Online Web Applications

Answer» Right answer is (d) Online Web Applications

To explain: Client-side storage allows the creater to store data on the users system for faster loading of the website. The various forms of client-side storage are web databases, filesystem API, Offline web applications and cookies.
61.

R is an extension of which of the following language?(a) C(b) C++(c) S(d) C#

Answer» Right choice is (c) S

The best explanation: The R language is widely used among statisticians and data miners for developing statistical software and data analysis. R is an extension of and successor to the S language, which was itself a statistical language created in 1976 by John Chambers while at Bell Labs.
62.

How many parameters does the replaceState() method take?(a) 2(b) 3(c) 4(d) 5

Answer» Correct answer is (b) 3

Best explanation: The replaceState() updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. window.history.replaceState(stateObj, title, url) : This is just like window.history.pushState, except that the current browser state is removed from the history, so you cannot hit “back” to return to it.
63.

What is the lifetime of the data stored through localStorage?(a) Permanent(b) Temporary(c) Both Permanent and Temporary at times(d) Cannot store

Answer» Correct answer is (a) Permanent

Easiest explanation: Data stored through localStorage is permanent. it does not expire and remains stored on the user’s computer until a web app deletes it or the user asks the browser (through some browser-specific UI) to delete it. This data is stored on the client side server and is used for faster access of data.
64.

Which property is used to specify the key type when pressed?(a) keyCode(b) keyType(c) keyName(d) keyProperty

Answer» Correct option is (a) keyCode

The best explanation: The keyCode property returns the Unicode character code of the key that triggered the onkeypress event, or the Unicode key code of the key that triggered the onkeydown or onkeyup event. The event object associated with these events has a numeric keyCode property that specifies which key was pressed.
65.

The history object is a part of which object?(a) Property(b) Window(c) Location(d) Screen

Answer» Correct choice is (b) Window

The best explanation: The window object represents an open window in a browser. The history object belongs to the Window object.
66.

Why does Node not block while waiting for operations to complete?(a) Static(b) Asynchronous(c) Synchronous(d) Recursive

Answer» Right choice is (b) Asynchronous

Easy explanation: Node executes the function the in one go without any waiting or blocking. Because the Node’s functions and methods are asynchronous, they do not block while waiting for operations to complete.
67.

Which of the following are the parameters passed to the keymap after installation?(a) Key property(b) Key name(c) Keydown event’s object(d) Key stroke

Answer» Right option is (c) Keydown event’s object

The explanation is: After the keymap is installed, the following parameters are passed:

The event object for the keydown event.

The key identifier of the key that was pressed.

Identifier key contains the information of the key that is pressed and the object information about the function to be performed when the key is pressed.
68.

How can you set a Cookie visibility scope to localStorage?(a) /(b) %(c) *(d) //

Answer» Right answer is (a) /

The 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.
69.

Which of the following is not a navigator property?(a) platform[](b) plugin[](c) userAgent[](d) browser[]

Answer» Correct choice is (d) browser[]

Explanation: The navigator object contains information about the browser. All of the above mentioned are the properties of a navigator.
70.

Which of the following is the child object of the JavaScript navigator?(a) Navicat(b) Plugins(c) NetRight(d) Plugs

Answer» Right answer is (b) Plugins

Explanation: The JavaScript navigator object is used for browser detection. The JavaScript navigator object includes a child object called plugins.
71.

How many read-only attributes are present in the navigator object?(a) 1(b) 2(c) 3(d) 4

Answer» The correct option is (b) 2

The best I can explain: The navigator object contains information about the browser. There are a total of 2 read-only attributes present in the navigator object namely:

redirectCount

type.
72.

Which of the following is not a WebSocket event?(a) open(b) close(c) error(d) deny

Answer» Correct choice is (d) deny

Explanation: There is no WebSocket event named deny. The four WebSocket events are

open

close

message

error

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.
73.

Which of the following defines the Cookie visibility?(a) domain Path(b) local & session storage(c) server storage(d) transient Path

Answer» The correct option is (b) local & session storage

For explanation I would say: 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.
74.

Why is the total size of the page important?(a) Time taken to download(b) Size of IP packet should be less than 65500(c) Size of IP packet should be less than 65535(d) Size of IP packet should be greater than 65500

Answer» Right option is (c) Size of IP packet should be less than 65535

For explanation: The total size of the page is important, not just because of the time it takes to download, but because the maximum size of an IP packet is 65535 octets for IPv4 and IPv6.
75.

Which is the function in JavaScript that will print the current page in JavaScript?(a) print()(b) printcurrent()(c) print(now)(d) print(this)

Answer» The correct answer is (a) print()

For explanation: The print() method prints the contents of the current window. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
76.

The let keyword cannot be used ___________(a) as a substitute of var(b) as a block statement to define new variables(c) to define variables that are scoped to a single expression(d) in a else if loop, as a substitute for var

Answer» Right option is (d) in a else if loop, as a substitute for var

The explanation is: The let keyword can be used in four ways :

as a variable declaration like var;

in a for or for/in loop, as a substitute for var;

as a block statement, to define new variables and explicitly delimit their scope; and

to define variables that are scoped to a single expression.
77.

Which is the keyword used to open the Help window?(a) ()(b) #(c) ?(d) =

Answer» Correct option is (c) ?

The best explanation: The help() function and ? help operator in R provides access to the documentation pages for R functions, data sets, and other objects, both for packages in the standard R distribution and for contributed packages. At any time, you can type ? (keyword) to open the help window for a particular subject.
78.

What does the method Performance.now() return?(a) DOMTimeStamp(b) DOMHighResTimeStamp(c) DOMStamp(d) TimeStamp

Answer» The correct choice is (b) DOMHighResTimeStamp

The best I can explain: The Performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond equal to the number of milliseconds since the PerformanceTiming.navigationStart property and the call to the method. The returned value represents the time elapsed since the time origin.
79.

Which was one of the first security subsets proposed?(a) FBJS(b) Caja(c) dojox.secure(d) ADSafe

Answer» Correct option is (d) ADSafe

The explanation is: ADsafe was one of the first security subsets proposed) It was created by Douglas Crockford (who also defined The Good Parts subset). ADsafe relies on static verification only, and it uses JSLint as its verifier. It forbids access to most global variables and defines an ADSAFE variable that provides access to a secure API, including special-purpose DOM methods. ADsafe is not in wide use, but it was an influential proof-of-concept that influenced other secure subsets.
80.

The generalised syntax for a real number representation is __________(a) [digits][.digits][(E|e)[(+|-)]digits](b) [digits][+digits][(E|e)[(+|-)]digits](c) [digits][(E|e)[(+|-)]digits](d) [.digits][digits][(E|e)[(+|-)]digits]

Answer» Correct option is (a) [digits][.digits][(E|e)[(+|-)]digits]

The explanation is: Floating-point literals may also be represented using exponential notation: a real number followed by the letter e (or E), followed by an optional plus or minus sign, followed by an integer exponent. This notation represents the real number multiplied by 10 to the power of the exponent.
81.

How many node types are there in total?(a) 11(b) 12(c) 13(d) 14

Answer» Right option is (b) 12

Easiest explanation: There are total of 12 node types. The nodeType property returns the node type, as a number, of the specified node.
82.

What does a Node object represent?(a) Single node(b) Set of nodes(c) Sequence of nodes(d) Node array

Answer» Right choice is (a) Single node

To elaborate: The Node object represents a single node in the document tree. A node can be an element node, an attribute node, a text node, or any other of the node types explained in the Node Types chapter.
83.

What does Rhino do when the getter and setter methods exist?(a) It becomes JavaScript properties(b) Java classes are used to avoid them(c) Java classes & JavaScript properties(d) It act as javascript function

Answer» The correct option is (a) It becomes JavaScript properties

The best I can explain: Rhino allows JavaScript code to query and set the static fields of Java classes and the instance fields of Java objects. Java classes often avoid defining public fields in favor of getter and setter methods. When getter and setter methods exist, Rhino exposes them as JavaScript properties.
84.

The style property belongs to which of the following object?(a) Element(b) Window(c) Location(d) Navigation

Answer» Correct answer is (a) Element

For explanation I would say: Each Element object has style and className properties that allow scripts to specify CSS styles for a document element or to alter the CSS class names that apply to the element.
85.

What is the purpose of the Node object property ownerDocument?(a) Returns the root element(b) Returns the last element(c) Returns the parent node(d) Returns the immediate node

Answer» The correct option is (a) Returns the root element

The best explanation: The ownerDocument property returns the owner document of a node, as a Document object. It returns the root element for a node.
86.

What does the span of time waiting for the page to be useful depending on?(a) Runtime performance(b) Web performance(c) Speed(d) Runtime performance & Speed

Answer» Right option is (b) Web performance

For explanation: Web performance refers to the speed in which web pages are downloaded and displayed on the user’s web browser. The span of time that you are waiting for the page to be usable depends on web performance.
87.

The navigator property belongs to which of the following object?(a) Document(b) Window(c) Navigator(d) Location

Answer» The correct answer is (c) Navigator

The explanation is: The navigator property of a Window object refers to a Navigator object that contains browser vendor and version number information. Navigator object property includes appCodeName, appVersion, appName etc.
88.

Which method receives the return value of setInterval() to cancel future invocations?(a) clearInvocation()(b) cancelInvocation()(c) clearInterval()(d) clear()

Answer» Right answer is (c) clearInterval()

The explanation is: Like setTimeout(), setInterval() returns a value that can be passed to clearInterval() to cancel any future invocations of the scheduled function. The ID value returned by setInterval() is used as the parameter for the clearInterval() method.
89.

The URL property belongs to which of the following object?(a) Document(b) Element(c) Location(d) Event

Answer» Right option is (a) Document

Best explanation: The Document object has a URL property, which is a static string that holds the URL of the document when it was first loaded. If you want to access any element in an HTML page, you always start with accessing the document object.
90.

Which is the object that defines methods that allow complete control over page content?(a) The client-side document object(b) The server-side document object(c) Both client-side and server-side document object(d) Web document object

Answer» Right choice is (a) The client-side document object

Explanation: A web page is divided into two object documents in which one is client-side document object and the other is server-side document object. The client-side document object defines methods that allow complete control over page content
91.

How can we define the term Performance?(a) Speed of the input takes in(b) Speed of the output display(c) Speed at which application functions(d) Speed of data transmission

Answer» Correct choice is (c) Speed at which application functions

To explain: Performance refers to the speed at which an application functions. It is a multifaceted aspect of quality. Better performance results in better user experience.
92.

Why is this keyword not preferred in JavaScript?(a) Highly memory consuming(b) Functions should access the global objects(c) Functions should not access the global objects(d) Very inefficient to use

Answer» Correct answer is (c) Functions should not access the global objects

For explanation I would say: The this keyword is forbidden or restricted because functions (in non-strict mode) can access the global object through this. Preventing access to the global object is one of the key purposes of any sandboxing system.
93.

A hexadecimal literal begins with __________(a) 00(b) 0x(c) 0X(d) Both 0x and 0X

Answer» Correct choice is (d) Both 0x and 0X

To elaborate: Generally, X or x denotes hexadecimal values. So, any integer literal that begins with 0X or 0x denotes a hexadecimal number.
94.

A function definition expression can be called as __________(a) Function prototype(b) Function literal(c) Function calling(d) Function declaration

Answer» The correct choice is (b) Function literal

Explanation: A function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function followed by a comma-separated list of zero or more identifiers (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces.
95.

What is a block statement in JavaScript?(a) conditional block(b) block that contains a single statement(c) both conditional block and a single statement(d) block that combines multiple statements into a single compound statement

Answer» Correct option is (d) block that combines multiple statements into a single compound statement

For explanation I would say: A block statement groups zero or more statements. In languages other than JavaScript, it is known as a compound statement. A statement block is a block that combines more than one statements into a single compound statement for ease.
96.

Which method receives the return value of setTimeout() to cancel future invocations?(a) clearTimeout()(b) clearInterval()(c) clearSchedule()(d) cancelInvocation()

Answer» Correct choice is (a) clearTimeout()

Explanation: setTimeout() returns a value that can be passed to clearTimeout() to cancel the execution of the scheduled function. The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method.
97.

What is the property to access the first child of a node?(a) timestamp.Child1(b) timestamp.Child(1)(c) timestamp.Child(0)(d) timestamp.firstChild

Answer» Correct choice is (d) timestamp.firstChild

To elaborate: The firstChild property returns the first child node of the specified node, as a Node object. The first child of a node can be accessed using the firstChild property.
98.

What will happen if we call setTimeout() with a time of 0 ms?(a) Placed in stack(b) Placed in queue(c) Will run continuously(d) Will execute immediately

Answer» Right answer is (b) Placed in queue

To explain: If you call setTimeout() with a time of 0 ms, the function you specify is not invoked right away. Instead, it is placed on a queue to be invoked “as soon as possible” after any currently pending event handlers finish running.
99.

The setTimeout() belongs to which object?(a) Element(b) Window(c) Location(d) Event

Answer» Right option is (b) Window

The explanation: The setTimeout() method of the Window object schedules a function to run after a specified number of milliseconds elapses. setTimeout() and setInterval()  are used for time manipulations in javascript.
100.

Which is a useful way to try out small and simple Rhino programs and one-liners?(a) Starting an interactive shell(b) Starting a one to one shell(c) Creating a thread to do simple programs(d) Starting a multiple shell

Answer» Right answer is (a) Starting an interactive shell

The explanation: Rhino is distributed as a JAR archive. Start it with a command line like this :

java -jar rhino1_7R2/js.jar program.js

If you omit program.js, Rhino starts an interactive shell, which is useful for trying out simple programs and one-liners.