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.

1.

What is the tainted property of the window object?(a) Pathname(b) Protocol(c) Default status(d) HostI have been asked this question in an online quiz.My enquiry is from Accessing the WebPagetest API topic in chapter Sockets of JavaScript

Answer»

Correct OPTION is (c) DEFAULT status

To elaborate: The Defaultstatus is the tainted property of the WINDOW object. The defaultStatus property sets or returns the default text in the status BAR at the bottom of the browser (the text will be displayed when the page LOADS).

2.

How many parameters does the WebPageTest API accept?(a) 5(b) 6(c) 7(d) 8I had been asked this question in homework.This is a very interesting question from Accessing the WebPagetest API topic in portion Sockets of JavaScript

Answer» RIGHT answer is (d) 8

Best explanation: WebPageTest helps you RUN a free website speed test from multiple locations AROUND the globe using real browsers (IE and Chrome) and at real consumer connection speeds. The WebPageTest API accepts totally 8 parameters, namely url, location, runs, fvonly, private, BLOCK, f, k.
3.

Which of the following are methods not used to save charts?(a) pdf()(b) jpeg()(c) bmp()(d) pmb()The question was asked at a job interview.I'd like to ask this question from Enhanced JavaScript with R topic in division Sockets of JavaScript

Answer»

The correct option is (d) pmb()

The explanation: Since R RUNS on so many DIFFERENT operating systems, and supports so many different GRAPHICS formats, it’s not surprising that there are a variety of ways of saving your plots, DEPENDING on what operating system you are using, what you plan to do with the graph, and whether you’re connecting locally or remotely.

4.

How to save chart as a Window metafile?(a) metafile()(b) win.metafile()(c) file()(d) metawin()This question was posed to me in a job interview.This key question is from Enhanced JavaScript with R in portion Sockets of JavaScript

Answer»

The CORRECT answer is (B) win.metafile()

For explanation I would SAY: Metafile is a piece of GRAPHICAL information stored in a format that can be exchanged between different systems or software. The method win.metafile([filename]) is used to save chart as a Window metafile.

5.

What is the need for bubble charts?(a) Represent 2D data(b) Represent 3D data(c) Represent 2D and 3D data(d) Represents meta dataThis question was posed to me by my college director while I was bunking the class.Enquiry is from Enhanced JavaScript with R in portion Sockets of JavaScript

Answer» RIGHT answer is (b) Represent 3D data

To explain I would say: A bubble plot is a scatterplot where a third dimension is added the value of an additional variable is REPRESENTED through the SIZE of the dots. They are used to represent three-dimensional data.
6.

What is the purpose of the method plot()?(a) Displays symbols(b) Displays charts(c) Displays symbols and charts(d) Display charactersThe question was posed to me by my college professor while I was bunking the class.My enquiry is from Enhanced JavaScript with R in chapter Sockets of JavaScript

Answer»

Correct choice is (b) DISPLAYS charts

To explain I would say: The most USED plotting function in R programming is the plot() function. It is a generic function, meaning, it has MANY methods which are called according to the TYPE of object passed to plot(). The plot() function will DISPLAY a different type of chart depending on the arguments that you pass into it.

7.

How many parameters does the replaceState() method take?(a) 2(b) 3(c) 4(d) 5The question was asked in final exam.Question is taken from History Management in JavaScript in chapter Sockets of JavaScript

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.

8.

Which of the following is a loosely-typed language?(a) R(b) T(c) S(d) Both R and SThis question was addressed to me during an interview for a job.My enquiry is from Getting Started with R topic in chapter Sockets of JavaScript

Answer»

Correct option is (C) S

Easy explanation: R is an implementation of the S programming language combined with lexical scoping semantics, inspired by Scheme. [15] S was created by JOHN CHAMBERS in 1976, while at Bell LABS. R and S are loosely-typed languages and it supports all of the scalar data types you WOULD expect: string, numbers, and booleans.

9.

What is the purpose of getting the parameter fvonly?(a) To repeat the view test(b) To get the first view(c) To debug the code(d) To compile the codeThis question was addressed to me in homework.This interesting question is from Accessing the WebPagetest API in portion Sockets of JavaScript

Answer»

Right option is (b) To get the first view

Explanation: fvonly is an optional PARAMETER which is set to 1 to skip the REPEAT View test. If you set fvonly to 1, you get results only for the first view and do not run the repeat view test.

