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.

Point out the wrong statement?(a) One nice feature that R shares with many popular open source projects is frequent releases(b) R has sophisticated graphics capabilities(c) S’s base graphics system allows for very fine control over essentially every aspect of a plot or graph(d) All of the mentionedThis question was posed to me in final exam.Asked question is from Overview of R topic in division History, Overview and Getting Started of R Programming

Answer»

Right choice is (c) S’s base graphics system allows for very FINE control over essentially every aspect of a plot or graph

To ELABORATE: R has MAINTAINED the original S philosophy, which is that it provides a language that is both useful for interactive work, but contains a POWERFUL programming language for developing new tools.

52.

Which of the following can be used to display the names of (most of) the objects which are currently stored within R?(a) object()(b) objects()(c) list()(d) class()This question was posed to me in examination.I'm obligated to ask this question of Console Input and Evaluation topic in section History, Overview and Getting Started of R Programming

Answer»

Right CHOICE is (B) objects()

EASIEST EXPLANATION: During an R session, objects are CREATED and stored by name.

53.

_______ will divert all subsequent output from the console to an external file.(a) sink(b) div(c) exp(d) excThe question was asked during an interview for a job.Query is from Console Input and Evaluation topic in section History, Overview and Getting Started of R Programming

Answer»

Right option is (a) SINK

The BEST explanation: sink() RESTORES it to the console once again.

54.

Matrices can be created by row-binding with the help of the following function.(a) rjoin()(b) rbind()(c) rowbind()(d) rbinding()I had been asked this question in homework.My question is from Overview of R in section History, Overview and Getting Started of R Programming

Answer» CORRECT option is (b) rbind()

The EXPLANATION: rbind() is used to create a matrix by row-binding. Row- binding is the basic function of R. R – bind is used to bind the functions in R. MATRICES can be CREATED by column-binding or row-binding with the cbind() and rbind() functions.
55.

Which programming language is more based on the results?(a) R(b) C(c) C++(d) JavaI had been asked this question in quiz.This intriguing question originated from Basics topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct choice is (a) R

Easiest EXPLANATION: Compared to other programming LANGUAGES, the R community tends to be more focussed on RESULTS instead of PROCESSES. Knowledge of software engineering best PRACTICE.

56.

What is the function to set column names for a matrix?(a) names()(b) colnames()(c) col.names()(d) column name cannot be set for a matrixThis question was posed to me in a national level competition.This intriguing question originated from Overview of R in division History, Overview and Getting Started of R Programming

Answer»

The correct option is (b) colnames()

The explanation: colnames() is the FUNCTION to set column names for a matrix. rownames() is the function to set ROW names for a matrix. But we can’t use both at a time. Column names and row names can be set separately using the colnames() and rownames() functions.

57.

Which of the following is “Recommended” package in R?(a) util(b) lang(c) stats(d) spatialThis question was posed to me by my college professor while I was bunking the class.This intriguing question comes from Overview of R topic in section History, Overview and Getting Started of R Programming

Answer»

The correct choice is (d) spatial

The best explanation: “Recommended” packages ALSO include BOOT, class, CLUSTER, codetools, foreign, KernSmooth, lattice, mgcv, NLME, rpart, survival, MASS, nnet, MATRIX.

58.

In 1991, R was created by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of _________(a) John Hopkins(b) California(c) Harvard(d) AucklandThis question was posed to me by my college professor while I was bunking the class.This key question is from History of R topic in portion History, Overview and Getting Started of R Programming

Answer»

Right choice is (d) Auckland

Easiest EXPLANATION: In 1993 the first announcement of R was made to the public. Ross’s and ROBERT’s experience DEVELOPING R is documented in a 1996 paper in the Journal of COMPUTATIONAL and Graphical Statistics.

59.

In 2004, ________ purchased the S language from Lucent for $2 million.(a) Insightful(b) Amazon(c) IBM(d) TCSThis question was posed to me during an interview.This intriguing question originated from History of R topic in division History, Overview and Getting Started of R Programming

Answer»

The correct ANSWER is (a) Insightful

For explanation: TIBCO is the current OWNER of the S LANGUAGE and is its EXCLUSIVE developer.

60.

How many atomic vector types does R have?(a) 5(b) 6(c) 8(d) 10This question was addressed to me during an online interview.Origin of the question is Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Correct ANSWER is (b) 6

For explanation I would say: R LANGUAGE has 6 atomic data types. They are logical, integer, real, complex, string (or CHARACTER) and raw. There is ALSO a class for “raw” objects, but they are not commonly used directly in data analysis.

