36 practice questions with answers for R Programming interviews in Coimbatore.
R Programming jobs in Coimbatore
Coimbatore has a growing IT-services and engineering-services market around TIDEL Park and its SEZs, supported by a large pool of engineering graduates. Many roles are with delivery centres of bigger IT firms.
Below are 36 questions that match the mix of service, product and domain employers hiring r data analysts in Coimbatore.
Solved for CoimbatoreStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
✓ 3 questions free • Unlock the rest in seconds
01
Your function gives correct results when you test it but wrong results in the main script. What could be the cause?
A common cause is that the function reads a variable from the global environment instead of taking it as an argument. During testing that global variable had one value, and in the main script it has another. Lexical scoping finds it silently. I would check the function body for names not defined as arguments or locally, for example using codetools::findGlobals(fn), and pass everything explicitly so the function is self-contained.
02
How do you check whether data is normally distributed in R?
Combine visual checks with formal tests, because tests become oversensitive with large samples.
hist(x, breaks = 30)
qqnorm(x); qqline(x, col = 'red')
shapiro.test(x) # works for n between 3 and 5000
library(ggplot2)
ggplot(df, aes(sample = x)) +
stat_qq() + stat_qq_line()
# for model residuals
plot(lm_fit, which = 2)
03
Your data is heavily skewed and the sample is small. Can you still use a t-test?
With small, heavily skewed samples the t-test's normality assumption is doubtful. I would check with a histogram, Q-Q plot or shapiro.test(). Options are a non-parametric test, wilcox.test() for two groups or kruskal.test() for more, a log transformation if the data is right-skewed and positive, or a bootstrap confidence interval for the difference in means. With large samples, the Central Limit Theorem usually makes the t-test acceptable.
A grouped data frame stays grouped after mutate() and some other verbs, so later operations silently run per group. For example, a mutate(share = sales / sum(sales)) meant to compute share of grand total would compute share within each group instead. Calling ungroup() after grouped work, or using .groups = 'drop' in summarise() or the .by argument for one-off grouping, prevents these subtle bugs in long pipelines.
They are filtering joins: they keep rows of the left table based on matches in the right table but add no columns. semi_join() keeps rows that have a match, and anti_join() keeps rows that have no match. For example, anti_join(customers, orders, by = 'customer_id') lists customers who never ordered. They are also safer than inner joins for filtering, since they never duplicate rows when the right table has repeated keys.
06
What is the difference between geom_bar() and geom_col()?
geom_bar() counts rows for each x value by default using stat = 'count', so you give only x, for example the number of orders per city from raw data. geom_col() uses y values as they are, so you supply already summarised data, for example total sales per city. geom_bar(stat = 'identity') is equivalent to geom_col(). Using geom_bar() with a y aesthetic gives an error, which is a common beginner issue.
A Type I error is rejecting a true null hypothesis, a false positive, and its probability is the significance level alpha, usually 0.05. A Type II error is failing to reject a false null hypothesis, a false negative, with probability beta; power is 1 - beta. For example, launching a feature that does not actually help is a Type I error, while dropping a feature that really works is Type II. Larger samples reduce Type II errors.
08
You notice database passwords hardcoded in a shared R script. What do you do?
I remove them immediately, inform the owner and ask for the password to be rotated, since it may exist in version history. Then I store credentials outside the code, in a user-level .Renviron file read with Sys.getenv(), the keyring package backed by the operating system's credential store, or the server's secret management, such as environment variables in Posit Connect. I make sure .Renviron is listed in .gitignore and scan the repository history.
09
What is the multiple testing problem and how do you correct for it?
When you run many hypothesis tests, the chance of at least one false positive rises sharply. With 20 independent tests at alpha 0.05, it is about 64 percent. Corrections adjust p-values: Bonferroni multiplies by the number of tests and is conservative, Holm is a less strict step-down version, and Benjamini-Hochberg controls the false discovery rate. In R, p.adjust(pvals, method = 'BH') applies them, which is common when testing many metrics or segments.
10
How do you apply the same transformation to many columns in dplyr?
across() applies one or more functions to a set of columns selected with tidyselect helpers.
df %>%
mutate(across(where(is.character), str_trim)) %>%
mutate(across(starts_with('amt_'), ~ round(.x, 2)))
df %>%
group_by(region) %>%
summarise(across(c(sales, profit),
list(mean = mean, max = max),
.names = '{.col}_{.fn}'))
Situation: regional sales managers waited for a weekly emailed PDF and could not drill into their own data. Task: give them self-service access. Action: I built a Shiny app with filters by region, product and period, used pre-aggregated tables for speed and deployed it on the internal server with login. I ran a short demo and gathered feedback. Result: over 40 managers used it weekly, and ad hoc data requests to our team fell by about half.
12
How do you reshape data between wide and long formats in R?
If we repeated the sampling many times and built an interval each time, about 95 percent of those intervals would contain the true population value. It does not mean there is a 95 percent probability that this specific interval contains it. A narrow interval shows precise estimation and a wide one shows uncertainty. For example, average order value of 850 INR with CI 820 to 880 is far more useful than CI 600 to 1100.
14
How do you explain technical results to non-technical managers?
I start with the business question and the answer in one sentence, then show one or two clear charts instead of tables of coefficients. For example, in a college project on customer churn, I said that customers with more than three complaints were twice as likely to leave, showed a simple bar chart and suggested a follow-up call process. I keep technical details in an appendix and invite questions so managers can decide confidently.
15
How do you use Reduce(), Filter() and Map() in base R?
An atomic vector holds elements of a single type, such as all numbers or all strings, while a list can hold elements of any type, including other lists, data frames or functions. c(1, 'a') coerces to character, but list(1, 'a', TRUE) keeps each type. Lists are used for nested data such as JSON responses and for returning multiple results from a function, which is why model objects like lm() output are lists.
17
You are building a fraud model where only 0.5 percent of transactions are fraud. How do you handle the imbalance?
Accuracy is useless here, since predicting no fraud gives 99.5 percent. I use stratified splits and evaluate with precision, recall, F1 and the precision-recall AUC. To help the model learn the minority class, I try class weights, downsampling the majority or SMOTE through the themis package in a recipe, applied only to training data. Then I tune the probability threshold based on the cost of missed fraud versus false alarms agreed with the business.
18
Finance says 120 transactions are missing from your report compared with their system. How do you find them?
I load both datasets and standardise the key, for example trimming spaces and matching data types for transaction_id. Then anti_join(finance, report, by = 'transaction_id') lists transactions in finance but not in my report, and the reverse anti_join shows extras. I examine the missing rows for patterns such as a date range, status or filter in my code. Usually the cause is a timezone cut-off or an excluded status.
19
Salary data has a few extreme values that distort averages. How do you handle them?
First I investigate whether they are data errors, such as an extra zero, or genuine high earners. I flag outliers with the IQR rule, values beyond Q1 - 1.5 IQR or Q3 + 1.5 IQR, or with percentiles. Errors I fix or remove with documentation. Genuine values I keep, but I report the median alongside the mean, or winsorize at the 1st and 99th percentiles for modelling. The choice depends on the business question.
20
Tell me about a time a model you built did not perform as expected after deployment.
Situation: a demand model I built performed well in testing but its errors doubled two months after launch. Task: diagnose and fix it. Action: I compared input distributions and found a new product category and a pricing change that the training data never saw. I added drift monitoring, retrained with recent data and set up monthly retraining. Result: accuracy returned to target, and I learned to plan monitoring before deployment, not after.
21
Your team wants to share a Shiny app with 200 internal users. What deployment options exist?
Options include shinyapps.io, a hosted service that is quickest to start but may not suit sensitive internal data, Posit Connect, a commercial on-premise or cloud server with authentication, scheduling and scaling, the free open-source Shiny Server on a Linux machine, and a Docker container behind a reverse proxy like Nginx, often with ShinyProxy for authentication. For internal data, I would choose Connect or containers inside the company network with single sign-on.
22
Why should we hire you as a fresher for an R analyst role?
I have practical R skills, not just theory. In my projects I cleaned real datasets with dplyr, built ggplot2 dashboards and ran regression and hypothesis tests, and I can explain results simply. I also know SQL, which most analytics work needs. I learn quickly, accept feedback well and care about accuracy, so I double-check numbers before sharing them. I am ready to start contributing to reporting tasks from the first month.
data.table is a high-performance package for large tabular data. Its syntax DT[i, j, by] means filter rows with i, compute j, grouped by by. It updates columns by reference with :=, avoiding copies, and offers fast keyed joins and fread()/fwrite() for file IO. For example, DT[city == 'Delhi', .(avg_sal = mean(salary)), by = dept] filters and aggregates in one step. It is popular for datasets with tens of millions of rows.
Base R stores dates as the Date class, counting days since 1970-01-01, and date-times as POSIXct, counting seconds. as.Date('2026-03-15') parses ISO strings and format() controls output. The lubridate package simplifies parsing with ymd(), dmy() and mdy(), extracting parts with month() and wday(), and arithmetic like date + months(1). Time zones matter: Indian data usually uses 'Asia/Kolkata', and mixing UTC with IST can shift records across days.
25
Why should R projects use Git and how does RStudio support it?
Git tracks every change to code, lets you revert mistakes, work on branches and collaborate through pull requests and reviews. RStudio has a built-in Git pane to stage, commit, diff, pull and push, and usethis::use_git() and use_github() set up repositories. Keep data files, secrets and outputs out of Git with .gitignore, commit the renv.lock file and write clear commit messages. Version control is expected even for analysis work.
26
A loop that adds rows to a data frame with rbind() takes very long. How do you speed it up?
Calling rbind() inside a loop copies the growing data frame each iteration, so time grows roughly quadratically. I instead store each piece in a preallocated list, results[[i]] <- piece, and combine once at the end with dplyr::bind_rows() or data.table::rbindlist(), which is the fastest. Better still is to vectorize the computation or use purrr::map() followed by list_rbind(). On 10,000 iterations this can cut runtime from minutes to seconds.
switch() selects one of several alternatives based on a value, which is cleaner than a long chain of if-else statements. With a character input, it matches names: switch(type, mean = mean(x), median = median(x), stop('Unknown type')). The final unnamed argument acts as the default. Empty arguments fall through to the next value, so switch(x, a = , b = 'AB') returns 'AB' for both. It is not vectorized, so use it for single values.
t.test() handles one-sample, two-sample and paired tests. Welch's test, which does not assume equal variances, is the default.
# two independent groups
t.test(score ~ batch, data = students)
# paired: before vs after training
t.test(after, before, paired = TRUE)
# one-sample against a target of 30 minutes
t.test(delivery_time, mu = 30, alternative = 'greater')
res <- t.test(score ~ batch, data = students)
res$p.value; res$conf.int
tidymodels is a collection of packages for modelling with tidyverse principles: rsample for splitting and resampling, recipes for preprocessing, parsnip for a unified model interface, workflows to bundle them, tune for hyperparameter tuning and yardstick for metrics. caret, by the same original author, is an older single package that does similar work with one train() function. caret is stable and still widely used, but new development happens in tidymodels.
The forecast package provides auto.arima(), ets() for exponential smoothing and easy plotting of forecasts with intervals. The newer tidyverts family, with tsibble for time-series data frames, fable for models and feasts for features and decomposition, works with tidy data and fits many series at once. prophet handles strong seasonality and holidays. Typical steps are visualizing, decomposing trend and seasonality, fitting candidates and comparing accuracy on a holdout period.
33
Your R script works on your laptop but fails on a colleague's machine with 'could not find function'. What do you check?
First I check that the package providing the function is installed and loaded with library() at the top of the script, not only in my interactive session. Then I compare R and package versions using sessionInfo(), because functions get renamed or deprecated. To prevent this, I use renv to snapshot exact package versions into a lockfile, so the colleague runs renv::restore() and gets the same environment. Namespacing calls like dplyr::filter() also avoids masking conflicts.
34
What does the ... (dots) argument do in an R function?
The dots let a function accept any number of additional arguments and pass them on to another function. For example, my_plot <- function(df, ...) ggplot(df, aes(x, y)) + geom_point(...) lets callers pass colour or size without declaring them. You can capture dots with list(...) or count them with ...length(). The downside is that misspelled argument names are silently ignored, so document them and validate with rlang::check_dots_used() in packages.
35
What is the difference between Pearson and Spearman correlation?
Pearson correlation measures the strength of a linear relationship between two numeric variables and is sensitive to outliers. Spearman correlation is computed on ranks, so it measures monotonic relationships and is robust to outliers and non-normal data. In R, cor(x, y, method = 'spearman') and cor.test() compute them. For example, ad spend and sales with diminishing returns may show a moderate Pearson value but a high Spearman value.
Which companies hire R Programming professionals in Coimbatore?
Companies with large offices in Coimbatore include many IT services and product firms. Use their company pages below to practise employer-specific sets.
Are R Programming interviews in Coimbatore different from other cities?
The questions depend more on the company than the city. Coimbatore's mix of employers decides the style: Many roles are with delivery centres of bigger IT firms
How do I find R Programming jobs in Coimbatore?
Shortlist companies with Coimbatore offices, keep your CV focused on R Programming projects, apply on company career pages and job portals with the Coimbatore filter, and practise the questions on this page before each interview.