Data Analyst interview questions
16 questions written for Data Analyst roles, plus the HR and behavioural questions you'll face everywhere. Each has a model answer and the follow-ups to expect.
52 questions
HRMotivationMediumYou studied mechanical engineering. Why do you want to move into IT?
Reported at TCS, Infosys, Wipro, Cognizant, Accenture, Capgemini
You studied mechanical engineering. Why do you want to move into IT?
Reported at TCS, Infosys, Wipro, Cognizant, Accenture, Capgemini
What they are checking: Whether the switch is a real interest backed by effort, or just a fallback.
Model answer
I enjoyed mechanical engineering, but the part I liked most was writing MATLAB and Python scripts to analyse our lab data. In my third year I automated our thermodynamics lab calculations, which saved my batch hours every week, and I realised I wanted to build software full time.
Since then I've completed [the NPTEL Python and DBMS courses], solved around 150 coding problems, and built a small inventory app for a local hardware shop using Python and SQLite.
My mechanical background also helps: I'm used to working with real-world constraints and data, which is useful in manufacturing and automotive client projects.
Tips
- Show what you have already done to make the switch.
- Turn your core branch into an advantage.
TechnicalDatabasesMediumWhen would you choose a SQL database and when a NoSQL database?
Reported at Amazon, Flipkart, Accenture
When would you choose a SQL database and when a NoSQL database?
Reported at Amazon, Flipkart, Accenture
What they are checking: Whether you understand trade-offs rather than trends.
Model answer
SQL databases (MySQL, PostgreSQL) store data in tables with a fixed schema and relationships, support joins, and give strong ACID guarantees. NoSQL databases (MongoDB, DynamoDB, Cassandra, Redis) use documents, key-value pairs or wide columns, have flexible schemas, and are built to scale horizontally.
Choose SQL when:
- Data is structured and related, such as orders, customers and payments.
- You need transactions that must be correct, such as transferring money.
- You need complex queries and reports with joins.
Choose NoSQL when:
- The schema changes often or varies per record, such as product catalogues with different attributes.
- You need huge scale with simple access patterns, such as a shopping cart or session store looked up by key.
- You need very fast reads of denormalised data.
Many real systems use both: PostgreSQL for orders and payments, Redis for caching, and a document store for the catalogue.
TechnicalDatabasesMediumWhat is normalisation? Explain 1NF, 2NF and 3NF.
Reported at TCS, Infosys, Wipro, Cognizant, Capgemini
What is normalisation? Explain 1NF, 2NF and 3NF.
Reported at TCS, Infosys, Wipro, Cognizant, Capgemini
What they are checking: DBMS fundamentals, very common in service-company interviews.
Model answer
Normalisation is organising tables to reduce duplicate data and avoid update problems.
- 1NF: every column holds a single value, with no lists or repeating groups. A "phones" column holding "98xxx, 99xxx" breaks 1NF; move phones to separate rows or a separate table.
- 2NF: 1NF, plus every non-key column depends on the whole primary key, not part of it. In a table keyed on (student_id, course_id), student_name depends only on student_id, so it belongs in a Students table.
- 3NF: 2NF, plus non-key columns depend only on the key, not on other non-key columns. If a Students table has department_id and department_name, department_name depends on department_id, so move it to a Departments table.
Without normalisation, renaming a department means updating thousands of rows, and missing one leaves the data inconsistent. In analytics systems, we sometimes denormalise on purpose to make reads faster.
Likely follow-ups
- What is BCNF?
- When would you denormalise?
TechnicalDatabasesEasyWhat is the difference between a primary key, a unique key and a foreign key?
Reported at TCS, Infosys, Wipro, Cognizant
What is the difference between a primary key, a unique key and a foreign key?
Reported at TCS, Infosys, Wipro, Cognizant
What they are checking: DBMS basics.
Model answer
- Primary key: uniquely identifies each row. It cannot be NULL and a table has only one, such as student_id.
- Unique key: values must be unique but, in most databases, it can contain NULL, and a table can have several, such as email or phone.
- Foreign key: a column that refers to the primary key of another table, enforcing the relationship. Enrollments.student_id refers to Students.student_id, so you cannot enrol a student who doesn't exist.
By default, a primary key also creates a clustered index in databases such as SQL Server and MySQL's InnoDB, which decides the physical order of rows.
TechnicalSQLEasyWrite a SQL query to find the second highest salary.
Reported at TCS, Infosys, Accenture, Deloitte, Amazon
Write a SQL query to find the second highest salary.
Reported at TCS, Infosys, Accenture, Deloitte, Amazon
What they are checking: The most-asked SQL question. They want a correct answer and awareness of ties and NULLs.
Model answer
Subquery approach:
SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);Window function approach, which generalises to the Nth highest:
SELECT DISTINCT salary
FROM (
SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
FROM employees
) ranked
WHERE rnk = 2;DENSE_RANK matters here: if two people share the top salary, RANK would skip 2 and return nothing. The first query returns NULL when there is no second salary, which is often what the interviewer wants.
Likely follow-ups
- Find the highest salary in each department.
- What is the difference between RANK and DENSE_RANK?
TechnicalSQLEasyWhat is the difference between WHERE and HAVING?
Reported at Deloitte, Accenture, TCS
What is the difference between WHERE and HAVING?
Reported at Deloitte, Accenture, TCS
What they are checking: Understanding of query execution order.
Model answer
WHERE filters rows before grouping; HAVING filters groups after GROUP BY. So WHERE cannot use aggregates like SUM or COUNT, and HAVING can.
SELECT city, SUM(amount) AS revenue
FROM orders
WHERE status = 'delivered' -- remove rows first
GROUP BY city
HAVING SUM(amount) > 100000; -- then remove groupsThe logical order is FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT. This is also why you can't use a SELECT alias inside WHERE in most databases.
TechnicalSQLEasyExplain the different types of SQL joins.
Reported at TCS, Infosys, Deloitte, Amazon
Explain the different types of SQL joins.
Reported at TCS, Infosys, Deloitte, Amazon
What they are checking: Fundamentals, usually followed by a question on what row counts a join returns.
Model answer
Using Customers and Orders:
- INNER JOIN: only customers who have orders, and only orders that have a matching customer.
- LEFT JOIN: all customers, with their orders if they exist; customers without orders get NULLs. Useful for "customers who never ordered": LEFT JOIN and WHERE orders.id IS NULL.
- RIGHT JOIN: all orders, with customer details where they exist. Rarely used; rewrite it as a LEFT JOIN.
- FULL OUTER JOIN: all rows from both, matched where possible.
- CROSS JOIN: every customer paired with every order; the row count is the product of both tables.
- SELF JOIN: a table joined to itself, such as employees to their managers in the same table.
A trap: joining on a non-unique key multiplies rows. If a customer has 3 orders and 2 addresses, joining all three tables gives 6 rows for that customer, and sums will be wrong.
TechnicalSQLMediumWhat is the difference between ROW_NUMBER, RANK and DENSE_RANK?
Reported at Amazon, Flipkart, Deloitte
What is the difference between ROW_NUMBER, RANK and DENSE_RANK?
Reported at Amazon, Flipkart, Deloitte
What they are checking: Window function fluency, needed for most analyst SQL rounds.
Model answer
All three number rows in a given order; they differ only in how they handle ties. For salaries 100, 90, 90, 80:
- ROW_NUMBER: 1, 2, 3, 4. Always unique; ties are broken arbitrarily.
- RANK: 1, 2, 2, 4. Ties share a rank, then a gap.
- DENSE_RANK: 1, 2, 2, 3. Ties share a rank, with no gap.
Top 3 earners in each department:
SELECT *
FROM (
SELECT name, department, salary,
DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS rnk
FROM employees
) t
WHERE rnk <= 3;Use ROW_NUMBER when you need exactly one row per group, such as removing duplicates or picking the latest record per user.
TechnicalData cleaningMediumHow do you handle missing data in a dataset?
Reported at Accenture, Deloitte, Amazon
How do you handle missing data in a dataset?
Reported at Accenture, Deloitte, Amazon
What they are checking: Judgement. There's no single answer; they want you to ask why the data is missing.
Model answer
First I find out how much is missing and why. Data missing at random can be handled differently from data missing for a reason; for example, income left blank more often by high earners.
Then I choose based on the situation:
- Drop rows if very few are affected and they're random.
- Drop the column if most of it is empty and it isn't critical.
- Fill with the median for skewed numbers, the mean for roughly normal ones, or the most common value for categories.
- Fill using related data, such as the median salary for the same job title and city.
- Add a "was missing" flag column, because missingness itself can be informative.
- Use forward fill for time series, such as carrying the last known stock price.
I always record what I did and compare results with and without the fix, so stakeholders know how much it affected the conclusions.
TechnicalExcelEasyWhat is the difference between VLOOKUP, INDEX-MATCH and XLOOKUP?
Reported at Deloitte, Accenture, Capgemini
What is the difference between VLOOKUP, INDEX-MATCH and XLOOKUP?
Reported at Deloitte, Accenture, Capgemini
What they are checking: Excel fluency, still central in many analyst roles.
Model answer
- VLOOKUP searches the first column of a range and returns a value from a column to the right. It can't look left, breaks if columns are inserted (because you give a column number), and defaults to approximate match unless the last argument is FALSE.
- INDEX-MATCH: MATCH finds the row position, INDEX returns the value from any column. It can look left and doesn't break when columns move.
- XLOOKUP (Excel 365 and 2021): =XLOOKUP(lookup_value, lookup_array, return_array, "Not found"). It looks in any direction, defaults to exact match, has a built-in "if not found" value, and can search from the bottom.
I use XLOOKUP when it's available, and INDEX-MATCH for files that need to work on older Excel versions.
TechnicalStatisticsEasyWhen would you report the median instead of the mean?
Reported at Amazon, Flipkart, Deloitte
When would you report the median instead of the mean?
Reported at Amazon, Flipkart, Deloitte
What they are checking: Statistical common sense.
Model answer
When the data is skewed or has outliers. The mean is pulled by extreme values; the median isn't.
Example: if nine people in a team earn ₹5 lakh and the founder earns ₹1 crore, the mean salary is about ₹14.5 lakh, which describes nobody. The median, ₹5 lakh, describes the typical person.
Order values, delivery times and incomes are usually right-skewed, so I report the median, often with the 90th percentile to show the tail. I use the mean when the data is roughly symmetric or when the total matters, such as average revenue per user used to forecast total revenue.
TechnicalStatisticsMediumExplain correlation versus causation with an example.
Reported at Amazon, Google, Flipkart
Explain correlation versus causation with an example.
Reported at Amazon, Google, Flipkart
What they are checking: Whether you will over-claim from data.
Model answer
Correlation means two things move together; causation means one actually causes the other.
Example: users who use the wishlist feature spend 3 times more. That doesn't prove the wishlist makes people spend more. Keen shoppers may simply be more likely to use every feature. This is a confounding variable: shopping intent drives both.
To show causation you need an experiment: randomly show the wishlist to half of new users and compare their spending. If that isn't possible, techniques such as comparing before and after with a control group (difference-in-differences) or matching similar users get closer, but I'd state the limitation clearly.
TechnicalExperimentationMediumHow would you design an A/B test for a new checkout button?
Reported at Amazon, Flipkart, Google, Microsoft
How would you design an A/B test for a new checkout button?
Reported at Amazon, Flipkart, Google, Microsoft
What they are checking: End-to-end experimental thinking.
Model answer
- Hypothesis: a bigger, green "Buy now" button will increase checkout completion.
- Primary metric: checkout conversion rate. Guardrail metrics: refund rate, page load time, average order value, to catch harmful side effects.
- Randomisation: split users (not sessions) randomly 50/50, so the same person always sees the same version.
- Sample size: calculate it before starting from the current conversion rate, the smallest lift worth detecting (say 2%), 95% confidence and 80% power.
- Duration: run whole weeks, usually at least two, to cover weekday and weekend behaviour.
- Analysis: check the split was actually 50/50, then test for significance. Don't stop early just because the result looks significant on day 3; peeking inflates false positives.
- Decision: ship if the primary metric improves significantly and no guardrail gets worse.
Likely follow-ups
- The result is significant but the lift is 0.1%. Ship it?
- What if mobile and desktop show opposite results?
TechnicalAnalysisMediumSales dropped 15% last month. How would you find out why?
Reported at Flipkart, Amazon, Deloitte
Sales dropped 15% last month. How would you find out why?
Reported at Flipkart, Amazon, Deloitte
What they are checking: Structured investigation instead of jumping to guesses.
Model answer
- Check the data first: is it a tracking bug, a missing data load or a change in definition? Many "drops" are pipeline problems.
- Check for expected causes: seasonality (compare with the same month last year), fewer days, a festival that moved, or a big sale in the previous month.
- Break revenue down: revenue = visitors × conversion rate × average order value. Find which factor moved.
- Segment the moving factor: by region, channel, device, product category, and new versus returning customers. A drop concentrated in one segment points to the cause.
- Look for internal changes: app releases, price changes, stock-outs, marketing budget cuts, payment failures.
- Look for external ones: competitor sales, news, regulation.
For example, if conversion fell only on Android after a release on the 10th, the next step is checking that release with the engineering team. I'd then quantify how much of the 15% each cause explains.
TechnicalAnalyticalHardDaily active users of our app fell 10% this week. What do you do?
Reported at Google, Amazon, Flipkart, Microsoft
Daily active users of our app fell 10% this week. What do you do?
Reported at Google, Amazon, Flipkart, Microsoft
What they are checking: The classic root-cause question: calm, structured, hypothesis-driven.
Model answer
- Clarify: is it a sudden drop or gradual? Is it 10% compared with last week or the same week last year? How is a daily active user defined, and did that change?
- Rule out data issues: logging changes, a broken analytics SDK in a new release, delayed data.
- Check external causes: holidays, exams, a competitor launch, an outage at a cloud provider or app store.
- Segment: platform (Android/iOS/web), app version, country or city, new versus existing users, acquisition channel. If the drop is only in the latest Android version, it's probably a bug or crash.
- Walk the user journey: did app opens drop (a notification or marketing issue), or do users open but fail somewhere (a login or loading problem)?
- Check internal changes in the window: releases, experiments, pricing, notification changes.
Then I'd form a hypothesis, confirm it with data (such as crash rates for that version), fix or roll back, and set up an alert so we catch it faster next time.
TechnicalMetricsMediumHow would you measure the success of a new "Buy Now, Pay Later" option at checkout?
Reported at Amazon, Flipkart, Google
How would you measure the success of a new "Buy Now, Pay Later" option at checkout?
Reported at Amazon, Flipkart, Google
What they are checking: Choosing a north star metric plus guardrails.
Model answer
Goal: increase completed purchases without increasing financial risk.
- Primary metric: checkout conversion rate for users who are shown the option, compared with a control group.
- Supporting metrics: share of orders using pay-later, average order value (it often rises), repeat purchase rate.
- Guardrail metrics: default and late-payment rate, return and cancellation rate on pay-later orders, customer support complaints, and the cost per transaction charged by the lending partner.
I'd run it as an A/B test and segment results by new and existing users and by order value, because pay-later may help mostly on high-value items like phones. Success would be a meaningful lift in conversion while defaults stay within the threshold agreed with the risk team.
HRIntroductionEasyTell me about yourself.
Tell me about yourself.
What they are checking: Can you give a short, structured story that connects your background to this job? It sets the agenda for the rest of the interview, so whatever you mention here becomes the next question.
Model answer
I'm [name], a final-year B.Tech Computer Science student at [college], graduating in 2026 with a CGPA of [8.1].
Over the last two years I have focused on backend development. My main project is a hostel complaint tracker built with Node.js and PostgreSQL that 400 students in my hostel now use. I also did a two-month internship at [company], where I wrote REST APIs and cut a slow report query from 9 seconds to under 1 second by adding the right indexes.
Outside class I solve problems on LeetCode, around 300 so far, and I coordinate our college coding club, where I run weekly contests for juniors.
I'm applying here because I want to work on systems that real users depend on, and this role gives me that from day one.
Tips
- Use present, past, future: who you are, what you have done, why this job.
- Keep it under 90 seconds. Mention only things you are happy to be questioned on.
- Do not repeat your resume line by line, and skip family details unless asked.
Likely follow-ups
- Tell me more about the complaint tracker. What was hardest?
- Why did you add indexes rather than caching?
HRSelf-awarenessEasyWhat are your strengths?
What are your strengths?
What they are checking: Whether you know what you are good at and can prove it with an example, rather than listing adjectives.
Model answer
My biggest strength is that I break unfamiliar problems into small pieces and keep going until they work.
In my second year our team had to build an attendance app using face recognition, and none of us had used OpenCV. I split the work into three parts: capturing images, training the model, and matching faces in real time. I took the matching part, read the documentation and two tutorials over a weekend, and had a working version in five days. We demoed it at the department expo and it marked attendance for a class of 60 with about 95% accuracy.
I'd bring the same habit here when I'm handed a codebase or tool I haven't used before.
Tips
- Pick one or two strengths that matter for the role.
- Every strength needs a short story with a result.
Likely follow-ups
- What would your teammates say is your strength?
- What did you do about the 5% the app got wrong?
HRSelf-awarenessMediumWhat is your greatest weakness?
What is your greatest weakness?
What they are checking: Honesty and self-improvement. They want a real weakness that will not stop you doing the job, plus what you are doing about it.
Model answer
I used to find it hard to say no when people asked for help, and I would take on more than I could finish.
In my third year I agreed to help with three club events in the same month as my mid-semester exams, and my marks in one subject dropped. Since then I have started keeping a simple weekly plan in Notion. Before I agree to something new I check it against what is already there, and if it does not fit I offer a smaller piece or a later date.
This semester I managed the coding club contest and my project deadlines without missing either. I still have to watch it, but I catch it much earlier now.
Tips
- Avoid fake weaknesses like "I'm a perfectionist" or "I work too hard".
- Never name a weakness that is core to the job, such as weak coding for a developer role.
- Spend most of the answer on what you changed.
Likely follow-ups
- Give me another weakness.
- How would you handle a manager who keeps adding work?
HRCareer goalsEasyWhere do you see yourself in five years?
Where do you see yourself in five years?
What they are checking: Whether your plans fit this company and whether you are likely to stay long enough to repay the training.
Model answer
In five years I want to be someone my team relies on for a whole area of the product, not just individual tasks.
For the first two years I want to get really good at the technology I'm assigned, earn a certification in it, and understand how our client's business works. After that I'd like to lead a small module, review juniors' code and talk directly with the client.
This company's training and the range of projects here make that path realistic, which is a big reason I applied.
Tips
- Show growth inside the company.
- Do not say you plan to leave for an MBA or a startup.