61.

Functionality of R is divided into a number of __________(a) Functions(b) Domains(c) Packages(d) FilesI had been asked this question in an online quiz.This is a very interesting question from Basics topic in section History, Overview and Getting Started of R Programming

Answer»

The correct option is (a) Functions

Best explanation: CRAN HOSTS many add-on packages that can extend the functionality of R. CONNECTIONS ALLOW R functions to TALK to all different external objects without having to write custom code for each object.

62.

R language has superficial similarity with _________(a) C(b) Python(c) MATLAB(d) SASI had been asked this question in my homework.This question is from Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Right choice is (a) C

Best explanation: The language syntax has a superficial similarity with C, but the SEMANTICS are of the FPL (FUNCTIONAL programming language) variety with stronger affinities with LISP and APL. There are many syntaxes in C, which are closely RESEMBLED with R.

63.

Elementary commands in R consist of either _______ or assignments.(a) utilstats(b) language(c) expressions(d) packagesI had been asked this question in exam.Question is from Basics in portion History, Overview and Getting Started of R Programming

Answer»

The correct answer is (c) expressions

To explain I would SAY: If an expression is GIVEN as a command, it is evaluated, printed (unless specifically made INVISIBLE), and the VALUE is LOST.

64.

Why learning R becomes tough?(a) Special files(b) Functions(c) Packages(d) Special CasesI have been asked this question by my school principal while I was bunking the class.Query is from Basics topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct ANSWER is (d) Special Cases

The explanation is: You are confronted with over 20 years of EVOLUTION every time you use R. LEARNING R can be HARD because there are MANY special cases in R to remember. R is the best user of memory.

65.

Point out the wrong statement?(a) Windows versions of R have other optional help system also(b) The help.search command (alternatively ??) allows searching for help in various ways(c) R is case insensitive as are most UNIX based packages, so A and a are different symbols and would refer to different variables(d) $ R is used to start the R programThis question was posed to me in an internship interview.The above asked question is from Basics in chapter History, Overview and Getting Started of R Programming

Answer»

The correct CHOICE is (c) R is CASE insensitive as are most UNIX based packages, so A and a are different SYMBOLS and WOULD refer to different variables

For explanation: R is an expression language with a very simple syntax.

66.

How can we define ‘infinity’ in R language?(a) Inf(b) Sup(c) Und(d) NaNI had been asked this question by my school teacher while I was bunking the class.My doubt is from Overview of R in division History, Overview and Getting Started of R Programming

Answer»

The correct answer is (a) Inf

To elaborate: Inf is USED to define “Infinity” in R. It is somewhat DIFFERENT from other programming languages. There is ALSO a special number of Inf which REPRESENTS infinity.

67.

Which one of the following is not a basic datatype?(a) Numeric(b) Character(c) Data frame(d) IntegerI got this question during an online exam.The origin of the question is Overview of R in portion History, Overview and Getting Started of R Programming

Answer»

Correct option is (C) Data FRAME

The explanation is: Data frame is not the basic data type of R. Numeric, character, INTEGER are the basic types of R. The basic data types are used many times. Data frames are used to STORE tabular data in R. They are an important type of object in R and are used in a variety of statistical modelling APPLICATIONS.

68.

A list is represented as a vector but can contain objects of ___________(a) Same class(b) Different class(c) Similar class(d) Any classThe question was asked in homework.The query is from Overview of R topic in portion History, Overview and Getting Started of R Programming

Answer» CORRECT ANSWER is (B) Different class

The BEST I can explain: A LIST can contain objects of different class. But a vector can only contain objects of the same class. A vector cannot have contain objects of the different class. Same class objects are used mostly.
69.

There are more than ________ packages on CRAN that have been developed by users and programmers around the world.(a) 40(b) 400(c) 4000(d) 40000I have been asked this question by my college professor while I was bunking the class.I'm obligated to ask this question of History of R in section History, Overview and Getting Started of R Programming

Answer»

The correct choice is (C) 4000

To explain I would say: There are more than 4000 packages on CRAN. A PACKAGE bundles together code, data, documentation, and tests, and is easy to share with OTHERS. As of January 2015, there were over 4000 packages available on the Comprehensive R Archive Network, or CRAN, the public clearing HOUSE for R packages.

70.

Which of the following packages does not contain in “base” R system?(a) utils, graphics(b) mesh, compiler(c) splines, stats4(d) grDevices, datasetsI had been asked this question at a job interview.My question is taken from History of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

Correct option is (b) mesh, COMPILER

