InterviewSolution
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. |
Which function is more verbose?(a) Lapply(b) Japply(c) Vapply(d) ZapplyThe question was posed to me in an interview for internship.The question is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct ANSWER is (c) Vapply |
|
| 52. |
CRAN package ecosystem has more than ______ packages.(a) 5000(b) 4000(c) 6000(d) 8000I got this question during an interview.Question is from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right choice is (c) 6000 |
|
| 53. |
Point out the wrong statement?(a) The primary task of debugging any R code is correctly diagnosing what the problem is(b) R provides only two tools to help you with debugging your code(c) print statement can be used for debugging purpose(d) The traceback() function must be called immediately after an error occursI have been asked this question during an internship interview.The doubt is from Debugging Tools in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (b) R provides only two TOOLS to HELP you with DEBUGGING your CODE |
|
| 54. |
Point out the correct statement?(a) An environment is a collection of (symbol, value) pairs, i.e. x is a symbol and 3.14 might be its value(b) If the value of a symbol is not found in the environment in which a function was defined, then the search is continued in the child environment(c) After the top-level environment, the search continues down the search list until we hit the parent environment(d) Dynamic scoping turns out to be particularly useful for simplifying statistical computationsThis question was addressed to me in homework.This interesting question is from Scoping Rules topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (a) An environment is a COLLECTION of (SYMBOL, value) pairs, i.e. X is a symbol and 3.14 might be its value |
|
| 55. |
Which of the following language supports lexical scoping?(a) Perl(b) Python(c) Common Lisp(d) All of the mentionedI had been asked this question by my college director while I was bunking the class.My question is based upon Scoping Rules in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct ANSWER is (d) All of the mentioned |
|
| 56. |
The current user defined objects like lists, vectors, etc. is referred to as __________ in the R language.(a) Work names(b) Work space(c) Environment(d) ConsoleThe question was asked by my school teacher while I was bunking the class.My doubt stems from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (a) WORK names |
|
| 57. |
_____________ function is preferred over sapply as vapply allows the programmer to specific the output type.(a) Lapply(b) Japply(c) Vapply(d) ZapplyI got this question at a job interview.This interesting question is from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT choice is (c) Vapply Best EXPLANATION: Vapply is similar to SAPPLY, but has a pre-specified type of RETURN value, so it can be safer (and SOMETIMES faster) to use. simplify2array() is the utility called from sapply() when simplify is not false and is similarly called from mapply(). |
|
| 58. |
What will be the class of the vector if you concatenate a number and a character?(a) Number(b) Character(c) Integer(d) No classThis question was addressed to me in homework.I'd like to ask this question from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (B) Character |
|
| 59. |
What will be the output of runif()?(a) Random number(b) Numbers(c) Character(d) Path generationI have been asked this question in semester exam.The query is from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (a) Random number |
|
| 60. |
______ suspends the execution of a function wherever it is called and puts the function in debug mode.(a) debug()(b) trace()(c) recover()(d) browser()This question was addressed to me in homework.My doubt stems from Debugging Tools topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct CHOICE is (d) BROWSER() |
|
| 61. |
_______________ returns TRUE then X can be termed as a matrix data object.(a) is.”matrix(X”)(b) is.matrix(X)(c) is.notamatrix(X )(d) is.matrix(“X”)I have been asked this question in unit test.I'd like to ask this question from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT OPTION is (B) is.matrix(X) For explanation: The FUNCTION CALL is.matrix(X ) returns TRUE then X can be termed as a matrix data object. R has a large number of in-built functions and also the user can create their own functions. |
|
| 62. |
Point out the wrong statement?(a) The order of the packages on the search list does not matter(b) R has separate namespaces for functions and non-functions(c) Users can configure which packages get loaded on startup so if you are writing a function(d) The search list can be found by using the search() functionThis question was addressed to me in unit test.I need to ask this question from Scoping Rules in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct CHOICE is (a) The order of the PACKAGES on the search list does not matter |
|
| 63. |
_______ allows you to modify the error behavior so that you can browse the function call stack(a) debug()(b) trace()(c) recover()(d) traceback()The question was asked during an online exam.This question is from Debugging Tools topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (c) RECOVER() |
|
| 64. |
_________ is an indication that a fatal problem has occurred and execution of the function stops.(a) message(b) error(c) warning(d) message & warningThe question was asked in an online interview.My question is based upon Dates and Times topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (B) error |
|
| 65. |
Which function basically finds the intersection between two different sets of data?(a) Converge(b) Merge(c) Delegate(d) SwapI have been asked this question in exam.This interesting question is from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT option is (B) Merge |
|
| 66. |
_________ variables are categorical variables which can hold either string or numeric values.(a) Factor(b) Simpler(c) Function(d) PackageI have been asked this question in an online quiz.This interesting question is from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (a) Factor |
|
| 67. |
How is a Data object represented internally in R language?(a) unclass (as.time (“2018-12-28″))(b) unclass (as.dat (“2018-12-28″))(c) unclass (as.D (2018-12-28))(d) unclass (as.Date (“2018-12-28″))I had been asked this question during an internship interview.This interesting question is from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct ANSWER is (d) unclass (as.Date (“2018-12-28″)) |
|
| 68. |
What will be the output of log (-5.8) when executed on R console?(a) NAN(b) NA(c) Error(d) 0.213This question was addressed to me in an internship interview.I want to ask this question from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right choice is (a) NAN |
|
| 69. |
The line of code in R language should begin with a ________________(a) Hash symbol(b) Alphabet(c) Number(d) CharacterThis question was addressed to me in an interview for job.My enquiry is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT answer is (a) HASH symbol Explanation: The LINE of code in R LANGUAGE should begin with a hash symbol (#). R has a large number of in-built functions and also the USER can create their own functions. |
|
| 70. |
You can check to see whether an R object is NULL with the _________ function.(a) is.null()(b) is.nullobj()(c) null()(d) as.nullobj()I got this question in homework.The origin of the question is Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT answer is (a) is.null() To elaborate: It is SOMETIMES useful to allow an argument to take the NULL VALUE, which might INDICATE that the function should take some SPECIFIC action. |
|
| 71. |
A programmer builds a _________ to avoid repeating the same task or reduce complexity.(a) Function(b) Package(c) Code(d) ConsoleThe question was posed to me during an internship interview.The doubt is from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (a) Function |
|
| 72. |
Which function calculates the count of each category of a categorical variable?(a) Table(b) Intact(c) Tables(d) RetabsThe question was asked in an interview for job.Origin of the question is Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (a) Table |
|
| 73. |
If two vectors with different lengths perform some operation, the elements of the shorter vector will be used again to complete the operation. This is referred to as _________________(a) Element Recycling(b) Recycling(c) Cycling(d) Element CyclingThis question was posed to me during an internship interview.My enquiry is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT choice is (a) Element Recycling For explanation: If two vectors with different lengths perform an OPERATION, the elements of the shorter VECTOR will be used again to complete the operation. This is REFERRED to as element recycling. |
|
| 74. |
_________ package provides basic functionalities in R environment like arithmetic calculations, input/output.(a) R base(b) R boost(c) R serve(d) R commThis question was posed to me by my college professor while I was bunking the class.The doubt is from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct CHOICE is (a) R base |
|
| 75. |
______________ function will measure the probability of the binary response variable in R language.(a) Glm()(b) Glmi()(c) Gelmi()(d) Jlm()I had been asked this question in homework.I need to ask this question from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT choice is (a) Glm() |
|
| 76. |
_________ require you to pass a function whose argument is a vector of parameters.(a) optimize()(b) optimise()(c) opt()(d) opm()I had been asked this question in final exam.This intriguing question comes from Scoping Rules in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right OPTION is (c) opt() |
|
| 77. |
___________ function is used to apply an expression for a given dataset.(a) This()(b) With()(c) Unwith()(d) That()I had been asked this question during an interview for a job.My doubt is from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (b) With() |
|
| 78. |
Point out the correct statement?(a) R has a number of ways to indicate to you that something’s not right(b) Executing any function in R may result in the condition(c) “condition” is a generic concept for indicating that something unexpected has occurred(d) All of the mentionedI had been asked this question during an interview.This intriguing question originated from Dates and Times topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct CHOICE is (d) All of the mentioned |
|
| 79. |
What is the memory limit in R for 64 bit system?(a) 8 TB(b) 9TB(c) 10TB(d) 16TBThe question was posed to me in a national level competition.This is a very interesting question from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT choice is (a) 8 TB Easy explanation: 8TB is the memory LIMIT for 64-bit system memory and 3GB is the limit for 32-bit system memory. A solid understanding of R’s memory management will help you predict how much memory you’ll need for a given task. |
|
| 80. |
__________ is the easiest method for reshaping the data before analysis.(a) Transpose()(b) Structure()(c) Package(d) FunctionThis question was posed to me during an interview for a job.Enquiry is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (a) TRANSPOSE() |
|
| 81. |
What is the command used to store R objects in a file?(a) save (x, file=”x.Rdata”)(b) save (x, file=x.Rdata)(c) save (x, file=”x.Rdata”);(d) save (x, file=”x.data”)I got this question in class test.I need to ask this question from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (a) save (x, file=”x.Rdata”) |
|
| 82. |
________ functions can be “built which contain all of the necessary data for evaluating the function.(a) Objective(b) reflective(c) Nested(d) SymmetryI got this question in unit test.I would like to ask this question from Scoping Rules topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (a) Objective |
|
| 83. |
____________ function can be used to select the random sample of size ‘n’ from a huge dataset.(a) Simple()(b) Sample()(c) While()(d) Signal()The question was posed to me by my school principal while I was bunking the class.I want to ask this question from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct ANSWER is (b) Sample() |
|
| 84. |
________ function generates “n” normal random numbers based on the mean and standard deviation arguments passed to the function.(a) rnorm(b) vnorm(c) knorm(d) lnormThe question was asked in unit test.This question is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (a) RNORM |
|
| 85. |
Which package can be integrated with dplyr for large fast tables?(a) Table(b) Data, dplyr(c) Data.table(d) Dplyr.tableThe question was posed to me during an interview.This is a very interesting question from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (C) Data.table |
|
| 86. |
To get the current date, the _______ function will return a Date object which can be converted to a different class if necessary.(a) Sys.Time(b) Sys.Date(c) Sys.DateTime(d) DateTimeThis question was posed to me by my college director while I was bunking the class.I want to ask this question from Dates and Times topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (B) Sys.Date |
|
| 87. |
___________ function gives an error message if the desired package cannot be loaded.(a) Dplyr(b) Require(c) Library(d) SampleThis question was posed to me in an internship interview.My question is based upon Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (C) Library |
|
| 88. |
________ allows you to insert debugging code into a function a specific places(a) debug()(b) trace()(c) browser()(d) traceback()I have been asked this question in class test.The origin of the question is Debugging Tools topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT choice is (b) trace() EASIEST explanation: The FUNCTION call stack is the SEQUENCE of functions that was called before the error occurred. |
|
| 89. |
Which function helps you perform sorting in R language?(a) Order(b) Inorder(c) Simple(d) LibraryThe question was posed to me by my school teacher while I was bunking the class.This interesting question is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (a) Order |
|
| 90. |
A ________________ in R programming language can also contain numeric and alphabets along with special characters like dot and underline.(a) Variable name(b) Number(c) Integer(d) CharacterThis question was addressed to me during an interview for a job.My question is from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct choice is (a) Variable NAME |
|
| 91. |
What are the data types in R on which binary operators can be applied?(a) Scalars(b) Matrices(c) Vectors(d) Scalars, Matrices and VectorsThe question was posed to me during a job interview.I want to ask this question from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct answer is (d) SCALARS, Matrices and Vectors |
|
| 92. |
___________ can be used for storing the data for long-term.(a) HDLS(b) HDFS(c) HDLSV(d) HSSLVThis question was addressed to me in an interview for internship.My question comes from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT answer is (b) HDFS |
|