10.

Which of the following list contains multiple data types?(a) Vectors(b) Data frames(c) Matrices(d) ArraysI had been asked this question in an interview.Origin of the question is Getting Started with R topic in division Sockets of JavaScript

Answer»

The correct choice is (B) Data FRAMES

The BEST explanation: Data frames are multidimensional lists that can contain MULTIPLE data TYPES.

11.

Why do we use Adobe Illustrator along with R?(a) Collect the relevant data(b) Format the chart and to correct the errors(c) Tighten and format the chart(d) Ingest and process the chartI had been asked this question in a job interview.The question is from Getting Started with R in division Sockets of JavaScript

Answer» RIGHT option is (c) Tighten and format the chart

The explanation: ADOBE ILLUSTRATOR is used to produce PROFESSIONALLY looking at statistical graphics. The Adobe Illustrator is used ALONG with R to tighten and format the chart.
12.

Which type of comment is not supported in R?(a) Single-line comments(b) Multi-line comments(c) Both Single-line & Multi-line comments(d) Multiple CommentsI had been asked this question during an internship interview.I want to ask this question from Getting Started with R in chapter Sockets of JavaScript

Answer» RIGHT OPTION is (b) Multi-LINE COMMENTS

The best EXPLANATION: R supports single-line comments, but not multiline comments. # is used for making a single line comment.
13.

Which method is used to close the WebSocket?(a) Socket.flush()(b) Socket.close()(c) Socket.Close()(d) Socket.dispose()This question was posed to me during an interview.The question is from Web Sockets topic in section Sockets of JavaScript

Answer»

Correct option is (b) Socket.CLOSE()

The explanation: The Socket.close() is used to close the WebSocket. The Close method CLOSES the REMOTE host connection and releases all managed and unmanaged resources associated with the Socket. WebSocket is a computer communications protocol, PROVIDING full-duplex communication channels over a SINGLE TCP connection.

14.

Which of the following is/are statistical languages?(a) R(b) S(c) P(d) Both R and SThe question was asked during an internship interview.The doubt is from Getting Started with R in section Sockets of JavaScript

Answer»

The correct answer is (c) P

The best I can explain: Both R and S are STATISTICAL languages. The R LANGUAGE is widely USED among STATISTICIANS and data miners for developing statistical software and data ANALYSIS.

15.

R is an extension of which of the following language?(a) C(b) C++(c) S(d) C#I have been asked this question in semester exam.I want to ask this question from Getting Started with R topic in section Sockets of JavaScript

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.
16.

The history object is a part of which object?(a) Property(b) Window(c) Location(d) ScreenThe question was posed to me in exam.My question is taken from History Management in JavaScript in portion Sockets of JavaScript

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.

17.

Which of the following is not a WebSocket event?(a) open(b) close(c) error(d) denyThe question was asked in unit test.I want to ask this question from Web Sockets topic in portion Sockets of JavaScript

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.
18.

Which is the method used to save chart as a ps file?(a) ps()(b) postscript()(c) script()(d) post(script)I had been asked this question in an interview for job.This intriguing question comes from Enhanced JavaScript with R in division Sockets of JavaScript

Answer» CORRECT option is (b) postscript()

The BEST explanation: postscript starts the graphics device driver for producing PostScript graphics. The syntax for the method to save CHART as a ps FILE is : postscript([filename]).
19.

Which of the following is/are not the features of R?(a) Small(b) Self-contained(c) Extensible(d) LargeI had been asked this question during an interview.The above asked question is from Getting Started with R in chapter Sockets of JavaScript

Answer»

Correct choice is (d) Large

Explanation: R and its libraries implement a wide variety of statistical and graphical techniques, including linear and nonlinear modelling, classical statistical TESTS, time-series analysis, CLASSIFICATION, clustering, and others. As a language, R is SMALL, self-contained and extensible.

20.

Which of the following method is used to replace the current history state instead of adding a new state to the browsing history?(a) replaceState()(b) replace(state)(c) replace()(d) change()The question was posed to me in unit test.My doubt stems from History Management in JavaScript topic in chapter Sockets of JavaScript

Answer» RIGHT CHOICE is (a) replaceState()

The best explanation: The replaceState() method is USED to replace the current history state INSTEAD of adding a NEW state to the browsing history. It updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL.
21.

