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.

The longer programs are called ____________(a) Files(b) Structures(c) Scripts(d) DataI have been asked this question in an international level competition.This intriguing question originated from Basics in division History, Overview and Getting Started of R Programming

Answer»

Right option is (c) Scripts

Easy explanation: The LONGER programs CALLED scripts, there is too MUCH code to write all at once at the command prompt. Furthermore, for longer scripts, it is convenient to be able to only MODIFY a certain piece of the script and RUN it again in R.

2.

What is the function used to test objects (returns a logical operator) if they are NaN?(a) as.nan()(b) is.na()(c) as.na()(d) is.nan()I have been asked this question during an interview.This interesting question is from Overview of R topic in portion History, Overview and Getting Started of R Programming

Answer»

The CORRECT CHOICE is (d) is.nan()

For explanation I WOULD say: is.nan() is used to test if they are NaN. We can check NAN‘s at any stage of the code. We will remove the NA’s for the operations in R. is.nan() is used to test for NaN.

3.

_____ programming language is a dialect of S.(a) B(b) C(c) R(d) KThis question was posed to me in an online quiz.This intriguing question comes from History of R in chapter History, Overview and Getting Started of R Programming

Answer»

The CORRECT answer is (C) R

For explanation: S was initiated in 1976⁷ as an internal statistical ANALYSIS environment—originally implemented as FORTRAN libraries.

4.

In the expression x

Answer»

Correct answer is (C) Integer

Easiest explanation: In R, there is an extension of the numeric or character vectors. They are not a separate TYPE of object but SIMPLY an atomic vector with DIMENSIONS.

5.

What is the meaning of “

Answer» RIGHT ANSWER is (d) Assignment

The explanation: The expression a <- 16 creates a variable called a and gives it the value 16 called assignment. The variable on the LEFT is assigned to the value on the right. The left side should have only a single ONE.
6.

Full Form of GUI is ___________________(a) Guided User Interface(b) Graphical User Interface(c) Guided Used Interface(d) Graphical User IntervalThe question was posed to me in a job interview.My enquiry is from Basics topic in division History, Overview and Getting Started of R Programming

Answer» CORRECT answer is (B) Graphical User Interface

For explanation I would say: GUI ELEMENTS are usually accessed through a DEVICE. All PROGRAMS running a GUI use a consistent set of graphical elements so that once the user learns a particular interface.
7.

Which of the following is a “Recommended” package in R?(a) Util(b) Lang(c) Stats(d) SpatialI got this question in an international level competition.I'm obligated to ask this question of Basics in chapter History, Overview and Getting Started of R Programming

Answer»

Correct OPTION is (d) Spatial

Explanation: “Recommended” packages also INCLUDE boot, class, cluster, codetools, foreign, KernSmooth, lattice, mgcv, nlme, rpart, survival, MASS, nnet, Matrix. There are about ten thousand packages in R now.

8.

R files has an extension ______(a) .R(b) .S(c) .Rp(d) .cI got this question in quiz.Question is from Basics in portion History, Overview and Getting Started of R Programming

Answer» CORRECT option is (a) .R

The explanation: All R FILES have an extension .R.R provides a mechanism for RECALLING and re-executing previous commands. All S programmed files will have an extension .S. But R has MANY functions than S.
9.

Which of the following is not an object of R?(a) calls(b) expressions(c) strings(d) namesThe question was posed to me in an internship interview.This intriguing question originated from Basics in division History, Overview and Getting Started of R Programming

Answer» CORRECT choice is (c) strings

To explain I would say: Calls, expressions and names are the three types of objects that constitute the R LANGUAGE. There is really only one rule about vectors in R, which is that A VECTOR can only CONTAIN objects of the same class. R objects can have names, which is very useful for writing readable code and self-describing objects.
10.

What is output of getOption(“defaultPackages”) in R studio?(a) Installs a new package(b) Shows default packages in R(c) Error(d) Nothing will printI had been asked this question in a national level competition.My question is based upon Basics in chapter History, Overview and Getting Started of R Programming

Answer»

Right option is (b) Shows default PACKAGES in R

The BEST I can explain: 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.

11.

The primary source code copyright for R is held by the ___________(a) R Foundation(b) S Foundation(c) R and S foundation(d) C FoundationThis 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»

The correct answer is (a) R Foundation

The best explanation: The COPYRIGHT for the PRIMARY source CODE for R is HELD by the R Foundation. The S foundation could not have R primary source code. R is a free software environment for statistical computing and graphics.

12.