The explanation is: Mesh does not belong to the base R system. The other utils, graphics, compiler, splines, STATS4, grDevices, DATASETS will contain Base R system. There are many other PACKAGES also in R studio which were pre-installed.

71.

R runs on the ____________ operating system.(a) Linux(b) Windows(c) Ubuntu(d) Any operating systemI got this question in an interview for job.This intriguing question originated from History of R in chapter History, Overview and Getting Started of R Programming

Answer»

The correct option is (d) Any operating SYSTEM

The explanation is: R language RUNS on any standard computing platform and operating platform. So R can run in any operating system. It COMPILES and runs on a WIDE variety of UNIX platforms, Windows and MacOS.

72.

R is published under the __________ General Public License version.(a) A(b) B(c) C(d) GNUI have been asked this question during a job interview.Asked question is from History of R in portion History, Overview and Getting Started of R Programming

Answer» CORRECT choice is (d) GNU

Explanation: R language is published under the GNU General Public License version. It includes compilers for C, C++, Objective-C and a HOST of other LANGUAGES. The following LICENSES are in use for R or associated software such as PACKAGES.
73.

Which of the following is default prompt for UNIX environment?(a) >(b) >>(c)

Answer» RIGHT ANSWER is (a) >

To ELABORATE: When you use the R program it issues a prompt when it EXPECTS input commands.
74.

The R-help and _____ mailing lists have been highly active for over a decade now.(a) R-mail(b) R-devel(c) R-dev(d) R-delThe question was posed to me in homework.I'm obligated to ask this question of History of R in division History, Overview and Getting Started of R Programming

Answer»

Right choice is (B) R-devel

To elaborate: There is considerable ACTIVITY on WEB SITES LIKE Stack Overflow as well.

75.

Which function is used to automatically vectorize?(a) lapply()(b) kapply()(c) mapply()(d) happly()This question was posed to me in quiz.This key question is from Install and Configure topic in section History, Overview and Getting Started of R Programming

Answer»

Correct choice is (c) mapply()

Explanation: The mapply() function can be USED to automatically “VECTORIZE” a function. What this means is that it can be used to take a function that TYPICALLY only TAKES single ARGUMENTS and create a new function that can take vector arguments.

76.

What is the function used to test objects (returns a logical operator) if they are NA?(a) is.na()(b) is.nan()(c) as.na()(d) as.nan()I had been asked this question during an online exam.The above asked question is from Overview of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct option is (a) is.na()

The explanation: is.na() is the function used to TEST if they are NA. We can check NA ‘s at any stage of the CODE. Generally, We will remove the NA’s for the operations in R like mean ETC.., is.na() is used to test OBJECTS if they are NA.

77.

____________ provides a point-and-click interface to many basic statistic problems.(a) Commander(b) GUI(c) Console(d) TerminalThe question was asked in an interview for internship.This key question is from Basics topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct option is (a) Commander

The explanation: R Commander PROVIDES a point-and-click INTERFACE to statistical problems. It is called the “Commander” because every time one makes a SELECTION, the code corresponding to the task is listed in the output window.

78.

In R language, a vector is defined that it can only contain objects of the ________(a) Same class(b) Different class(c) Similar class(d) Any classThe question was asked in examination.Enquiry is from Overview of R topic in division History, Overview and Getting Started of R Programming

Answer»

Right answer is (a) Same class

Best EXPLANATION: A VECTOR can only contain objects of the same class. A vector cannot have contain objects of the different class. Same class objects are used MOSTLY. The most BASIC type of R object is a vector. Empty vectors can be created with the vector() function.

79.

What is the output of getOption(“defaultPackages”) in R studio?(a) Installs a new package(b) Shows default packages in R(c) Error(d) Nothing will printThis question was addressed to me during an internship interview.My doubt stems from Overview of R in division History, Overview and Getting Started of R Programming

Answer»

The correct option is (b) SHOWS default packages in R

For explanation I would say: There are base packages (which come with R AUTOMATICALLY), and contributed packages. The base packages are MAINTAINED by a select GROUP of volunteers called R Core. In ADDITION to the base packages, there are over ten thousand additional contributed packages written by individuals all over the world.

80.

R is mostly used in ______________(a) Problem solving(b) Statistics(c) Probability(d) All of the mentionedI had been asked this question by my school teacher while I was bunking the class.This interesting question is from Basics in portion History, Overview and Getting Started of R Programming

Answer»

The CORRECT ANSWER is (d) All of the mentioned

Explanation: STATISTICS for relatively advanced users. R has thousands of packages, designed, maintained, and WIDELY used by statisticians. We can code ourselves if a command is not PRESENT.

81.

Is It possible to inspect the source code of R?(a) Yes(b) No(c) Can’t say(d) Some timesThis question was addressed to me during an online exam.My enquiry is from Basics in section History, Overview and Getting Started of R Programming

Answer» RIGHT choice is (a) Yes

The best I can explain: ANYBODY is free to download and INSTALL these packages and even inspect the source code. The instructions for OBTAINING R largely depend on the user’s hardware and operating system.
82.

Dataframes can be converted into a matrix by calling the following function data ______(a) matr()(b) matrix()(c) matrixf()(d) matrixfunc()The question was posed to me during an online exam.Enquiry is from Basics topic in chapter History, Overview and Getting Started of R Programming

Answer»

The CORRECT option is (B) matrix()

The explanation: as.matrix function should be used to coerce a data FRAME to a matrix. It might SEEM that the as.matrix() function should be used to coerce a data frame to a matrix.

83.

The dimension attribute is itself an integer vector of length _______(a) 1(b) 2(c) 3(d) 4I had been asked this question during an interview for a job.Question is taken from Overview of R in division History, Overview and Getting Started of R Programming

Answer»

The correct OPTION is (b) 2

To explain I WOULD say: It is itself an INTEGER vector of length 2. The dimension ATTRIBUTE in R is an integer vector. Real values larger in MODULUS than the largest integer are coerced to NA. Matrices are vectors with a dimension attribute. The dimension attribute is itself an integer vector of length 2 (number of rows, number of columns).

84.

The most convenient way to use R is at a graphics workstation running a ________ system.(a) windowing(b) running(c) interfacing(d) matrixThis question was addressed to me in exam.The origin of the question is Basics topic in chapter History, Overview and Getting Started of R Programming

Answer»

The CORRECT option is (a) windowing

Explanation: Most CLASSICAL statistics and MUCH of the LATEST METHODOLOGY is available for use with R.

85.

They primary R system is available from the ______(a) CRAN(b) CRWO(c) GNU(d) CRDOThis question was addressed to me in class test.I would like to ask this question from Overview of R in portion History, Overview and Getting Started of R Programming

Answer»

Right choice is (a) CRAN

The EXPLANATION is: CRAN stands for Comprehensive R Archive NETWORK.

86.

You can download “base” R system from _________(a) A(b) B(c) CRAN(d) DThis question was addressed to me at a job interview.My doubt stems from History of R topic in portion History, Overview and Getting Started of R Programming

Answer»

Right OPTION is (c) CRAN

For explanation: You can DOWNLOAD from CRAN (Comprehensive R Archive Network). The Base R can be FOUND in CRAN. The base R can be found in R STUDIO. The base R system will be found in R studio.

87.

__________ function is used to watch for all available packages in library.(a) lib()(b) fun.lib()(c) libr()(d) library()I have been asked this question in my homework.I need to ask this question from Basics topic in section History, Overview and Getting Started of R Programming

Answer»

Correct answer is (d) library()

The explanation is: Type library() at the command PROMPT to see a LIST of all available PACKAGES in the library. For total INFORMATION about the installation of R and add-on packages, see the R Installation and Administration manual.

88.

How do you create an integer suppose 5 in R?(a) 5L(b) 5l(c) 5i(d) 5dI got this question in an online interview.This question is from Overview of R in section History, Overview and Getting Started of R Programming

Answer» RIGHT OPTION is (a) 5L

Explanation: To CREATE an integer L should be ADDED to the integer. L is added to specify that it is an integer. An integer can also be created with many types. If you EXPLICITLY want an integer, you need to specify the L suffix.
89.

Version of R released to the public in 2000 was_________(a) 1.0.0(b) 1.0.3(c) 2.0.1(d) 1.1.0I got this question in my homework.This key question is from History of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

Correct CHOICE is (a) 1.0.0

To ELABORATE: In 2000 VERSION 1.0.0 was released to the public. The other versions are released successively. R is a free software ENVIRONMENT for statistical computing and graphics. There is no SPECIFIED operating system for R.

90.

In which year R-Core group was formed?(a) 1993(b) 1996(c) 1997(d) 1998This question was addressed to me in homework.This intriguing question comes from History of R in chapter History, Overview and Getting Started of R Programming

Answer»

The correct answer is (c) 1997

For explanation: In 1996, a public mailing list was created. In 1997, the R Core Group was formed. R is for statistical computing and GRAPHICS. It compiles and RUNS on any operating SYSTEM. It is free software which can easy to install and configure.