ICAR-IASRI MSc and PhD Programming for Statistics & Data (R and Python): practice questions
ICAR-IASRI MSc and PhD (Agricultural Statistics, Computer Application, Bioinformatics) · India · ICAR-Indian Agricultural Statistics Research Institute with the IARI Graduate School
Original practice questions written to the published syllabus · not past papers
10worked here, free
31written to this exam in this subject
8syllabus units
About ICAR-IASRI MSc and PhD
ICAR-IASRI MSc and PhD (Agricultural Statistics, Computer Application, Bioinformatics) is a postgraduate admission exam run by ICAR-Indian Agricultural Statistics Research Institute with the IARI Graduate School, for candidates in India. Admission through ICAR AIEEA-PG (Master's) and AICE-JRF/SRF (PhD) plus the Graduate School's own process.
We have not been able to confirm these details against the exam body's own specification, so fees, dates and pass marks are left out on purpose. Check the current format, eligibility, fees and dates on the official site.
Programming for Statistics & Data (R and Python) in ICAR-IASRI MSc and PhD
Writing correct, readable programs for data work: R and Python as the working languages, with the control structures, functions, data frames, vectorisation and debugging habits that later computing subjects assume. C and SAS are covered where agricultural universities still teach them.
Our 31 ICAR-IASRI MSc and PhD questions in this subject: 13 easy, 18 medium, 0 hard, across 8 units.
10 practice questions, worked
Choose an answer, then open the working. Each explanation says why the right answer is right and why the others are not.
These 10 were written to ICAR-IASRI MSc and PhD and are not shown on any other exam's page.
Question 1 · medium
For a list lst in R, lst[1] and lst[[1]] return respectively:
The element itself, and then a list containing it
The same object in both cases
A list of length one, and the element itself
An error, and the element
Answer and working
C. A list of length one, and the element itself
Single brackets subset the list; double brackets extract the element.
Question 2 · medium
Why is seq_along(x) preferred to 1:length(x) in R loops?
seq_along(x) is always much faster in every case
1:length(x) is not valid syntax
seq_along(x) skips missing values
1:length(x) gives c(1, 0) when x is empty
Answer and working
D. 1:length(x) gives c(1, 0) when x is empty
With an empty x, 1:0 runs the loop twice with invalid indices; seq_along gives an empty sequence.
Question 3 · medium
R's lexical scoping means that a function looks up a free variable:
In the environment where it is called
Only among its arguments
Where the function was defined
Only in the global environment
Answer and working
C. Where the function was defined
Lookup follows the defining environment, then its parents.
Question 4 · medium
Which join keeps only rows whose keys appear in both tables?
Left join
Full join
Right join
Inner join
Answer and working
D. Inner join
Left and right joins keep all rows of one table; full keeps all of both.
Question 5 · easy
Which ggplot2 function splits a plot into panels by a variable?
facet_wrap
geom_smooth
scale_colour
coord_flip
Answer and working
A. facet_wrap
Facets create small multiples.
Question 6 · medium
The grammar of graphics that ggplot2 implements was set out by:
Tukey
Fisher
Knuth
Wilkinson
Answer and working
D. Wilkinson
Leland Wilkinson's The Grammar of Graphics.
Question 7 · medium
A scatter-plot matrix of several variables in base R is drawn with:
histogram()
barplot()
boxplot()
pairs()
Answer and working
D. pairs()
pairs plots every pair of variables.
Question 8 · medium
Declaring package dependencies and versions for a project mainly prevents:
Viruses and malware on the shared computer
Data entry errors
Breakage when shared libraries change
Slow plotting
Answer and working
C. Breakage when shared libraries change
Pinned versions and project environments keep analyses reproducible.
Question 9 · easy
A well-designed function should:
Print every intermediate value
Use as many global variables as possible
Be as long as possible
Return values, not change globals
Answer and working
D. Return values, not change globals
Pure, focused functions are easier to test and reuse.
Question 10 · medium
Which is a testing framework for R?
ggplot2
testthat
tidyr
Rcpp
Answer and working
B. testthat
pytest is the common Python framework.
A study plan for Programming for Statistics & Data (R and Python) in ICAR-IASRI MSc and PhD
This plan follows where our questions actually fall, so the time goes where the marks are likely to be. It is our reading of the syllabus, not the exam body's weighting.
First, the heavy units (55% of the 31 questions): R: vectors, data frames, factors and lists (7, 23%); R: functions, control flow and vectorisation (6, 19%); Graphics in R (base and ggplot2) and Python (matplotlib) (4, 13%).
Read the manual chapters for these first and do every worked question you can find on them.
Then the middle band: Writing functions and simple packages (4, 13%); Algorithms, flowcharts and pseudocode (3, 10%); Debugging, testing and code style (3, 10%).
Aim for one sitting per unit, then mixed questions across them.
Then the lighter units: Reading, cleaning and reshaping data (3, 10%); Python: core types, NumPy arrays and pandas data frames (1, 3%).
Learn the definitions, classifications and standard numbers; these units are more often recalled than worked.
Bank the easy marks: Writing functions and simple packages (3 easy of 4); Algorithms, flowcharts and pseudocode (2 easy of 3).
Do these early in revision so they are fast on the day.
Finish timed. Sit the subject as a timed set without notes, mark it, and send each wrong answer back to its unit above.