Red Hat Data Science Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Red Hat hiring for Data Science roles
Red Hat is an open source software company, now part of IBM, known for Red Hat Enterprise Linux, OpenShift and Ansible. It provides enterprise Linux, hybrid cloud, container and automation platforms with subscription-based support. In India it has a large presence in Pune and Bengaluru, hiring software engineers, quality engineers, support engineers and consultants.
For Data Science roles, this Red Hat practice set focuses most on Machine Learning (5), Python for Data Science (5), SQL for Data Science (5), Statistics and Probability (4). It has 1 easy, 29 medium, 10 hard questions, so you can start easy and work up to the harder ones.
Company type
Product
Headquarters
Raleigh, North Carolina, USA
Main India offices
Pune, Bengaluru
Red Hat Data Science interview process
Online assessment or resume screening
Technical round 1 (Linux + programming)
Technical round 2 (domain or open source)
Hiring manager and HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for Red HatStart 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
Write scikit-learn code to calibrate a gradient boosting classifier's probabilities and check the result.
ANOVA, analysis of variance, tests whether three or more group means are equal. It compares variation between groups to variation within groups using an F statistic. For example, comparing average order value across four city tiers. A significant result says at least one mean differs but not which one, so you follow up with post-hoc tests like Tukey's HSD. It assumes independent samples, roughly normal residuals and similar variances.
03
Pandas: find the top 3 products by revenue in each region.
That period is a structural break, not normal behaviour, and letting a model learn from it raw will distort trend and seasonality. Options are to add an indicator feature so the model attributes the drop to the event, to replace the period with values from a counterfactual estimate, or to train only on data after the recovery if enough history exists. Compare options with backtests on recent normal periods and document the choice.
05
Your NLP classifier works well on English reviews but fails on Hinglish reviews. What do you do?
First measure the gap with a labelled Hinglish test set. Hinglish mixes scripts and spellings, so tokenisers built for English split it badly. I would try a multilingual or Indic model such as mBERT, XLM-R or IndicBERT, normalise common spellings, and add labelled Hinglish data, possibly with transliteration. Evaluate per language segment and monitor the language mix in production, because it changes over time.
06
A Pandas merge suddenly returns many more rows than the left table had. What happened?
The join key is probably not unique on the right side, so each left row matches several right rows and the result multiplies. Check with right['key'].duplicated().sum(). Other causes are null or blank keys matching each other after cleaning, or joining on the wrong column. Fix it by deduplicating or aggregating the right table first, and use merge(..., validate='many_to_one') so Pandas raises an error when the assumption breaks.
Start with a pretrained sentence embedding model plus a simple classifier, or fine-tune a small transformer with class weights. For the rare categories, try few-shot approaches such as SetFit or an LLM with examples in the prompt, and generate or collect more examples. Merge categories that are rarely distinguishable. Report per-class F1 rather than overall accuracy, and route low-confidence predictions to a human queue.
09
How do you check whether a variable is normally distributed?
Start visually with a histogram and a Q-Q plot; points close to the straight line suggest normality. Check skewness and kurtosis values. Then use a formal test such as Shapiro-Wilk for small samples or Anderson-Darling. Remember that with very large samples, tests flag tiny harmless deviations, so judge by the plots too. If data is skewed, consider a log transform or a non-parametric method.
10
Your GPU model-serving bill has doubled while traffic grew only 20 percent. How do you bring cost down?
Profile utilisation first; idle or under-filled GPUs are common. Enable dynamic batching so each GPU call handles several requests, right-size instance types and autoscale on queue depth rather than CPU. Reduce model cost with quantisation, distillation or a smaller model for easy requests. Cache repeated predictions, move non-urgent work to batch jobs on cheaper hardware, and track cost per thousand predictions as a standing metric.
11
What is a contrastive image-text model like CLIP, and how does it enable zero-shot classification?
CLIP trains an image encoder and a text encoder together on hundreds of millions of image-caption pairs, pulling matching pairs close in a shared embedding space and pushing mismatches apart. For zero-shot classification you embed prompts like 'a photo of a damaged parcel' for each class and pick the class whose text embedding is most similar to the image embedding. It works without task-specific training but may need fine-tuning for niche domains.
12
A deep network you built from scratch does not learn at all; the loss stays flat from the first epoch. Could weight initialisation be the reason?
If weights start too large, activations and gradients explode; if too small, they vanish, and training stalls. If all weights are equal, every neuron learns the same thing. Good schemes keep the variance of activations stable across layers: Xavier or Glorot initialisation for tanh and sigmoid, and He initialisation for ReLU. Frameworks use sensible defaults, but it matters when building custom layers or very deep networks.
13
Halfway through a test you discover a bug that broke the treatment for Android users. What do you do?
Stop or pause the affected part, fix the bug and restart the test with fresh data, since mixing broken and fixed periods biases results. Do not simply drop Android users from analysis afterwards, because that can break randomisation balance if the bug affected behaviour or logging. Document the incident, and add pre-launch checks such as running the variant through QA on every platform and monitoring guardrails in the first hours.
14
What should you log for a production prediction service?
For each request, log a request ID, timestamp, model version, input features or a hash of them, the prediction and score, and latency. Log errors and fallback use separately. Do not log raw personal data unless needed and allowed; mask it. Aggregate these logs into dashboards for traffic, latency percentiles, error rate and score distribution. Joining logged predictions with later outcomes gives the data for monitoring and retraining.
15
How does linear regression work and what are its assumptions?
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity.
16
Your deployed model gives different predictions than the same model in your notebook. Why?
Usually preprocessing differs between training and serving. Check that the same pipeline object was saved, not just the estimator, and that category order, missing value handling and scaling match. Compare library versions, feature types like strings versus integers, column order, and time zones in date features. Send the same few rows through both paths and compare features step by step to find the first mismatch.
17
Write Python code to calculate the sample size per group needed to detect a lift from 5 percent to 5.5 percent conversion.
import torch, torch.nn as nn
from torchvision import models
model = models.resnet18(weights=models.ResNet18_Weights.DEFAULT)
for p in model.parameters():
p.requires_grad = False # freeze backbone
model.fc = nn.Linear(model.fc.in_features, 5)
opt = torch.optim.AdamW(model.fc.parameters(), lr=1e-3)
loss_fn = nn.CrossEntropyLoss()
# train head first, then unfreeze later layers with a lower lr
19
What is the difference between a subquery and a correlated subquery?
A normal subquery runs once on its own and its result is used by the outer query, for example WHERE price > (SELECT AVG(price) FROM products). A correlated subquery refers to columns of the outer query, so it is logically evaluated once per outer row, for example comparing each product with its own category average. Correlated subqueries can be slow; joins or window functions are usually faster alternatives.
20
What is a sample ratio mismatch in an experiment and what do you do about it?
A sample ratio mismatch means the observed split between groups differs from the planned split, for example 52 to 48 instead of 50 to 50 with a large sample. A chi-square test on the counts confirms it. It usually signals a bug in assignment, redirects, bot filtering or logging, so the results cannot be trusted. Do not analyse the metric; find and fix the root cause and rerun the test.
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease.
22
Pandas: compute a 7-day rolling average of daily sales for each store.
Situation: I built a lead scoring model where only 3 percent of leads converted and labels came 60 days late. Task: deliver a useful ranking for the sales team. Action: I set up a clean time-based validation, engineered activity features, used gradient boosting with class weights and measured lift in the top decile. Result: the top 10 percent of scored leads converted 3.5 times better than average. The hardest part was building trust in the labels.
26
Write SQL to compute funnel conversion from visit to cart to purchase.
WITH steps AS (
SELECT user_id,
MAX(CASE WHEN event = 'visit' THEN 1 ELSE 0 END) AS visited,
MAX(CASE WHEN event = 'add_to_cart' THEN 1 ELSE 0 END) AS carted,
MAX(CASE WHEN event = 'purchase' THEN 1 ELSE 0 END) AS purchased
FROM events
WHERE event_date >= '2026-10-01'
GROUP BY user_id
)
SELECT SUM(visited) AS visits, SUM(carted) AS carts, SUM(purchased) AS buyers,
ROUND(100.0 * SUM(carted) / NULLIF(SUM(visited), 0), 1) AS visit_to_cart_pct,
ROUND(100.0 * SUM(purchased) / NULLIF(SUM(carted), 0), 1) AS cart_to_buy_pct
FROM steps;
27
Tell me about a computer vision project where data quality was the biggest challenge.
Situation: a shelf-detection model plateaued at low accuracy. Task: find out why and fix it. Action: I reviewed 500 errors and found that a third were labelling mistakes, with inconsistent boxes for partly hidden products. I rewrote the guidelines with visual examples, had a second annotator review hard images and relabelled the worst batch. Result: mAP rose by 9 points without changing the model, and labelling rework dropped sharply.
28
A customer asks why their loan application was rejected by your model. How do you respond?
I would give a clear, individual explanation, not a technical dump. Using SHAP or reason codes, I would list the top factors, such as high existing EMI burden or short credit history, and say what could improve the outcome. I would also check that the model does not rely on protected attributes or close proxies. For regulated lending, a human review path and documented reason codes are essential.
29
Write SQL to find customers who ordered in January 2026 but not in February 2026.
SELECT DISTINCT o.customer_id
FROM orders o
WHERE o.order_date >= '2026-01-01' AND o.order_date < '2026-02-01'
AND NOT EXISTS (
SELECT 1 FROM orders f
WHERE f.customer_id = o.customer_id
AND f.order_date >= '2026-02-01' AND f.order_date < '2026-03-01'
);
30
Write SQL to show each customer's first order date, last order date and the gap between them in days.
SELECT
customer_id,
MIN(order_date) AS first_order,
MAX(order_date) AS last_order,
MAX(order_date) - MIN(order_date) AS days_between,
COUNT(*) AS orders
FROM orders
GROUP BY customer_id
ORDER BY days_between DESC;
-- PostgreSQL: DATE minus DATE gives days; use DATEDIFF in other engines
31
Write Python code to find the top 3 most similar documents to a query using cosine similarity on embeddings.
Encoder-only models like BERT see the full input in both directions and are best for understanding tasks such as classification, NER and embeddings. Decoder-only models like GPT predict the next token using only past tokens, so they suit text generation and chat. Encoder-decoder models like T5 encode the input and then generate output, which fits translation and summarisation. Most modern LLMs are decoder-only because they scale well.
33
Write scikit-learn code to get precision, recall and a confusion matrix at a custom threshold of 0.3.
In backtesting you used the actual temperature for future days, which you will never know at forecast time. In production the model gets a weather forecast, which has its own error, so performance drops. This is a subtle form of leakage. Fix the backtest by using the weather forecast that was available on each forecast date, or lagged actuals, so offline results match what production can really achieve.
System: You classify support tickets for an e-commerce company. Categories: payment, delivery, refund, account, other. Rules: choose exactly one category; if unsure, choose other; do not invent details. Return JSON with fields category and reason, reason under 20 words. Then two short examples showing a ticket and the expected JSON. User: Ticket: {ticket_text}. Keep the template fixed and test it on 100 labelled tickets before rollout.
37
Tell me about a time your forecast was badly wrong. How did you handle it?
Situation: my weekly demand forecast under-predicted a category by 30 percent for a month. Task: explain the miss and stop it recurring. Action: I compared forecast and actuals by region and found a new distribution channel had launched that the model knew nothing about. I told the planning team quickly, added channel as a feature and set up a weekly error review. Result: error returned to normal and planners trusted the alerts.
38
What are heterogeneous treatment effects, and what are the risks of slicing results by segment?
Heterogeneous treatment effects mean the change helps some segments more than others, for example new users but not repeat users. Finding them can guide targeting. The risk is that slicing by many segments creates false discoveries, and each segment has less power, so differences may be noise. Pre-register key segments, correct for multiple comparisons, and validate any surprising segment effect in a follow-up test before acting on it.
39
Tell me about a feature you engineered that significantly improved a model.
Situation: our delivery time model kept underestimating late-night orders. Task: reduce large errors. Action: I noticed restaurant prep time depended on how busy the kitchen was, so I built a feature for active orders at that restaurant in the last 30 minutes, computed point in time. Result: MAE dropped by 14 percent and late-night errors fell the most. It taught me to study the worst errors before adding generic features.
40
Write SQL to calculate month-over-month revenue growth.
WITH monthly AS (
SELECT DATE_TRUNC('month', order_date) AS month, SUM(amount) AS revenue
FROM orders
GROUP BY 1
)
SELECT month, revenue,
LAG(revenue) OVER (ORDER BY month) AS prev_revenue,
ROUND(100.0 * (revenue - LAG(revenue) OVER (ORDER BY month))
/ NULLIF(LAG(revenue) OVER (ORDER BY month), 0), 2) AS mom_pct
FROM monthly;
Tips to crack the Red Hat Data Science interview
Get comfortable with Linux commands, shell scripting, processes, permissions and networking, which are central to many Red Hat roles.
Contribute to an open source project or show GitHub work, since Red Hat values public collaboration and community involvement.
Learn the basics of containers, Kubernetes and Ansible, and consider Red Hat certifications such as RHCSA for support roles.
Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
Practise the hard questions on this page aloud; Red Hat interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Red Hat Data Science interview?
Candidates usually go through 4 stages: Online assessment or resume screening; Technical round 1 (Linux + programming); Technical round 2 (domain or open source); Hiring manager and HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.
Which topics should I prepare for the Red Hat Data Science interview?
This practice set leans on Machine Learning (5), Python for Data Science (5), SQL for Data Science (5), Statistics and Probability (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Red Hat interviewers ask you to walk through real work.
Are these the exact questions asked at Red Hat?
No. These are curated practice questions that match the skills and difficulty usually tested in product interviews like Red Hat's. They are not a leaked or verified list of past questions.
Where does Red Hat hire Data Science professionals in India?
Red Hat has large teams in Pune, Bengaluru. Openings and locations change often, so check the Red Hat careers page and filter by city and experience.