Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About CGI hiring for Data Science roles
CGI is a Canadian IT and business consulting services company providing systems integration, managed services, and software solutions. Its India global delivery centres support clients in government, banking, utilities and manufacturing. It hires in India for software engineers, test engineers, data analysts and support engineers.
For Data Science roles, this CGI practice set focuses most on Python for Data Science (6), Deep Learning and NLP (5), Statistics and Probability (5), Time Series & Forecasting (4). It has 21 easy, 19 medium questions, so you can start easy and work up to the harder ones.
Company type
IT services
Headquarters
Montreal, Canada
Main India offices
Bengaluru, Hyderabad, Chennai, Mumbai
CGI Data Science interview process
Online assessment (aptitude + technical)
Technical interview
Managerial round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for CGIStart 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.
Bootstrapping estimates the uncertainty of a statistic by resampling your data with replacement many times, computing the statistic on each resample, and looking at the spread of results. It gives confidence intervals for things with no simple formula, like the median, a ratio or a model metric such as AUC. It needs no normality assumption, but it relies on the sample being representative and can be slow on very large data.
Pooling downsamples a feature map by summarising small regions. Max pooling keeps the largest value in each window, such as 2x2, and average pooling keeps the mean. It reduces computation, enlarges the receptive field of later layers and gives a little tolerance to small shifts. Many modern networks replace pooling with strided convolutions, but global average pooling before the classifier head is still very common.
04
What is the difference between a Pandas Series and a DataFrame?
A Series is a one-dimensional labelled array: one column of values with an index. A DataFrame is a two-dimensional table made of several Series that share the same index, and each column can have its own dtype. Selecting one column, like df['price'], gives you a Series. Selecting with a list, like df[['price']], gives you a DataFrame. Many methods work on both, but the output shape is different.
05
Your test shows a 2 percent lift in conversion, but revenue per user went down. What do you do?
Do not ship on conversion alone. Check whether the change shifted buyers to cheaper items, increased discount usage or pulled in low-value orders. Break down revenue into conversion times average order value, look at item mix, and confirm the revenue drop is statistically meaningful rather than noise. Then go back to the agreed primary metric and guardrails; if revenue is the business goal, it should guide the decision.
A measure of asymmetry. Right-skewed data has a long tail on the right (mean greater than median); left-skewed is the opposite. Log transforms often reduce right skew.
07
Your classifier scores 98 percent on validation, but Grad-CAM shows it focuses on a watermark rather than the object. What is happening?
The model has learned a shortcut: the watermark correlates with the label in your dataset, perhaps because images of one class came from a single source. It will fail when that correlation breaks. Remove or crop the watermarks, rebalance sources across classes, and create a validation set from different sources. Keep using saliency maps and slice-based evaluation to catch other spurious cues such as backgrounds or text.
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations.
09
Pandas: convert wide monthly columns into a long format table.
A prediction interval gives a range in which a future value is expected to fall with a stated probability, such as 80 or 95 percent. A point forecast of 1,000 units means little without knowing whether the realistic range is 950 to 1,050 or 400 to 1,600. Planners use the interval to set safety stock and staffing. Intervals widen with the horizon because uncertainty accumulates over time.
The model memorises noise and fails on new data. Prevent it with more data, simpler models, regularisation, cross-validation, early stopping and dropout.
12
How do you deal with high-cardinality categorical features?
SELECT DATE_TRUNC('month', order_date) AS month,
SUM(CASE WHEN status = 'delivered' THEN 1 ELSE 0 END) AS delivered,
SUM(CASE WHEN status = 'cancelled' THEN 1 ELSE 0 END) AS cancelled,
SUM(CASE WHEN status = 'returned' THEN 1 ELSE 0 END) AS returned
FROM orders
GROUP BY 1
ORDER BY 1;
Quantisation stores model weights in lower precision, such as 8-bit or 4-bit integers instead of 16-bit floats. A 7-billion parameter model drops from about 14 GB to around 4 GB at 4-bit, so it fits on smaller GPUs or even laptops and runs faster. The cost is some loss in quality, usually small at 8-bit and noticeable on hard tasks at very low bits. Common formats include GPTQ, AWQ and GGUF.
15
Your A/B test shows a significant lift after 2 days. The product team wants to ship now. What do you say?
I would ask them to wait for the planned duration. Checking early and stopping on the first significant result, called peeking, inflates false positives. Two days also misses weekly patterns and novelty effects, where users click a new feature just because it is new. If speed matters, we can use a sequential testing method designed for early stopping. Otherwise we run the full sample size calculated before launch.
A system prompt is the instruction message placed before user messages that sets the model's role, tone, rules and output format, for example 'You are a support assistant; answer only from the provided policy and reply in JSON'. It shapes every response in the conversation. Keep it clear and specific, version it like code, and do not rely on it alone for security, since users can try to override it through prompt injection.
map works element-wise on a Series, apply works on a Series or along a DataFrame axis, and applymap (now DataFrame.map) applies a function to every cell.
Convolution filters slide over the input to detect local patterns, pooling reduces size, and deeper layers combine edges into shapes and objects. Used mainly for images.
*args collects extra positional arguments into a tuple; **kwargs collects extra keyword arguments into a dict. They make function signatures flexible and are common in wrappers and decorators.
23
How do you make a machine learning experiment reproducible?
Version the code with Git, the data with a tool like DVC or dated snapshots, and the environment with pinned requirements or Docker. Set random seeds for every library. Log parameters, metrics and the exact data version for each run with a tracker like MLflow. Keep preprocessing inside a pipeline rather than manual notebook steps. Then anyone should be able to rebuild the same model from a commit and a data version.
24
What is the difference between mean, median and mode?
model.train()
for X, y in train_loader:
X, y = X.to(device), y.to(device)
optimizer.zero_grad()
logits = model(X)
loss = loss_fn(logits, y)
loss.backward()
optimizer.step()
# evaluation
model.eval()
with torch.no_grad():
val_loss = sum(loss_fn(model(Xv.to(device)), yv.to(device)).item() for Xv, yv in val_loader)
26
Your fraud model has 99 percent accuracy, but the business says it catches almost no fraud. Why?
If only 1 percent of transactions are fraud, a model that predicts not fraud for everything is 99 percent accurate and useless. Accuracy hides the minority class. I would check the confusion matrix, recall on fraud cases and precision-recall AUC. Then fix it with class weights, resampling or a lower decision threshold, and choose the threshold based on the cost of missed fraud versus false alerts.
27
What is the difference between zero-shot and few-shot prompting?
In zero-shot prompting you give only instructions, like classify this review as positive or negative. In few-shot prompting you also include a few worked examples of input and correct output, which shows the model the format and decision boundary. Few-shot usually improves consistency on custom labels, at the cost of more tokens. Pick examples that cover tricky cases and keep their format identical to what you want back.
28
Write Pandas code to create useful features from a datetime column.
MAPE is the mean of absolute errors divided by actual values, expressed as a percentage. It is easy to explain to business teams, but it breaks when actuals are zero or near zero, because the percentage explodes. It also penalises over-forecasts more than under-forecasts and weights small items heavily. For intermittent or low-volume series prefer MAE, weighted MAPE or MASE, which compares error to a naive baseline.
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix.
31
Why do you apply a log transform to some features?
A log transform compresses large values and spreads small ones, which reduces right skew in features like income, price or page views. This helps linear models and distance-based models that are sensitive to scale and outliers. Use log1p, which is log of 1 plus x, when the feature has zeros. For negative values, a Yeo-Johnson transform works. Tree models generally do not need it.
32
Why is cross-entropy preferred over MSE for classification in neural networks?
Cross-entropy measures how far predicted probabilities are from the true class and strongly penalises confident wrong predictions. With a softmax or sigmoid output, it gives large, useful gradients when the model is wrong. MSE with sigmoid outputs gives very small gradients when predictions saturate, so learning slows down. Use binary cross-entropy for two classes, categorical cross-entropy for many classes, and MSE for regression targets.
33
What is the difference between supervised and unsupervised learning?
Supervised learning trains on labelled data to predict a target; unsupervised learning finds structure such as clusters or components in unlabelled data.
34
What are the novelty effect and the primacy effect in A/B tests?
The novelty effect is when users engage more with a change simply because it is new, so early results overstate the long-term lift. The primacy effect is the opposite: existing users resist change at first, so early results understate it. Both fade with time. To detect them, plot the treatment effect by day and by user tenure, compare new users with existing users, and run the test long enough for behaviour to settle.
The receptive field is the region of the input image that can influence one activation. Early layers see small patches like edges, and deeper layers see larger regions, enabling recognition of whole objects. It grows with kernel size, depth, stride and pooling, and dilated convolutions increase it without extra parameters. If the receptive field is smaller than the objects you care about, the network cannot capture their full context.
36
Your daily sales forecast badly misses the Diwali spike every year. How do you fix it?
The model is treating Diwali as noise because the festival moves on the calendar and a fixed yearly seasonality does not align. Add explicit holiday features: a flag for Diwali and a few days before and after, since buying starts early. Include other regional festivals and sale events too. Models like Prophet or gradient boosting with holiday features handle this well. Then backtest specifically on past festive periods to confirm the fix.
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 the control group and treatment group in an A/B test?
The control group sees the current experience, and the treatment group sees the change being tested, such as a new checkout button. Users are randomly assigned, so the only systematic difference between groups is the change itself. Any difference in metrics beyond random noise can then be attributed to the treatment. Without a proper control, you cannot separate the effect of your change from seasonality, marketing or other launches.
39
Write Python code using Hugging Face transformers to run sentiment analysis on a list of reviews.
from transformers import pipeline
clf = pipeline(
'sentiment-analysis',
model='distilbert-base-uncased-finetuned-sst-2-english'
)
reviews = ['Delivery was fast and the product is great',
'Packaging was damaged and support did not reply']
for text, out in zip(reviews, clf(reviews, batch_size=16)):
print(out['label'], round(out['score'], 3), '-', text)
40
What is the difference between COUNT(*), COUNT(column) and COUNT(DISTINCT column)?
COUNT(*) counts all rows, including rows with NULLs. COUNT(column) counts only rows where that column is not NULL. COUNT(DISTINCT column) counts unique non-NULL values. For example, in an orders table, COUNT(*) is the number of orders, COUNT(coupon_code) is orders that used a coupon, and COUNT(DISTINCT customer_id) is the number of unique buyers. Mixing them up is a common reporting bug.
Tips to crack the CGI Data Science interview
Revise core programming, SQL and testing basics, as CGI roles often involve maintaining and testing enterprise systems.
Learn about CGI's member-ownership model, where employees are called members and can buy shares.
Prepare clear examples of teamwork and client communication, which are important in CGI's consulting culture.
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; CGI interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the CGI Data Science interview?
Candidates usually go through 4 stages: Online assessment (aptitude + technical); Technical interview; Managerial round; 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 CGI Data Science interview?
This practice set leans on Python for Data Science (6), Deep Learning and NLP (5), Statistics and Probability (5), Time Series & Forecasting (4). Revise those first, then practise explaining one or two of your own projects end to end, because most CGI interviewers ask you to walk through real work.
Are these the exact questions asked at CGI?
No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like CGI's. They are not a leaked or verified list of past questions.
Where does CGI hire Data Science professionals in India?
CGI has large teams in Bengaluru, Hyderabad, Chennai, Mumbai. Openings and locations change often, so check the CGI careers page and filter by city and experience.