Skip to content

Data Science Interview Questions in Kochi

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.
3 questions free Unlock the rest in seconds
01

What are decorators in Python?

Save to ▾
Show answer
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.
02

Type I vs Type II error?

Save to ▾
Show answer
Type I = false positive (rejecting a true null), probability α. Type II = false negative (missing a real effect), probability β. Power = 1 − β.
03

How do you deal with high-cardinality categorical features?

Save to ▾
Show answer
Use target or frequency encoding with cross-validation, hashing, embeddings or grouping rare categories, instead of huge one-hot matrices.
04

Write Keras code for a small binary classifier on tabular data.

Save to ▾
Show answer
from tensorflow import keras model = keras.Sequential([ keras.layers.Input(shape=(X_train.shape[1],)), keras.layers.Dense(64, activation='relu'), keras.layers.Dropout(0.3), keras.layers.Dense(1, activation='sigmoid') ]) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['AUC']) model.fit(X_train, y_train, validation_split=0.2, epochs=20, batch_size=64)
05

Write SQL to find users who logged in on at least three consecutive days.

Save to ▾
Show answer
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?

Save to ▾
Show answer
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.
07

What is data augmentation?

Save to ▾
Show answer
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.
08

Explain train, validation and test sets.

Save to ▾
Show answer
Train fits the model, validation tunes hyperparameters and model choice, and the untouched test set gives a final unbiased estimate of performance.
09

Describe a project where you worked with very little labelled data.

Save to ▾
Show answer
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?

Save to ▾
Show answer
An epoch is one pass over the training data; a batch is the subset used for one update; an iteration is one weight update on a batch.
11

Why is cross-entropy preferred over MSE for classification in neural networks?

Save to ▾
Show answer
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.
12

What is stacking in ensemble learning?

Save to ▾
Show answer
Training a meta-model on the predictions of several base models, often using cross-validated predictions to avoid leakage.
13

Write a scikit-learn ColumnTransformer that preprocesses numeric and categorical columns.

Save to ▾
Show answer
from sklearn.compose import ColumnTransformer from sklearn.pipeline import make_pipeline from sklearn.impute import SimpleImputer from sklearn.preprocessing import StandardScaler, OneHotEncoder pre = ColumnTransformer([ ('num', make_pipeline(SimpleImputer(strategy='median'), StandardScaler()), num_cols), ('cat', make_pipeline(SimpleImputer(strategy='most_frequent'), OneHotEncoder(handle_unknown='ignore')), cat_cols) ]) model = make_pipeline(pre, LogisticRegression(max_iter=1000))
14

Your classifier scores 98 percent on validation, but Grad-CAM shows it focuses on a watermark rather than the object. What is happening?

Save to ▾
Show answer
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.

Save to ▾
Show answer
import numpy as np def dice(pred, true, eps=1e-7): pred = pred.astype(bool) true = true.astype(bool) inter = np.logical_and(pred, true).sum() return (2 * inter + eps) / (pred.sum() + true.sum() + eps) # Dice = 2|A and B| / (|A| + |B|); 1 means perfect overlap
16

Write Python code to compare revenue per user between two groups using Welch's t-test.

Save to ▾
Show answer
import numpy as np from scipy import stats ctrl = df.loc[df.variant == 'control', 'revenue'].to_numpy() treat = df.loc[df.variant == 'treatment', 'revenue'].to_numpy() t, p = stats.ttest_ind(treat, ctrl, equal_var=False) # Welch diff = treat.mean() - ctrl.mean() se = np.sqrt(treat.var(ddof=1) / len(treat) + ctrl.var(ddof=1) / len(ctrl)) print(f'diff={diff:.2f} 95% CI=({diff - 1.96*se:.2f}, {diff + 1.96*se:.2f}) p={p:.4f}')
17

Difference between a shallow copy and a deep copy?

Save to ▾
Show answer
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?

Save to ▾
Show answer
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?

Save to ▾
Show answer
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.
20

What is PCA and when do you use it?

Save to ▾
Show answer
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability.
21

What is recursive feature elimination?

Save to ▾
Show answer
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?

Save to ▾
Show answer
df.groupby('region').agg(total=('sales','sum'), avg=('sales','mean')) gives named aggregations per group in one pass.
23

How does the Gini impurity differ from entropy?

Save to ▾
Show answer
Both measure node impurity; Gini is cheaper to compute and entropy is slightly more sensitive to class balance, with similar trees in practice.
24

Write Python code that validates prediction requests with Pydantic before passing them to a model.

Save to ▾
Show answer
from pydantic import BaseModel, Field, ValidationError class LoanRequest(BaseModel): age: int = Field(ge=18, le=100) income: float = Field(gt=0) city: str = Field(min_length=2) def predict(payload: dict): try: req = LoanRequest(**payload) except ValidationError as e: return {'error': e.errors()} return {'score': float(model.predict_proba([[req.age, req.income]])[0, 1])}
25

How do you perform feature selection?

Save to ▾
Show answer
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?

Save to ▾
Show answer
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?

Save to ▾
Show answer
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.
28

Why is XGBoost so popular?

Save to ▾
Show answer
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?

Save to ▾
Show answer
Small anonymous one-line functions, handy as arguments to sort, map, filter or Pandas apply.
30

You must classify support messages into 40 categories, but some categories have only 20 examples. What do you do?

Save to ▾
Show answer
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.
31

What are common ways to evaluate NLP models?

Save to ▾
Show answer
Accuracy, F1 and confusion matrices for classification, BLEU or ROUGE for generation and summarisation, perplexity for language models, plus human review.
32

Explain the Law of Large Numbers.

Save to ▾
Show answer
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?

Save to ▾
Show answer
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?

Save to ▾
Show answer
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.

Save to ▾
Show answer
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'))
36

What is TF-IDF?

Save to ▾
Show answer
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.

Companies with offices in Kochi (3)

Few big employers listed in Kochi?

Many Kochi candidates also apply to teams in Bangalore and to remote or hybrid roles. Practise the Bangalore set as well.

Frequently asked questions

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.