Which of the following is a stateless protocol?(a) HTML(b) XHTML(c) HTTP(d) XMLThe question was asked during an online interview.I'd like to ask this question from Web Sockets in portion Sockets of JavaScript

Answer»

Correct CHOICE is (C) HTTP

Easiest explanation: A stateless protocol does not require the server to retain information or STATUS about each user for the duration of multiple REQUESTS. HTTP is a stateless protocol, which means that the connection between the browser and the server is lost once the TRANSACTION ends.

22.

What will happen if you set the private flag as 1?(a) Test will be run only by the administrator(b) Test will not be run(c) Test is public(d) Test is not displayed in publicI have been asked this question in an interview for internship.The query is from Accessing the WebPagetest API in portion Sockets of JavaScript

Answer» RIGHT CHOICE is (d) Test is not displayed in public

The BEST explanation: The WebPageTest RESULTS provide rich diagnostic information including resource loading waterfall charts, Page Speed optimization checks and suggestions for improvements which can be kept public or private. Setting the private flag to 1 will make sure that the test is not displayed in the public list of TESTS.
23.

The code of the R language has an extension?(a) .Rl(b) .R(c) .lR(d) .RRThis question was addressed to me in examination.Question is taken from Getting Started with R in portion Sockets of JavaScript

Answer»

The CORRECT answer is (B) .R

The best I can explain: R is a programming language designed for statistical computing and graphics purposes. R is a file extension for a script written in R.

24.

What is the purpose of getting the parameter block?(a) Permission to block(b) Space separated block list(c) Comma separated block list(d) Underscore separated block listI got this question at a job interview.This is a very interesting question from Accessing the WebPagetest API in portion Sockets of JavaScript

Answer»

Right choice is (c) Comma separated block list

To elaborate: A ParameterBlock encapsulates all the information about sources and PARAMETERS (OBJECTS) required by a RenderableImageOp, or other classes that PROCESS images. This parameter allows you to SET a comma separated list of block options.

25.

What is the advantage for Linux users using R?(a) They get a command sequence to install the particular Linux flavor(b) They get a compiled installer(c) Easily compatible(d) Runtime is lessI had been asked this question in class test.The question is from Getting Started with R topic in division Sockets of JavaScript

Answer»

The correct CHOICE is (a) They get a command sequence to INSTALL the particular Linux FLAVOR

Best explanation: Instead of a compiled INSTALLER, Linux users get the command sequence to install for their particular Linux flavor.

26.

What are the purposes R can be used for?(a) Suck in data(b) Parse data(c) Process data(d) All of the mentionedThe question was posed to me in homework.My question comes from Getting Started with R in portion Sockets of JavaScript

Answer»

Correct answer is (d) All of the mentioned

Easy explanation: The R language is widely used among statisticians and DATA miners for developing statistical software and data ANALYSIS. GENERALLY, R can be used to suck in data, parse it, PROCESS it, and then visualize it for reporting purposes.

27.

Which of the following is the initial function used to create a bubble chart natively in R?(a) init()(b) chart(bubble)(c) symbols()(d) bchart()This question was addressed to me during an interview.My doubt is from Enhanced JavaScript with R topic in chapter Sockets of JavaScript

Answer»

Right answer is (C) symbols()

Easy explanation: symbols() function DRAWS symbols on a plot. One of six symbols; circles, squares, rectangles, stars, thermometers, and BOXPLOTS, can be plotted at a specified SET of X and y coordinates. The method symbols() is used to create a bubble chart natively in R.

28.

Which is the function used to add the vectors?(a) c()(b) add(vectors)(c) c(vectors)(d) vectors.addThe question was asked in an interview.I need to ask this question from Getting Started with R topic in chapter Sockets of JavaScript

Answer»

The CORRECT option is (a) C()

EASIEST EXPLANATION: The c() is a GENERIC function which combines its arguments. It is used to add the vectors.

29.

Which is the keyword used to open the Help window?(a) ()(b) #(c) ?(d) =I had been asked this question in an international level competition.Asked question is from Getting Started with R topic in chapter Sockets of JavaScript

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.

30.

Which of the following comes with compiled third-party packages?(a) Contrib(b) Base(c) Rtools(d) RBaseThis question was posed to me in an internship interview.Asked question is from Getting Started with R in chapter Sockets of JavaScript

Answer» RIGHT answer is (a) Contrib

