Data Analyst

2000+ Data Analyst Interview Questions and Answers

Updated 5 Aug 2025
search-icon

Asked in Deloitte

2d ago

Q. Write code to calculate the number of people in a room at the end of the day, given that X people enter and Y people leave continuously throughout the day.

Ans.

Code to calculate number of people in a room at EOD given X enter and Y leave throughout the day.

  • Create a variable to keep track of the current number of people in the room

  • Increment the variable by X every time someone enters the room

  • Decrement the variable by Y every time someone leaves the room

  • Return the final value of the variable at the end of the day

  • Example: If 10 people enter and 5 leave, there will be 5 people in the room at EOD

Asked in DE Shaw

6d ago

Q. Chocolate Distribution Problem

You are given an array/list CHOCOLATES of size 'N', where each element represents the number of chocolates in a packet. Your task is to distribute these chocolates among 'M' stude...read more

Ans.

Distribute chocolates among students to minimize the difference between the largest and smallest number of chocolates.

  • Sort the array of chocolates packets in ascending order.

  • Iterate through the array and find the minimum difference between the chocolates in packets for each possible distribution to students.

  • Return the minimum difference as the result.

Data Analyst Interview Questions and Answers for Freshers

illustration image

Asked in MagicBricks

4d ago

Q. Ninja and Substrings Problem Statement

Ninja has to determine all the distinct substrings of size two that can be formed from a given string 'STR' comprising only lowercase alphabetic characters. These substrin...read more

Ans.

Find all unique contiguous substrings of size two from a given string.

  • Iterate through the string and extract substrings of size two

  • Use a set to store unique substrings

  • Return the set as an array of strings

Asked in Cognizant

4d ago

Q. Ninja and His Secret Information Encoding Problem

Ninja, a new member of the FBI, has acquired some 'SECRET_INFORMATION' that he needs to share with his team. To ensure security against hackers, Ninja decides t...read more

Ans.

The task is to encode and decode 'SECRET_INFORMATION' for security purposes and determine if the transmission was successful.

  • Read the number of test cases 'T'

  • For each test case, encode the 'SECRET_INFORMATION' and then decode it

  • Compare the decoded string with the original 'SECRET_INFORMATION'

  • Print 'Transmission successful' if they match, else print 'Transmission failed'

Are these interview questions helpful?

Asked in Amazon

2d ago

Q. Sliding Window Maximum Problem Statement

You are given an array/list of integers with length 'N'. A sliding window of size 'K' moves from the start to the end of the array. For each of the 'N'-'K'+1 possible wi...read more

Ans.

The problem involves finding the maximum element in each sliding window of size 'K' in an array of integers.

  • Iterate through the array and maintain a deque to store the indices of elements in the current window.

  • Remove indices from the deque that are outside the current window.

  • Keep the deque in decreasing order of element values to easily find the maximum element in each window.

2d ago

Q. Time to Burn Tree Problem

You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely burn th...read more

Ans.

Calculate the time in minutes required to completely burn a binary tree starting from a given node.

  • Traverse the tree to find the start node and calculate the time for fire to spread to all nodes.

  • Use a queue to keep track of nodes to be burned next.

  • Increment the time for each level of nodes burned.

  • Return the total time taken to burn the entire tree.

Data Analyst Jobs

SANOFI HEALTHCARE INDIA PRIVATE LIMITED logo
Analyst - Data & Process Management 3-5 years
SANOFI HEALTHCARE INDIA PRIVATE LIMITED
4.1
₹ 7 L/yr - ₹ 24 L/yr
(AmbitionBox estimate)
Hyderabad / Secunderabad
IBM logo
Data Analyst/Senior Data Analyst 3-8 years
IBM
3.9
₹ 5 L/yr - ₹ 9 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
American Express India logo
Analyst - Data Steward Delegate 2-3 years
American Express India
4.1
₹ 7 L/yr - ₹ 22 L/yr
(AmbitionBox estimate)
Gurgaon / Gurugram

Asked in Tredence

2d ago

Q. Find First Repeated Character in a String

Given a string 'STR' composed of lowercase English letters, identify the character that repeats first in terms of its initial occurrence.

Example:

Input:
STR = "abccba"...read more
Ans.

Find the first repeated character in a given string composed of lowercase English letters.

  • Iterate through the string and keep track of characters seen so far in a set.

  • Return the first character that is already in the set.

  • If no repeated character is found, return '%'.

Asked in Amazon

2d ago

Q. Pair Sum Problem Statement

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.

Note:

Each pa...read more

Ans.

Find pairs of elements in an array that sum up to a given value, sorted in a specific order.

  • Iterate through the array and use a hash set to store elements seen so far.

  • For each element, check if the complement (S - current element) is in the set.

  • If found, add the pair to the result list and continue.

  • Sort the result list based on the criteria mentioned in the problem statement.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
6d ago

Q. How can you prove to the client that students in higher classes are taller than those in lower classes?

Ans.

