R Language quiz questions

R Language interview questions

  • 1.

    The profiler can be turned off by passing _________ to Rprof().

    1. 0

    2. 1

    3. 2

    4. NULL

    Answer
  • 2.

    You can time ________ expressions by wrapping them in curly braces within the call to system.time().

    1. smaller

    2. longer

    3. error

    4. All of the mentioned

    Answer
  • 3.

    Parallel processing is done via __________ package can make the elapsed time smaller than the user time.

    1. parallel

    2. statistics

    3. distributed

    4. None of the mentioned

    Answer
  • 4.

    The elapsed time may be ________ than the user time if your machine has multiple cores/processors

    1. smaller

    2. greater

    3. equal to

    4. All of the mentioned

    Answer
  • 5.

    _________ time is time charged to the CPU(s) for the R expression.

    1. elapsed

    2. user

    3. response

    4. All of the mentioned

    Answer
  • 6.

    system.time function returns an object of class _______ which contains two useful bits of information.

    1. debug_time

    2. proc_time

    3. procedure_time

    4. All of the mentioned

    Answer
  • 7.

    Point out the correct statement :

    1. Rprofiler() tabulates how much time is spent inside each function

    2. Rprof() keeps track of the function call stack at regularly sampled intervals

    3. By default, the profiler samples the function call stack every 2 seconds

    4. None of the mentioned

    Answer
  • 8.

    The _______ function computes the time (in seconds) needed to execute an expression.

    1. system.timedeb()

    2. system.time()

    3. system.datetime()

    4. All of the mentioned

    Answer
  • 9.

    R comes with a ________ to help you optimize your code and improve its performance.

    1. debugger

    2. monitor

    3. browser

    4. profiler

    Answer
  • 10.

    Point out the correct statement :

    1. The Rprofiler() function starts the profiler in R

    2. Using system.time() allows you to test certain functions or code blocks to see if they are taking excessive amounts of time

    3. R must not be compiled with profiler support

    4. All of the mentioned

    Answer
  • 11.

    ________ is a systematic way to examine how much time is spent in different parts of a program.

    1. Profiling

    2. Monitoring

    3. Logging

    4. All of the mentioned

    Answer
  • 12.

    What will be the output of the following code ?

    > set.seed(20)
    > x <- rnorm(100)
    > e <- rnorm(100, 0, 2)
    > y <- 0.5 + 2 * x + e 
    > summary(y)

     

    1. Min. 1st Qu. Median Mean 3rd Qu. Max.
      -6.4080 -1.5400 0.6789 0.6893 2.9300 6.5050
    2. Min. 1st Qu. Median Mean 3rd Qu. Max.
      -6.4080 -10.5400 0.6789 5.6893 2.9300 6.5050
    3. Min. 1st Qu. Median Mean 3rd Qu. Max.
      -1.4080 -6.5400 0.6789 0.6893 2.9300 6.5050
    4. All of the mentioned

    Answer
  • 13.

    Which of the following code represents count with mean of 2 ?

    1. rpois(10, 2)

    2. rpois(10, 20)

    3. rpois(20, 2)

    4. All of the mentioned

    Answer
  • 14.

    What will be the output of the following code ?

     > rpois(10, 1)

     

    1.  [1] 7 0 1 1 2 1 1 4 1 2
    2.  [1] 0 8 1 1 2 1 1 4 1 2
    3.  [1] 0 0 1 1 2 1 1 4 1 2
    4. All of the mentioned

    Answer
  • 15.

    __________ distribution is commonly used to model data that come in the form of counts.

    1. Gaussian

    2. Parametric

    3. Poisson

    4. All of the mentioned

    Answer
  • 16.

    What will be the output of the following code >

    > set.seed(10)
    > x <- rbinom(100, 1, 0.5)
    > str(x)

     

    1. int [1:100] 1 0 0 1 0 0 0 0 1 0 ...
    2. int [1:100] 10 0 01 1 0 0 01 0 1 0 ...
    3. int [1:100] 1 03 0 1 0 0 0 02 1 0 ...
    4. int [1:100] 1 2 3 1 1 0 0 0 1 0 ...
    Answer
  • 17.

    Point out the wrong statement :

    1. Drawing samples from specific probability distributions can be done with “s” functions

    2. The sample() function draws randomly from a specified set of (scalar) objects allowing you to sample from arbitrary distributions of numbers

    3. The sampling() function draws randomly from a specified set of objects

    4. None of the mentioned

    Answer
  • 18.

    _______ function is used to simulate binary random variables.

    1. dnorm

    2. rbinom()

    3. binom()

    4. rpois

    Answer
  • 19.

    5 Normal random numbers can be generated with rnorm() by setting seed value to :

    1. 1

    2. 2

    3. 3

    4. 4

    Answer
  • 20.

    Point out the correct statement :

    1. When simulating any random numbers it is not essential to set the random number seed

    2. It is not possible to generate random numbers from other probability distributions like the Poisson

    3. You should always set the random number seed when conducting a simulation

    4. All of the mentioned

    Answer

© 2017 QuizBucket.org