In which IDE we can interact with R?(a) R studio(b) Console(c) GCC(d) Power shellI had been asked this question during an online exam.Query is from Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Correct option is (a) R studio

To elaborate: An IDE tailored to the NEEDS of interactive data analysis and statistical programming called R studio. In R studio we can directly INTERACT with R through the inbuilt FUNCTIONS and packages. We can also DOWNLOAD new packages.

13.

Point out the wrong statement?(a) Setting up a workstation to take full advantage of the customizable features of R is a straightforward thing(b) q() is used to quit the R program(c) R has an inbuilt help facility similar to the man facility of UNIX(d) Windows versions of R have other optional help systems alsoThis question was addressed to me in an interview.This intriguing question comes from Basics in portion History, Overview and Getting Started of R Programming

Answer» CORRECT answer is (b) q() is used to QUIT the R program

To explain I would say: help command is used for knowing DETAILS of particular command in R.
14.

Which of the following is a base package for R language?(a) util(b) lang(c) tools(d) spatialI got this question during a job interview.My enquiry is from Overview of R topic in division History, Overview and Getting Started of R Programming

Answer»

Correct answer is (C) tools

Explanation: The other packages contained in the “BASE” system include UTILS, stats, datasets, graphics, grDevices, grid, methods, parallel, COMPILER, splines, tcltk, STATS4.

15.

At higher level one “limitation” of R is that its functionality is based on __________(a) Consumer demand(b) User contributions(c) User contributions and Consumer demand(d) Lower level contributionsThis question was addressed to me in an internship interview.My question comes from History of R in chapter History, Overview and Getting Started of R Programming

Answer»

Correct ANSWER is (c) User contributions and Consumer demand

To elaborate: Its functionality is based on consumer demand and user contributions. It is only for the HIGHER level. The capabilities of the R system generally REFLECT the interests of the R user COMMUNITY. However, now some of those communities have adopted R and we are seeing more code being written for those kinds of applications.

16.

R is technically much closer to the Scheme language than it is to the original _____ language.(a) B(b) C(c) C++(d) SThe question was asked in an online quiz.This interesting question is from History of R in portion History, Overview and Getting Started of R Programming

Answer» RIGHT choice is (d) S

Best explanation: R’s semantics, while superficially SIMILAR to S, are quite DIFFERENT.
17.

Finally, in _________ R version 1.0.0 was released to the public.(a) 2000(b) 2005(c) 2010(d) 2012The question was posed to me in an online interview.The question is from History of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct option is (a) 2000

To EXPLAIN: Source code for the entire R system is ACCESSIBLE to ANYONE who wanted to tinker with it.

18.

Why is it needed for R studio to update regularly?(a) Bugs(b) More Functions(c) Methods(d) For more packagesThe question was asked in final exam.The above asked question is from Basics in chapter History, Overview and Getting Started of R Programming

Answer»

The CORRECT answer is (a) Bugs

To explain I would say: RStudio is very popular with a nice INTERFACE and well thought out, especially for more advanced usage. It can be a BIT buggy, so MAKE SURE you update it regularly. Available on all platforms.

19.

Which of the following command is used to print an object “x” in R?(a) printf(x)(b) print(x)(c) printx(d) print[x]I got this question in an online quiz.My question is from History of R in section History, Overview and Getting Started of R Programming

Answer»

The correct answer is (b) print(X)

The explanation: print(x) COMMAND is used to print. Print(x) is the basic syntax for R. We can directly print the variable without print function also. The functions in R are helpful to the user to SIMPLIFY the PROBLEM.

20.

Which Package contains most fundamental functions to run R?(a) root(b) child(c) base(d) parentThe question was asked in final exam.This interesting question is from Overview of R in section History, Overview and Getting Started of R Programming

Answer» RIGHT CHOICE is (c) base

The BEST I can explain: base package in R contains the most FUNDAMENTAL FUNCTIONS.
21.

R functionality is divided into a number of ________(a) Packages(b) Functions(c) Domains(d) ClassesThis question was posed to me in homework.My doubt is from Overview of R in portion History, Overview and Getting Started of R Programming

Answer»

Right answer is (a) Packages

Best EXPLANATION: CRAN ALSO hosts many add-on packages that can be USED to EXTEND the functionality of R.

22.

The entities that R creates and manipulates are known as ________(a) objects(b) task(c) container(d) packagesI got this question during an online interview.The doubt is from Console Input and Evaluation topic in section History, Overview and Getting Started of R Programming

Answer»

The correct CHOICE is (a) objects