We can use statistical analysis to prove that students in higher classes are taller than those in lower classes.

  • Collect height data of students from different classes

  • Use statistical measures like mean, median, and mode to compare the heights of students in different classes

  • Perform hypothesis testing to determine if the difference in height between classes is statistically significant

  • Visualize the data using graphs and charts to make it easier for the client to understand

  • Provi...read more

Asked in Nagarro

3d ago

Q. Equilibrium Index Problem Statement

Given an array Arr consisting of N integers, your task is to find the equilibrium index of the array.

An index is considered as an equilibrium index if the sum of elements of...read more

Ans.

Find the equilibrium index of an array where sum of elements on left equals sum on right.

  • Iterate through the array and calculate prefix sum and suffix sum at each index.

  • Compare prefix sum and suffix sum to find equilibrium index.

  • Return the left-most equilibrium index or -1 if none found.

Asked in UnitedHealth

2d ago

Q. Reverse a Number Problem Statement

Ninja wants to find the reverse of a given number but needs your assistance.

Example:

Input:
T = 2
N = 10400
N = 12345
Output:
401
54321

Explanation:

If a number has trailing zer...read more

Ans.

Reverse a given number excluding trailing zeros.

  • Iterate through the digits of the number from right to left.

  • Skip any trailing zeros while reversing the number.

  • Handle the edge case where the number is 0 separately.

  • Convert the reversed digits back to a number for the final result.

Asked in ZS

1d ago

Q. Matrix Transpose Problem Statement

Given a matrix MAT, your task is to return the transpose of the matrix. The transpose of a matrix is obtained by converting rows into columns and vice versa. Specifically, the...read more

Ans.

Transpose a given matrix by switching rows and columns.

  • Iterate through the matrix and swap elements at [i][j] with [j][i].

  • Create a new matrix to store the transposed values.

  • Ensure the dimensions of the transposed matrix are reversed from the original matrix.

2d ago

Q. Ways To Make Coin Change

Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more

Ans.

The task is to find the total number of ways to make change for a specified value using given denominations.

  • Create a dynamic programming table to store the number of ways to make change for each value up to the specified value.

  • Iterate through each denomination and update the table accordingly.

  • The final answer will be the value in the table at the specified value.

  • Consider edge cases such as when the specified value is 0 or when there are no denominations provided.

3d ago

Q. Find the Third Greatest Element

Given an array 'ARR' of 'N' distinct integers, determine the third largest element in the array.

Input:

The first line contains a single integer 'T' representing the number of te...read more
Ans.

Find the third largest element in an array of distinct integers.

  • Sort the array in descending order

  • Return the element at index 2 as the third largest element

5d ago

Q. Find the Second Largest Element

Given an array or list of integers 'ARR', identify the second largest element in 'ARR'.

If a second largest element does not exist, return -1.

Example:

Input:
ARR = [2, 4, 5, 6, ...read more
Ans.

Find the second largest element in an array of integers.

  • Iterate through the array to find the largest and second largest elements.

  • Handle cases where all elements are identical.

  • Return -1 if a second largest element does not exist.

Asked in Deloitte

6d ago

Q. How do you find the minimum number from a given set of numbers?

Ans.

To find the minimum number from a set of numbers, compare each number with the others and select the smallest.

  • Compare each number with the others in the set

  • Select the smallest number as the minimum

6d ago
Q. Can you explain a complex joins problem related to database management systems (DBMS)?
Ans.

Explaining a complex joins problem in DBMS

  • Discussing the use of different types of joins like inner join, outer join, self join, etc.

  • Explaining how to handle null values and duplicates during joins

  • Demonstrating a scenario where multiple tables need to be joined based on different keys

Asked in Morningstar

4d ago

Q. What are the financial statements? How cost sheet of bank different from cost sheet of manufacturing company? What is debt to equity ratio? What is stock option? What is Stock split? What is lease financing? Na...

read more
Ans.

Financial statements, cost sheet, debt to equity ratio, stock option, stock split, lease financing, profitability ratios.

  • Financial statements are reports that show the financial performance of a company.

  • Cost sheet of a bank includes interest expenses and income, while cost sheet of a manufacturing company includes direct and indirect costs.

  • Debt to equity ratio is a financial ratio that shows the proportion of debt and equity used to finance a company's assets.

  • Stock option is ...read more

Asked in Cognizant

5d ago

Q. Nth Fibonacci Number Problem Statement

Calculate the Nth term in the Fibonacci sequence, where the sequence is defined as follows: F(n) = F(n-1) + F(n-2), with initial conditions F(1) = F(2) = 1.

Input:

The inp...read more
Ans.

Calculate the Nth Fibonacci number efficiently using dynamic programming.

  • Use dynamic programming to store and reuse previously calculated Fibonacci numbers.

  • Start with base cases F(1) and F(2) as 1, then calculate subsequent Fibonacci numbers.

  • Optimize the solution to avoid redundant calculations by storing intermediate results.

  • Ensure the implementation handles large values of N efficiently within the given constraints.

Asked in Samsung

1d ago

Q. How to Work with dynamic data, how to remove duplicate data or fix the data

Ans.

To work with dynamic data, remove duplicates and fix errors, use data cleaning techniques.

  • Use software tools like OpenRefine or Excel to clean data

  • Identify and remove duplicate data using unique identifiers

  • Fix errors by standardizing data formats and using regular expressions

  • Use data validation to ensure accuracy and completeness

  • Create a data cleaning plan and document all changes made

  • Test the cleaned data to ensure it meets the desired quality standards

Asked in Walmart

5d ago

Q. What are the different approaches you use for data cleaning?

Ans.

Different approaches for data cleaning include removing duplicates, handling missing values, correcting inconsistent data, and standardizing formats.

  • Remove duplicates

  • Handle missing values

  • Correct inconsistent data

  • Standardize formats

  • Use statistical methods to identify outliers

  • Check for data accuracy and completeness

  • Normalize data

  • Transform data types

  • Apply data validation rules

Asked in Innovaccer

1d ago

Q. What are your experiences with DDL?

Asked in S&P Global

5d ago

Q. 1) What Is IPO 2) Sides Of Balance Sheet 3) What Is Depreciation 4) Financial Statements