Explanation: Contrib are the binaries of contributed CRAN packages. The PC INSTALLER comes in three flavors: Base is the base install, Contrib comes with compiled third-party packages, and Rtools comes with TOOLS to build your own R packages.
31.

Which platform is R imported to after charting as a PDF?(a) Adobe Illustrator(b) Adobe Photoshop(c) Both Adobe Illustrator and Adobe Photoshop(d) Adobe IndesignThis question was addressed to me by my school teacher while I was bunking the class.My question is from Getting Started with R in section Sockets of JavaScript

Answer»

The correct answer is (a) Adobe ILLUSTRATOR

To explain: Adobe Illustrator is used to produce professionally LOOKING at statistical graphics. From R, the chart is imported into the Adobe Illustrator, or any other such program, where it can CLEAN up things like font consistency and MAKE sure axis labels with long NAMES are visible.

32.

What does a History object contain?(a) URL(b) Parameters(c) Attribute values(d) PropertyThis question was addressed to me in exam.This interesting question is from History Management in JavaScript topic in portion Sockets of JavaScript

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.

33.

Which is the method used to draw a bar plot?(a) bar_plot()(b) plot(bar)(c) barplot()(d) plotbar()The question was posed to me by my school teacher while I was bunking the class.My doubt stems from Enhanced JavaScript with R in chapter Sockets of JavaScript

Answer»

Right option is (c) barplot()

To explain: A bar chart REPRESENTS data in RECTANGULAR bars with LENGTH of the bar PROPORTIONAL to the value of the variable. R uses the function barplot() to create bar charts.

34.

How many methods are there in the History object?(a) 3(b) 4(c) 5(d) 6I had been asked this question in an online quiz.The doubt is from History Management in JavaScript topic in chapter Sockets of JavaScript

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.

35.

Which of the following is used to run ad hoc R commands?(a) R Console(b) R Primer(c) Both R Console and R Primer(d) R timerThe question was posed to me in a job interview.This interesting question is from Getting Started with R topic in chapter Sockets of JavaScript

Answer»

Correct option is (a) R Console

To explain I WOULD say: Interactive DATA analysis usually occurs on the R console that executes COMMANDS as you type them. R Console is a command-line environment for running ad hoc R commands.

36.

What kind of data can be run in R?(a) Binary(b) Text(c) Decimals(d) All kindsThis question was addressed to me by my college professor while I was bunking the class.I need to ask this question from Getting Started with R topic in portion Sockets of JavaScript

Answer»

Right choice is (d) All kinds

The explanation is: The R language is WIDELY used among statisticians and data miners for DEVELOPING statistical software and data analysis. All kinds of data can be run in R.

37.

What does the pushState() method do?(a) Removes the state(b) Adds new state(c) Replaces the state(d) Change the stateThis question was addressed to me in final exam.I want to ask this question from History Management in JavaScript topic in portion Sockets of JavaScript

Answer» RIGHT option is (b) Adds new STATE

The best I can explain: When a web app ENTERS a new state, it calls history.pushState() to add that state to the browsing history.
38.

How can we check the subprotocol being used by the client?(a) subprotocol property(b) protocol property(c) clientprotocol property(d) client propertyI got this question during an online exam.My question is based upon Web Sockets topic in division Sockets of JavaScript

Answer»

The correct CHOICE is (b) protocol property

Explanation: A WebSocket is a standard bidirectional TCP socket between the client and the SERVER. The socket starts out as an HTTP connection and then “UPGRADES” to a TCP socket after an HTTP handshake. Once the connection is established, the client can determine which subprotocol is in use by CHECKING the protocol property of the socket.

39.

Which tag can handle mouse events in Netscape?(a) img(b) a(c) br(d) srcThe question was posed to me in final exam.My doubt stems from Accessing the WebPagetest API in portion Sockets of JavaScript

Answer»

Right OPTION is (a) img

The best explanation: NETSCAPE is a brand name associated with the DEVELOPMENT of the Netscape web browser. The img ELEMENT can handle mouse events in Netscape.

40.

What is the usage of the keyword ?? in R?(a) Help window(b) Extensive search(c) Error correction(d) Error detectionThe question was asked in homework.My doubt stems from Getting Started with R in division Sockets of JavaScript

Answer» RIGHT answer is (b) Extensive search

The EXPLANATION: The ?? FUNCTION scans the documentation for packages INSTALLED in your library. ?? (KEYWORD) is generally used for a more extensive search when compared to the keyword ?.
41.

What is the usage of the keyword ? in R?(a) Help window(b) Extensive search(c) Error correction(d) Error detectionI had been asked this question during an internship interview.I need to ask this question from Getting Started with R in portion Sockets of JavaScript

Answer»

Correct option is (a) Help window

For explanation: ? is GENERALLY used to open the help window at any time. 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.

42.

How does the client and the server communicate following the rules defined by the WebSocket protocol?(a) Long-lived TCP Socket(b) Short-lived TCP Socket(c) UDP Socket(d) HTTP SocketI have been asked this question in an interview.I'm obligated to ask this question of Web Sockets topic in division Sockets of JavaScript

Answer» CORRECT choice is (a) Long-lived TCP Socket

To elaborate: The client and SERVER communicate over a long-lived TCP socket FOLLOWING rules defined by the WEBSOCKET protocol.
43.

What is the purpose of a glue language?(a) Format data(b) Product data(c) Collect data(d) Both Format and CollectThe question was posed to me in my homework.The question is from Getting Started with R in division Sockets of JavaScript

Answer»

The correct choice is (d) Both Format and Collect

The explanation: Glue language refers to a programming language that is designed SPECIFICALLY to write and manage program and code, which CONNECTS TOGETHER different software components. A glue language is GENERALLY used to collect and format the data.

44.

How do you add a particular state to the browsing history?(a) pushState()(b) replaceState()(c) state()(d) addstate()The question was posed to me by my school teacher while I was bunking the class.My question comes from History Management in JavaScript topic in portion Sockets of JavaScript

Answer»

The correct OPTION is (a) PUSHSTATE()

Explanation: The pushState() method adds a particular state to the browsing history. It pushes the GIVEN data onto the session history stack with the specified TITLE and, if provided, URL.

45.

What does the value 2 of the WebSocket attribute Socket.readyState indicate?(a) Closed connection(b) Handshake connection(c) Unestablished connection(d) Established connection and communication is possibleThis question was posed to me by my school teacher while I was bunking the class.The above asked question is from Web Sockets topic in division Sockets of JavaScript

Answer»

Correct OPTION is (b) Handshake connection

The explanation: The WebSocket object PROVIDES the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. The readonly attribute readyState represents the state of the connection. It can have the following values:

A value of 0 indicates that the connection has not yet been established.

A value of 1 indicates that the connection is established and communication is possible.

A value of 2 indicates that the connection is going through the CLOSING handshake.

A value of 3 indicates that the connection has been closed or could not be opened.

46.

What is the purpose of the method forward()?(a) Loads any random URL in the history list(b) Loads the previous URL in the history list(c) Loads a specific URL from the history list(d) Loads the next URL in the history listThis question was posed to me in an interview.This question is from History Management in JavaScript in division Sockets of JavaScript

Answer»

Correct choice is (d) Loads the next URL in the history list

To elaborate: The FORWARD() method is found in the history OBJECT. The forward() method loads the next URL in the history list.

47.

What type of language is generally used to collect the data?(a) Glue language(b) Statistical language(c) Both Glue and Statistical language(d) Operational languageI got this question in an interview for internship.My enquiry is from Getting Started with R in division Sockets of JavaScript

Answer»

The correct choice is (a) Glue language

To elaborate: A glue language is generally USED to collect the data, that is written out as a comma-separated file, and read it into R. It ENABLES INTERCONNECTING, support and the integration of software programs and COMPONENTS created using different programming languages and platforms.

48.

How will you transmit data using the connection?(a) send(data)(b) Socket.send(“data”)(c) Socket.send(data)(d) Socket(data)This question was addressed to me in my homework.Query is from Web Sockets topic in section Sockets of JavaScript

Answer»

Correct option is (C) SOCKET.send(DATA)

To explain I would say: The Socket.send(data) method transmits data USING the connection. This Socket method sends data to CONNECTED socket.

49.

What will the file_get_contents() return?(a) Server’s response(b) Errors(c) Exception(d) Client’s responseI had been asked this question during an online interview.Origin of the question is Accessing the WebPagetest API in section Sockets of JavaScript

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:

50.

How many parameters does the method plot() accept?(a) 6(b) 7(c) 8(d) 9The question was asked by my college director while I was bunking the class.My doubt is from Enhanced JavaScript with R topic in section Sockets of JavaScript

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.