Explanation: These may be variables, arrays of numbers, character STRINGS, FUNCTIONS, or more general structures BUILT from such COMPONENTS.

23.

___________ hosts many add-on packages that can be used to extend the functionality of R.(a) CRAN(b) GNU(c) R studio(d) 450This question was posed to me by my college professor while I was bunking the class.I would like to ask this question from Install and Configure topic in division History, Overview and Getting Started of R Programming

Answer» RIGHT option is (a) CRAN

The explanation is: The primary R system is available from the Comprehensive R Archive Network, also known as CRAN. CRAN also HOSTS MANY add-on packages that can be USED to extend the functionality of R.
24.

If commands are stored in an external file, say commands.R in the working directory work, they may be executed at any time in an R session with the command ____________(a) source(“commands.R”)(b) exec(“commands.R”)(c) execute(“commands.R”)(d) exect(“command.R”)This question was addressed to me in an international level competition.This intriguing question comes from Console Input and Evaluation topic in chapter History, Overview and Getting Started of R Programming

Answer»

The correct answer is (a) source(“commands.R”)

EASY EXPLANATION: For Windows, Source is ALSO available on the FILE MENU.

25.

The open source _________ software is available for Unix, Linux, and Windows platforms.(a) Rserve(b) BServe(c) CServe(d) DserveI had been asked this question in an online quiz.My question is from Install and Configure topic in chapter History, Overview and Getting Started of R Programming

Answer»

Correct answer is (a) Rserve

Best explanation: The open source Rserve (BINARY R Server) software is available for Unix, Linux, and Windows platforms. However, due to limitations with the Windows version, it is not RECOMMENDED for use OUTSIDE of evaluation PURPOSES.

26.

A _______________ is a variable that holds one value at a time.(a) Scalar variable(b) Duplex(c) High(d) VectorThe question was posed to me in an internship interview.My question is from Install and Configure topic in chapter History, Overview and Getting Started of R Programming

Answer»

Correct answer is (a) SCALAR variable

The explanation is: A scalar variable was a variable which holds one VALUE at a time. It is a single COMPONENT which assumes a range of number or string VALUES. A scalar value is associated with every POINT in space.

27.

Which language is best for the statistical environment?(a) C(b) R(c) Java(d) PythonThis question was addressed to me in an interview for job.My question comes from Install and Configure in chapter History, Overview and Getting Started of R Programming

Answer»

Correct option is (b) R

Easy EXPLANATION: R is a POPULAR programming language and environment for STATISTICAL COMPUTING, graphics and also predictive analysis. Dundas BI integrates with an existing R system at the data cube level via many transforms which you can use to PERFORM data generation or data processing.

28.

What is NaN called?(a) Not a Number(b) Not a Numeric(c) Number and Number(d) Number a NumericI had been asked this question in semester exam.Question is taken from Overview of R in division History, Overview and Getting Started of R Programming

Answer» CORRECT answer is (a) Not a Number

For explanation I would say: NaN is called Not a Number. It is the full form of NaN. Full forms can be VIEWED in R STUDIO by typing help. A NaN VALUE is also NA but the converse is not true. The value NaN represents an undefined value.
29.

How can we define ‘undefined value’ in R language?(a) Inf(b) Sup(c) Und(d) NaNThe question was asked in class test.The doubt is from Overview of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

Right ANSWER is (d) NaN

The BEST explanation: NaN is used to define the “undefined” value in the R language. Undefined values also have some value in R. Missing values are DENOTED by NA or NaN for Q undefined mathematical operations. A NaN value is also NA but the converse is not TRUE.

30.

If a command is not complete at the end of a line, R will give a different prompt, by default it is ____________(a) *(b) –(c) +(d) /This question was addressed to me during an interview.I need to ask this question from Basics topic in portion History, Overview and Getting Started of R Programming

Answer» CORRECT CHOICE is (c) +

Explanation: Comments can be PUT almost ANYWHERE, starting with a hashmark (‘#’), everything to the end of the line is a COMMENT.
31.

Advanced programmers can write ______ code to manipulate R objects.(a) Python(b) Java(c) C(d) Java ScriptI have been asked this question in an online quiz.I'm obligated to ask this question of Basics topic in division History, Overview and Getting Started of R Programming

Answer» CORRECT option is (c) C

To explain: C, C++ and Fortran can be LINKED. There are a number of PEOPLE had used something like C/C++ programming languages to manipulate the R OBJECTS.
32.

Which of the following describes R language?(a) Free(b) Paid(c) Available for free trial only(d) TestingThe question was asked in my homework.Question is taken from History of R in portion History, Overview and Getting Started of R Programming

Answer» RIGHT CHOICE is (a) Free

Explanation: A major advantage that R has over many other STATISTICAL PACKAGES and is that it’s free.
33.

In order to use the R-related functionality in Dundas BI, you must have access to an existing _________(a) Console(b) Terminal(c) Packages(d) R serverThis question was posed to me in homework.My question is from Install and Configure in chapter History, Overview and Getting Started of R Programming

Answer» RIGHT option is (d) R server

The best I can explain: In order to use the R-related FUNCTIONALITY in Dundas BI, we must have ACCESS to an existing R server. There are configuration settings in Dundas BI that allow administrators to specify the details for connecting to the external R server.
34.

Scripts will run on ___________________(a) Script Editors(b) Console(c) Terminal(d) GCC CompilerThis question was addressed to me in exam.I'm obligated to ask this question of Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Correct option is (a) Script EDITORS

Explanation: script editors are DESIGNED to aid the communication and code writing process. They have all SORTS of features including R syntax highlighting, AUTOMATIC code completion, DELIMITER matching, and dynamic help on the R functions.

35.

Advanced users can write ___ code to manipulate R objects directly.(a) C, C++(b) C++, Java(c) Java, C(d) JavaThe question was asked during a job interview.Question is from Overview of R in portion History, Overview and Getting Started of R Programming

Answer»

Right OPTION is (a) C, C++

Easiest EXPLANATION: For computationally-intensive tasks, C, C++ and Fortran code can be linked and called at RUN TIME.

36.

Which is simpler for statistical programming?(a) C(b) Java(c) R(d) No languageThis question was addressed to me at a job interview.This intriguing question originated from Install and Configure in section History, Overview and Getting Started of R Programming

Answer»

Right answer is (c) R

To explain I would say: R (www.r-project.org) is a commonly used FREE Statistics SOFTWARE. R ALLOWS you to carry out STATISTICAL analyses in an interactive mode, as well as allowing SIMPLE programming.

37.

Modification in Dundas BI is done ______________(a) Directly(b) Indirectly(c) Need access to Server(d) Not knownI have been asked this question during an interview.The doubt is from Install and Configure in portion History, Overview and Getting Started of R Programming

Answer» CORRECT option is (a) Directly

For EXPLANATION: We can view or modify CONFIGURATION settings in Dundas BI through an administration screen, so there’s no NEED to access the Dundas BI server directly.
38.

If the code is stored in the external file, which of the following function is used to call them to a working directory?(a) exec()(b) source()(c) execute()(d) sourcefile()The question was posed to me by my college professor while I was bunking the class.My question is taken from Basics topic in division History, Overview and Getting Started of R Programming

Answer»

The correct choice is (b) source()

The explanation is: source is available in the file menu. Today R RUNS on almost any standard computing platform and operating system. Its open source nature. The copyright for the PRIMARY source code for R is held by the R FOUNDATION and is PUBLISHED under the GNU General Public License version.

39.

Which of the following will start the R program?(a) $ R(b) > R(c) * R(d) @ RThis question was addressed to me by my college professor while I was bunking the class.This question is from Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Correct option is (a) $ R

The BEST I can explain: At this POINT R commands may be ISSUED.

40.

Which of the following operator is used to create integer sequences?(a) :(b) ;(c) –(d) ~I got this question by my college director while I was bunking the class.Enquiry is from Overview of R topic in section History, Overview and Getting Started of R Programming

Answer»

Right choice is (a) :

To explain: “:” OPERATOR is used to create an integer sequence. The other OPERATORS are used for other PURPOSES. Integer sequence is the basic operator used in R. The [ operator can be used to extract multiple ELEMENTS of a vector by passing the operator an integer sequence.

41.

Point out the wrong statement?(a) Key feature of R was that its syntax is very similar to S(b) R runs only on Windows computing platform and operating system(c) R has been reported to be running on modern tablets, phones, PDAs, and game consoles(d) R functionality is divided into a number of PackagesI got this question during a job interview.Origin of the question is Overview of R in portion History, Overview and Getting Started of R Programming

Answer»

The CORRECT option is (b) R RUNS only on WINDOWS computing platform and operating SYSTEM

Best explanation: R runs on almost any standard computing platform and operating system.

42.

Point out the WRONG statement?(a) Early versions of the S language contain functions for statistical modeling(b) The book Programming with Data by John Chambers documents S version of the language(c) In 1993 Bell Labs gave StatSci (later Insightful Corp.) an exclusive license to develop and sell the S language(d) The book Programming with Data by IBM documents S version of the languageI got this question in an interview for internship.My doubt stems from History of R topic in chapter History, Overview and Getting Started of R Programming

Answer»

The CORRECT option is (a) Early versions of the S LANGUAGE contain functions for statistical modeling

For explanation: Insightful SOLD its implementation of the S language under the PRODUCT name S-PLUS.

43.

Point out the wrong statement?(a) R is a language for data analysis and graphics(b) K is language for statistical modelling and graphics(c) One key limitation of the S language was that it was only available in a commercial package, S-PLUS(d) C is a language for data and graphicsThe question was posed to me in an international level competition.Asked question is from History of R in portion History, Overview and Getting Started of R Programming

Answer»

Right CHOICE is (b) K is language for statistical MODELLING and graphics

Easy explanation: In 1996, a public mailing list was created (the R-help and R-devel lists) and in 1997 the R Core Group was formed, CONTAINING some people associated with S and S-PLUS.

44.

A single element of a character vector is referred as ________(a) Character string(b) String(c) Data strings(d) Raw dataI had been asked this question in an online interview.The question is from Basics topic in section History, Overview and Getting Started of R Programming

Answer»

The correct answer is (a) Character string

For EXPLANATION: Single ELEMENT of a character vector is often REFERRED to as a character string. Dates are represented by the Date class and can be coerced from a character string using the as.Date() function. This is a COMMON way to END up with a Date object in R.

45.

What is the function to set row names for a data frame?(a) row.names()(b) colnames()(c) col.names()(d) column name cannot be set for a data frameI had been asked this question in final exam.My question is from Basics topic in section History, Overview and Getting Started of R Programming

Answer»

The CORRECT choice is (a) ROW.NAMES()

EXPLANATION: row.names() is the function to set row names for a DATA frame. Data frames have a special attribute called row.names, which indicate information about each row of the data frame.

46.

Command lines entered at the console are limited to about ________ bytes.(a) 3000(b) 4095(c) 5000(d) 6000This question was posed to me in semester exam.Enquiry is from Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

Right option is (B) 4095

For explanation: Elementary COMMANDS can be grouped together into one COMPOUND expression by BRACES (‘{’ and ‘}’).

47.

R has many functions regarding ________________(a) Statistics, Biotechnology(b) Probability, Microbiology(c) Distributions, Physics(d) Statistics, Probability, DistributionsThe question was asked in an international level competition.The above asked question is from Install and Configure in portion History, Overview and Getting Started of R Programming

Answer»

Right option is (d) Statistics, Probability, DISTRIBUTIONS

For explanation I WOULD say: R has many functions for all types of mathematical objects. For EXAMPLE, Statistics, Probability, Distributions like Multivariate, Continuous, Simple, Discrete etc.

48.

How to install for a package and all of the other packages on which for depends?(a) install.packages (for, depends = TRUE)(b) R.install.packages (“for”, depends = TRUE)(c) install.packages (“for”, depends = TRUE)(d) install (“for”, depends = FALSE)I got this question in an online quiz.My doubt stems from Basics topic in portion History, Overview and Getting Started of R Programming

Answer»

The correct OPTION is (c) install.packages (“for”, depends = TRUE)

EASIEST EXPLANATION: To install a package named for, open up R and type install.packages(“for”). To install foo and additionally install all of the other packages on which for depends, INSTEAD type install.packages (“for”, depends = TRUE).

49.

In ________ Insightful purchased the S language from Lucent for $2 million.(a) 2002(b) 2003(c) 2004(d) 2005The question was asked in an international level competition.The origin of the question is Basics in portion History, Overview and Getting Started of R Programming

Answer»

The correct CHOICE is (c) 2004

The explanation: TIBCO is the current OWNER of the S language. In 2008, Insightful was acquired by TIBCO for $25 million. As of this WRITING, TIBCO is the current owner of the S language and is its exclusive DEVELOPER.

50.

R language is a dialect of which of the following languages?(a) S(b) C(c) MATLAB(d) SASI had been asked this question during an interview.This intriguing question originated from Basics topic in section History, Overview and Getting Started of R Programming

Answer» CORRECT choice is (a) S

Explanation: The R language is a dialect of S which was designed in the 1980s. Since the early 90’s the LIFE of the S language has gone down a rather winding path. The SCOPING rules for R are the main feature that makes it different from the original S language.