Ans.

Questions related to finance and accounting

  • IPO stands for Initial Public Offering, which is the first time a company's stock is offered to the public

  • Balance sheet has two sides - assets and liabilities & equity

  • Depreciation is the decrease in value of an asset over time due to wear and tear or obsolescence

  • Financial statements include income statement, balance sheet, and cash flow statement

Asked in Tredence

4d ago
Q. How much petrol is used in one day in your city?
Ans.

The amount of petrol used in a city in one day varies depending on factors like population, transportation infrastructure, and fuel prices.

  • Petrol usage depends on the number of vehicles in the city.

  • Public transportation options can impact petrol consumption.

  • Economic factors such as fuel prices and income levels play a role in petrol usage.

  • Industrial activities and power generation also contribute to petrol consumption.

  • Environmental policies and initiatives can influence petro...read more

Asked in IQVIA

5d ago

Q. You will be asked advanced SQL and Excel questions to assess your knowledge. The main part of the interview is the puzzle round, which will involve math puzzles.

Asked in Walmart

2d ago

Q. Sequence of Execution of SQL codes. Select - Where-from-Having- order by etc

Ans.

The sequence of execution of SQL codes is Select-From-Where-Group By-Having-Order By.

  • Select: choose the columns to display

  • From: specify the table(s) to retrieve data from

  • Where: filter the data based on conditions

  • Group By: group the data based on a column

  • Having: filter the grouped data based on conditions

  • Order By: sort the data based on a column

Asked in Bansal Group

2d ago

Q. Here’s an example of a negative result in Manufacturing & Production — useful for learning or explaining challenges faced: --- 🚫 Negative Result Example: "Faced a 10% production delay due to unexpected machine...

read more
Ans.

A machine breakdown led to production delays, prompting the implementation of improved maintenance protocols and monitoring systems.

  • Identified the root cause: unexpected machine breakdown due to lack of preventive maintenance.

  • Implemented a preventive maintenance schedule, reducing future breakdowns by 30%.

  • Introduced real-time monitoring systems to track machine performance and predict failures.

  • Conducted training sessions for staff on the importance of maintenance and monitori...read more

Asked in ZS

6d ago
Q. How many pizzas are sold in one day in Pune?
Ans.

The number of pizzas sold in Pune in one day varies depending on factors like day of the week, weather, events, etc.

  • The number of pizzas sold in Pune can range from hundreds to thousands in a day.

  • Factors like day of the week (weekend vs weekday), weather (rainy vs sunny), events (festivals, holidays) can impact the sales.

  • Popular pizza outlets in Pune like Domino's, Pizza Hut, etc. contribute to the overall sales.

  • Data from previous sales records, market research, and customer ...read more

Asked in Morningstar

4d ago

Q. What elements are present in all financial statements, such as the Balance Sheet, Income Statement, and Cash Flow statement?

Ans.

The financial statements (BS, IS, CF) have common elements such as assets, liabilities, equity, revenue, expenses, and cash flows.

  • Assets: resources owned by the company

  • Liabilities: obligations owed by the company

  • Equity: residual interest in the assets of the company

  • Revenue: income generated by the company

  • Expenses: costs incurred by the company

  • Cash flows: inflows and outflows of cash

Asked in Cognizant

3d ago

Q. 1. Bais and variance trade-off 2. How to handle Imbalanced data? 3. What is Multicollinearity and how do you handle it? 4. Explain Lasso & Ridge? 5. Difference between Bagging and Boosting. 6. Explain K-Means c...

read more
Ans.

Questions related to data analysis techniques and methods.

  • Bais and variance trade-off: balancing model complexity and accuracy

  • Handling imbalanced data: resampling techniques, adjusting class weights, using different evaluation metrics

  • Multicollinearity: when predictor variables are highly correlated, can be handled by feature selection or regularization

  • Lasso & Ridge: regularization techniques to prevent overfitting by adding penalty terms to the loss function

  • Bagging vs Boostin...read more

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.5
 • 11.2k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 8k Interviews
Wipro Logo
3.7
 • 6.2k Interviews
Cognizant Logo
3.7
 • 6k Interviews
View all
Interview Tips & Stories
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Data Analyst Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits