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.
| 1. |
________ function is usually used inside another function and throws a warning whenever a particular package is not found.(a) Dplyr(b) Require(c) Coin(d) SampleI had been asked this question in an internship interview.Question is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (b) Require |
|
| 2. |
Point out the correct statement?(a) Vectorizing the function can be accomplished easily with the Vectorize() function(b) There are different levels of indication that can be used, ranging from mere notification to fatal error(c) Vectorizing the function can be accomplished easily with the vector() function(d) Warnings are generated by the run() functionThis question was addressed to me in class test.My question is from Debugging in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT answer is (a) Vectorizing the function can be accomplished easily with the Vectorize() function |
|
| 3. |
Which function is used to select variables and observations from a given dataset?(a) Subset()(b) Sample()(c) While()(d) Signal()This question was posed to me during an online exam.My doubt is from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (a) Subset() |
|
| 4. |
The ________ for R are the main feature that make it different from the original S language.(a) scoping rules(b) closure rules(c) environment rules(d) closure & environment rulesI got this question by my college director while I was bunking the class.Query is from Scoping Rules topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct answer is (a) scoping rules |
|
| 5. |
How do you create log linear models in R language?(a) loglm()(b) logmn()(c) logfn()(d) loghy()The question was posed to me during a job interview.This interesting question is from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (a) loglm() |
|
| 6. |
How many types of data structures does R language have?(a) 2(b) 3(c) 5(d) 8I have been asked this question in an online interview.Asked question is from Functions in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct choice is (a) 2 |
|
| 7. |
How missing values and impossible values are represented in R language?(a) NA(b) NAN(c) NA & NAN(d) Not ExistThis question was posed to me in an online quiz.This interesting question is from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (c) NA & NAN |
|
| 8. |
Which of the following is primary tool for debugging?(a) debug()(b) trace()(c) browser()(d) traceback()I have been asked this question in homework.This intriguing question comes from Debugging Tools topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT option is (a) DEBUG() Easiest explanation: Primary tools are mainly USED for DEBUGGING R code. |
|
| 9. |
__________ prints out the function call stack after an error occurs.(a) trace()(b) traceback()(c) back()(d) traback()The question was posed to me in an interview.The question is from Debugging Tools topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right choice is (B) traceback() |
|
| 10. |
__________ function is used for reading the .csv file in R language.(a) Write.csv()(b) Read.csv ()(c) Let.csv()(d) Table.csv()This question was addressed to me in semester exam.I'm obligated to ask this question of Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (B) Read.csv () |
|
| 11. |
MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets from _________ into R.(a) HDLS(b) HDFS(c) HDLSV(d) HSSLVThis question was addressed to me in homework.Origin of the question is Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (b) HDFS |
|
| 12. |
R code can be tested using _________________ package.(a) Dplyr(b) Hadley’s testthat(c) SKLearn(d) KNNI got this question in unit test.Question is taken from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT option is (b) Hadley’s testthat Easiest explanation: R code can be TESTED using Hadley’s testthat package. Testthat draws inspiration from the xUnit family of TESTING packages, as well as from many of the innovative ruby testing libraries. |
|
| 13. |
__________ package is used to speed up data frame management code.(a) Data.table(b) Dplyr(c) Table(d) Data.dplyrI had been asked this question by my school teacher while I was bunking the class.I'd like to ask this question from Functions in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right answer is (b) Dplyr |
|
| 14. |
Which function in R language is used to find out whether the means of 2 groups are equal to each other or not?(a) f.tests ()(b) l.tests ()(c) t.tests ()(d) not existI have been asked this question in final exam.This interesting question is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct CHOICE is (c) t.tests () |
|
| 15. |
Two vectors M and N are defined as M |
|
Answer» The CORRECT OPTION is (d) Z <- (3, 4, 4) |
|
| 16. |
What will be the value of following R expression?(a) Warning in log(c(-1, 2)): NaNs produced(b) Error in log(c(-1, 2)): NaNs produced(c) Message(d) All of the mentionedThis question was addressed to me in my homework.Question is taken from Debugging in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right answer is (B) Error in log(c(-1, 2)): NaNs produced |
|
| 17. |
Point out the wrong statement?(a) Dynamic scoping turns out to be particularly useful for simplifying statistical computations(b) Lexical scoping turns out to be particularly useful for simplifying statistical computations(c) The scoping rules of a language determine how values are assigned to free variables(d) An environment is a collection of (symbol, value) pairs, i.e. x is a symbol and 3.14 might be its valueI got this question in a job interview.My question is taken from Scoping Rules topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct OPTION is (a) Dynamic scoping turns out to be particularly USEFUL for simplifying STATISTICAL computations |
|
| 18. |
How will you check if an element is present in a vector?(a) Match()(b) Dismatch()(c) Mismatch()(d) Search()The question was asked in an interview for internship.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 choice is (a) MATCH() |
|
| 19. |
Write a function to extract the first name in the string “Mrs. Jake Luther”?(a) Substring(b) Substr(c) Substi(d) ReturnI got this question in an online interview.I want to ask this question from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT answer is (b) Substr |
|
| 20. |
What will be the class of the vector if you concatenate a number and NA?(a) Number(b) Character(c) Integer(d) No classThis question was posed to me in quiz.Asked question is from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT choice is (a) Number |
|
| 21. |
__________ can contain heterogeneous inputs.(a) Matrix(b) Data Frames(c) Matrix and Data Frames(d) Does not existsI got this question in quiz.This intriguing question comes from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT choice is (b) Data Frames To explain: Data frame can contain HETEROGENEOUS inputs while a matrix cannot. In the matrix, only similar data types can be stored WHEREAS in a data frame there can be DIFFERENT data types like CHARACTERS, integers or other data frames. |
|
| 22. |
What are the different types of sorting algorithms available in R language?(a) Bubble(b) Selection(c) Merge(d) All sortsI have been asked this question in an internship interview.This interesting question is from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (d) All SORTS |
|
| 23. |
The recover() function will first print out the function call stack when an _______ occurs.(a) Error(b) Warning(c) Messages(d) deleteThis question was posed to me in unit test.Question is taken from Debugging in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT choice is (a) Error Explanation: When you CHOOSE a frame NUMBER, you will be PUT in the browse and will have the ability to POKE around. |
|
| 24. |
The only environment without a parent is the ________ environment.(a) full(b) half(c) null(d) emptyThe question was asked in a national level competition.Question is from Scoping Rules topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The CORRECT choice is (d) empty |
|
| 25. |
__________ function takes various parameters like formula, data, subset, labels, etc.(a) Pears(b) Pairs(c) Tears(d) CarsThis question was posed to me by my school principal while I was bunking the class.This intriguing question originated from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (B) Pairs |
|
| 26. |
Point out the correct statement?(a) POSIX represents a portable operating system interface, primarily for UNIX systems(b) There are different levels of indication that can be used, ranging from mere notification to fatal error(c) The default input format for POSIX dates consists of the month, followed by the year and day, separated by slashes or dashes(d) R don’t have any way to indicate to you that something’s not rightThis question was addressed to me in a national level competition.I need to ask this question from Dates and Times topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (a) POSIX represents a portable OPERATING system interface, primarily for UNIX systems |
|
| 27. |
_____________ will produce a sequential vector c( (1,2,3,4,5,6,7,8,9)).(a) Seq(9)(b) Seq(10)(c) Seq(15)(d) Seq(12)I have been asked this question at a job interview.My query is from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right choice is (a) Seq(9) |
|
| 28. |
What is the memory limit in R for 32 bit system?(a) 8 TB(b) 9TB(c) 10TB(d) 3GBThe question was asked in final exam.I need to ask this question from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (d) 3GB |
|
| 29. |
If the function in a console is.matrix(X) returns true then X can be considered as a _______(a) Matrix object(b) Matrix data object(c) Matrix vector(d) VectorThis question was addressed to me by my school teacher while I was bunking the class.This intriguing question comes from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (B) Matrix DATA object |
|
| 30. |
If the programmers want the output to be a data frame or a vector, then________ function is used.(a) Lapply(b) Sapply(c) Vapply(d) ZapplyI have been asked this question in my homework.My doubt is from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT answer is (a) Lapply Easiest EXPLANATION: If the programmers want the output to be a data frame or a vector, then sapply function is USED whereas if the programmer WANTS the output to be a LIST then lapply is used. vapply allows the programmer to specific the output type. |
|
| 31. |
R Commander is used to ___________ in R.(a) Export data(b) Import data(c) Use data(d) Work on dataThe question was posed to me in exam.Question is from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct option is (b) Import data |
|
| 32. |
In the base graphics system, which function is used to add elements to a plot?(a) Boxplot()(b) Text()(c) Boxplot() or Text()(d) Treat()This question was addressed to me in an online interview.I need to ask this question from Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct choice is (c) Boxplot() or Text() |
|
| 33. |
Point out the correct statement?(a) The traceback() function must be called immediately after an error occurs(b) The debugger calls the browser at the very low level of the function body(c) Every time you call the mod() function it will launch the interactive debugger(d) R provides only two tools to help you with debugging your codeThis question was addressed to me in class test.My question is from Debugging Tools topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct CHOICE is (a) The traceback() FUNCTION must be called immediately after an error occurs |
|
| 34. |
The cumulative frequency distribution of a categorical variable can be checked using the ________ function in R language.(a) Sum(b) Cumsum(c) Lumpsum(d) ResumThe question was asked at a job interview.My question is from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (B) Cumsum |
|
| 35. |
Warnings are generated by the _________ function.(a) warning()(b) error()(c) run()(d) message()The question was asked in examination.The question is from Dates and Times in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right answer is (a) warning() |
|
| 36. |
Point out the correct statement?(a) The search list can be found by using the searchlist() function(b) The search list can be found by using the search() function(c) The global environment or the user’s workspace is always the second element of the search list(d) R has separate namespaces for functions and non-functionsI got this question in quiz.The above asked question is from Scoping Rules in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT answer is (b) The search list can be found by using the search() function Easy EXPLANATION: Base PACKAGE is ALWAYS the last ELEMENT. |
|
| 37. |
Write the syntax to set the path of the current working directory in R environment?(a) Setwd(“dipath”)(b) Setwd(dir_path)(c) Setwd(“dir_path”)(d) Set(“dir_path”)I had been asked this question in homework.The doubt is from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right answer is (c) Setwd(“dir_path”) |
|
| 38. |
Which function is used to create a histogram for visualisation in R programming language?(a) Library(b) Hist(c) Data(d) ReferI got this question at a job interview.I'm obligated to ask this question of Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (b) Hist |
|
| 39. |
____________ is one type of the simplest machine learning classification algorithms that is a subset of supervised learning based on lazy learning.(a) K-Nearest Neighbour(b) Naïve Bayes(c) Travelling Salesman(d) N-QueenThe question was asked in class test.Origin of the question is Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct option is (a) K-Nearest Neighbour |
|
| 40. |
A matrix of scatterplots can be produced using _________ function.(a) Pears(b) Pairs(c) Tears(d) CarsI had been asked this question during an online exam.My doubt stems from Functions topic in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct CHOICE is (b) PAIRS |
|
| 41. |
If a programmer wants the output to be a list then ___________ function is used.(a) Lapply(b) Sapply(c) Vapply(d) ZapplyI got this question during an online interview.I want to ask this question from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right answer is (b) Sapply |
|
| 42. |
Which function is difficult to implement?(a) Lapply(b) Japply(c) Vapply(d) ZapplyI have been asked this question at a job interview.I'm obligated to ask this question of Functions in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct OPTION is (c) VAPPLY |
|
| 43. |
__________ function is used in applying a function each level of factors.(a) With()(b) By()(c) To()(d) Here()I had been asked this question during an interview.I would like to ask this question from Functions in division Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» CORRECT answer is (B) By() For EXPLANATION: BY () function is used for applying a function each level of factors. R has a large number of in-built functions and also USER can create their own functions. In R, a function is an object. So the R interpreter is able to pass control to the function. |
|
| 44. |
Which package in R supports the exploratory analysis of genomic data?(a) Adegenat(b) Adegenet(c) Adegnet(d) AdezenetThis question was posed to me during a job interview.The doubt is from Functions in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct choice is (b) Adegenet |
|
| 45. |
__________ is the best way for communicating the results of data analysis using the R language.(a) Single document(b) Files(c) Structures(d) LoadingsI got this question in class test.My question is taken from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right option is (a) Single document |
|
| 46. |
A function, together with an environment, makes up what is called a ______ closure.(a) formal(b) function(c) reflective(d) symmetryThis question was posed to me by my college director while I was bunking the class.My question is from Scoping Rules topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT CHOICE is (b) function For EXPLANATION: The function closure model can be used to CREATE functions that “carry around” data with them. |
|
| 47. |
____________ package in R language provides various options for re-randomization and permutations based on statistical tests.(a) Coin(b) Vain(c) Join(d) LainI got this question in my homework.This intriguing question originated from Functions topic in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Correct answer is (a) Coin |
|
| 48. |
R uses _________ scoping^6 0 or static scoping.(a) reflective(b) transitive(c) lexical(d) closureThis question was posed to me in my homework.The question is from Scoping Rules topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» RIGHT CHOICE is (c) lexical The EXPLANATION is: Lexical scoping in R means that the values of free VARIABLES are searched for in the environment in which the function was DEFINED. |
|
| 49. |
______________ measures the probability of the binary response variable in R language.(a) Logical Regression(b) Multivariate Regression(c) Simpler Regression(d) StatisticsThis question was addressed to me by my college professor while I was bunking the class.This is a very interesting question from Functions topic in chapter Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» Right choice is (a) LOGICAL Regression |
|
| 50. |
________ function can be used to add datasets in R provided with the columns in the datasets should be the same.(a) rbind()(b) bbind()(c) jbind()(d) hbind()I have been asked this question in a job interview.This intriguing question comes from Functions topic in portion Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming |
|
Answer» The correct ANSWER is (a) rbind() |
|