36 practice questions with answers for Data Science interviews in Kochi.
Data Science jobs in Kochi
Kochi's Infopark and SmartCity host IT-services firms, product companies and start-ups, making it Kerala's largest tech job market along with Thiruvananthapuram. Testing and data roles are common in its service and product teams.
Below are 36 questions that match the mix of service, product and domain employers hiring data scientists in Kochi.
Solved for KochiStart 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.
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function.
WITH d AS (
SELECT DISTINCT user_id, CAST(login_at AS DATE) AS day
FROM logins
),
g AS (
SELECT user_id, day,
day - CAST(ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY day) AS INT) AS grp
FROM d
)
SELECT DISTINCT user_id
FROM g
GROUP BY user_id, grp
HAVING COUNT(*) >= 3;
-- date minus row number is constant within a streak (PostgreSQL syntax)
06
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.
Data augmentation creates new training examples by applying realistic changes to existing ones. For images this means flips, rotations, crops and brightness changes. For text it can mean synonym replacement, back-translation or random word dropping. For audio, adding noise or shifting pitch. It improves generalisation when data is limited. Changes must keep the label correct; flipping a digit 6 can turn it into a 9.
Situation: we had to classify 50,000 support tickets into 12 categories with only 600 labelled. Task: reach usable accuracy in a month. Action: I used a pretrained sentence embedding model with logistic regression, then active learning to pick the most uncertain tickets for agents to label in short daily batches. Result: with 2,000 labels we reached 86 percent macro F1. I learned that smart labelling beats waiting for perfect data.
10
What is the difference between an epoch, a batch and an iteration?
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.
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.
15
Write NumPy code to compute the Dice coefficient between a predicted and a true binary mask.
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak.
18
Users say your internal chatbot gives outdated policy answers. What is the likely cause and fix?
The knowledge index probably still holds old document versions, or the model is answering from its training data instead of retrieved context. Fix the ingestion pipeline to re-index on document change and remove superseded versions. Store effective dates in metadata and filter or boost the latest. Instruct the model to answer only from provided context and show the source with its date, so users can verify it.
19
You are building defect detection for a factory line where only 1 in 1,000 images shows a defect. How do you approach it?
With so few defects, a plain classifier will learn to say no defect. Collect every defect image possible and oversample them or use class-weighted or focal loss. Consider anomaly detection trained only on good parts, which flags anything unusual. Use augmentation that mimics real variation in lighting and position. Evaluate with recall at a fixed false alarm rate, since missing a defect usually costs far more than a manual recheck.
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability.
Recursive feature elimination trains a model, ranks features by importance or coefficient size, removes the weakest ones, and repeats until the desired number remains. RFECV picks the number of features using cross-validation. It considers features together rather than one at a time. The downsides are high compute cost on large data and unstable results when features are correlated, so check stability across folds.
22
How do you use groupby with multiple aggregations?
Use filter methods (correlation, chi-square), wrapper methods (RFE), embedded methods (Lasso, tree importance) and domain knowledge, validating each choice with cross-validation.
26
Your LLM feature costs far more than planned. How do you reduce cost without hurting quality?
Measure cost per request and find the biggest token users. Shorten system prompts and retrieved context, and cap output length. Route simple requests to a smaller, cheaper model and keep the large model for hard ones. Cache repeated answers and use provider prompt caching for fixed prefixes. Batch offline jobs. Consider fine-tuning a small model for a high-volume narrow task. Check every change against the evaluation set.
27
Your SQL result does not match the number on the official dashboard. How do you resolve it?
I would first align definitions: date range, time zone, filters like test users or cancelled orders, and whether the metric counts users or events. Then compare at a smaller grain, by day or by city, to find where the gap starts. I would read the dashboard's underlying query and check data refresh times. Once found, I would document the agreed definition so the same mismatch does not repeat.
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data.
29
What are lambda functions and where are they useful?
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.
Accuracy, F1 and confusion matrices for classification, BLEU or ROUGE for generation and summarisation, perplexity for language models, plus human review.
As the number of independent trials grows, the sample average converges to the true expected value, which is why larger samples give more stable estimates.
33
A query using NOT IN returns zero rows even though matches should exist. What is the likely cause, and how do NULLs behave in SQL?
NULL means unknown, so any comparison with NULL, even NULL = NULL, gives unknown and the row is filtered out. Use IS NULL or IS NOT NULL instead. Aggregates like SUM, AVG and COUNT(column) skip NULLs, so AVG may be computed over fewer rows than you expect. NOT IN with a subquery that contains a NULL returns no rows. COALESCE replaces NULLs with a default value.
34
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.
35
Write Python code to count word frequencies in a text and print the top 5 words.
from collections import Counter
import re
def top_words(text, n=5):
words = re.findall(r'[a-z]+', text.lower())
return Counter(words).most_common(n)
print(top_words('Data science is fun and data is everywhere'))
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features.
Which companies hire Data Science professionals in Kochi?
Companies with large offices in Kochi include EY, UST, Grant Thornton Bharat. Use their company pages below to practise employer-specific sets.
Are Data Science interviews in Kochi different from other cities?
The questions depend more on the company than the city. Kochi's mix of employers decides the style: Testing and data roles are common in its service and product teams
How do I find Data Science jobs in Kochi?
Shortlist companies with Kochi offices, keep your CV focused on Data Science projects, apply on company career pages and job portals with the Kochi filter, and practise the questions on this page before each interview.