Data Analyst

1000+ Data Analyst Interview Questions and Answers

Updated 13 Apr 2025
search-icon

Q1. Suppose there is a room in the office and X people enter room throughout the day, Y people leave throughout the day [continuously people are entering the room, some are staying there, and rest are going out] .....

read more
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

Q2. 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.

Frequently asked in,

Data Analyst Interview Questions and Answers for Freshers

illustration image

Q3. 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

Q4. 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?

Q5. 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.

Q6. 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.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. 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 '%'.

Q8. 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.

Data Analyst Jobs

Data Analysis & Simulation Professional (Gen AI Engineer) 5-7 years
Siemens Healthcare
4.2
Bangalore / Bengaluru
Data Analyst 2-3 years
Schneider Electric India Pvt. Ltd.
4.1
₹ 7 L/yr - ₹ 8 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
Quality / Data Analyst 5-8 years
Amazon
4.0
₹ 20 L/yr - ₹ 25 L/yr
Bangalore / Bengaluru

Q9. 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.

Q10. 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.

Q11. How can you prove to the client that a students with higher classes are taller than that of 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

Q12. 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

Q13. 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.

Q14. 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.

Frequently asked in,

Q15. 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.

Q16. How to 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

Q17. 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

Q18. 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.

Frequently asked in, ,
Q19. 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

Q20. 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

Q21. What are the different approach 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

Q22. 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

Q23. 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

Q24. 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

Q25. What are the elements which are present in all the financial statements like BS,IS and CF.

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

Q26. 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

Q27. You have 10 coins, and one of them has a greater weight than the others. Using a measuring device, what is the minimum number of comparisons required to identify the heavier coin?
Ans.

The minimum number of comparisons required to identify the heavier coin is 3.

  • Divide the 10 coins into 3 groups of 3, 3, and 4 coins.

  • Compare the first two groups of 3 coins each. If one group is heavier, move to the next step with that group.

  • Compare the 3 coins in the heavier group individually to find the heaviest coin.

Q28. How would you manage the warehouse of a brand with stores in various cities during times of high demand and low supply, such as during the COVID pandemic?
Ans.

Implement inventory management strategies like demand forecasting, safety stock, and efficient logistics.

  • Utilize demand forecasting techniques to predict future demand based on historical data and market trends.

  • Maintain safety stock levels to buffer against fluctuations in supply and demand.

  • Implement efficient logistics and supply chain management to ensure timely delivery of products to stores.

  • Utilize technology such as inventory management software to track inventory levels...read more

Q29. How you get your data in your organization

Ans.

Data is collected from various sources including databases, APIs, and user input.

  • We have access to multiple databases where we can extract relevant data

  • We use APIs to gather data from external sources such as social media platforms

  • Users can input data through forms or surveys

  • We also collect data through web scraping techniques

Q30. Write a query where all the customer name start with A

Ans.

Query to retrieve all customer names starting with A.

  • Use the SELECT statement to retrieve customer names.

  • Use the LIKE operator with the pattern 'A%' to match names starting with A.

  • Specify the table and column name where the customer names are stored.

  • Example: SELECT customer_name FROM customers WHERE customer_name LIKE 'A%';

Q31. 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

Q32. Write code to describe database and Columns from a particular table

Ans.

Code to describe database and columns from a table

  • Use SQL SELECT statement to retrieve column names and data types

  • Use DESC command to get table structure

  • Use INFORMATION_SCHEMA.COLUMNS to get detailed information about columns

  • Use SHOW CREATE TABLE to get table creation statement

Q33. How would you cut a cylindrical cake into 8 equal pieces using just 3 straight cuts of a knife?
Ans.

To cut a cylindrical cake into 8 equal pieces with 3 straight cuts, make 2 cuts parallel to the base and 1 cut perpendicular to the base.

  • Make the first cut horizontally through the middle of the cake to create two equal halves.

  • Make the second cut vertically through the center of one of the halves to create two equal quarters.

  • Make the third cut horizontally through the middle of one of the quarters to create two equal eighths.

Q34. What is a Brownian motion? Properties of Brownian motion?

Ans.

Brownian motion is the random motion of particles in a fluid due to collisions with other particles.

  • Brownian motion was first observed by Robert Brown in 1827.

  • It is named after the botanist Robert Brown.

  • The motion is caused by the random movement of fluid molecules.

  • Brownian motion is a continuous-time stochastic process.

  • It is often used to model various phenomena in physics, finance, and biology.

  • Properties of Brownian motion include random walk, Gaussian distribution, and sel...read more

Q35. Difference between Having and where clause?

Ans.

HAVING clause is used with GROUP BY to filter the results based on aggregate functions, while WHERE clause is used to filter individual rows.

  • HAVING clause is used after GROUP BY clause.

  • HAVING clause is used to filter the results based on aggregate functions like SUM, COUNT, AVG, etc.

  • WHERE clause is used before GROUP BY clause.

  • WHERE clause is used to filter individual rows based on conditions.

  • HAVING clause cannot be used without GROUP BY clause.

  • WHERE clause can be used without...read more

Q36. What is a Martingale? What are Markov Processes? Is Martingale a Markov Process? Are Markov Processes Martingales?

Ans.

A Martingale is a mathematical concept used in probability theory and statistics. Markov Processes are stochastic processes that satisfy the Markov property.

  • A Martingale is a sequence of random variables where the expected value of the next variable, given the current and past variables, is equal to the current variable.

  • Markov Processes are stochastic processes where the future state depends only on the current state and not on the past states.

  • A Martingale is not necessarily ...read more

Q37. What is SQL, what are the types of joins and what is the main difference between union and union all ?

Ans.

SQL is a programming language used for managing relational databases. Joins combine data from multiple tables. Union combines results from multiple queries without duplicates, while Union All includes duplicates.

  • SQL is a programming language used for managing relational databases.

  • Types of joins include inner join, left join, right join, and full outer join.

  • Union combines results from multiple queries without duplicates.

  • Union All includes duplicates in the combined result set.

Q38. Define Excel Functions Sum , Sum if , Count , CountA , Count Blanks

Ans.

Excel functions are pre-built formulas that perform calculations or manipulate data in a spreadsheet.

  • Sum: adds up a range of numbers

  • Sum if: adds up a range of numbers based on a specified condition

  • Count: counts the number of cells in a range that contain numbers

  • CountA: counts the number of cells in a range that are not empty

  • Count Blanks: counts the number of empty cells in a range

Q39. We will give 30% of your salary as Variable pay after completion of 1 yr but we will decide when to give it to you. Would you still be willing to work for us as working for our company is a prestigious opportun...

read more
Ans.

I would consider the offer based on the overall compensation package and career growth opportunities.

  • I would need more information on the overall compensation package to make a decision.

  • I would also consider the potential career growth opportunities and learning experiences at the company.

  • It would be important to understand the criteria and timing for receiving the variable pay.

  • I would evaluate the offer based on my long-term career goals and personal financial situation.

Q40. Given a list of dictionary, find the dictionary which has the count of key highest among all the dictionaries. eg: [{a:5},{b:2}.......] Now here 5 is the highest key value so it should be printed.

Ans.

Find the dictionary with the highest count of keys in a list of dictionaries.

  • Iterate through the list of dictionaries and keep track of the dictionary with the highest count of keys.

  • Use a loop to count the keys in each dictionary and compare it with the current highest count.

  • Return the dictionary with the highest count of keys.

Q41. Create the pivot table, sort the data in ascending order

Ans.

Create a pivot table and sort the data in ascending order.

  • To create a pivot table, select the data range and go to the 'Insert' tab in Excel.

  • Choose 'PivotTable' and select the location for the pivot table.

  • Drag the desired fields to the 'Rows' and 'Values' areas.

  • To sort the data in ascending order, click on the drop-down arrow next to the field name in the pivot table and select 'Sort A to Z'.

Q42. Can we add extra row and pivot table in excel? If yes than how?

Ans.

Yes, we can add extra row and pivot table in excel.

  • To add a row, select the row below where you want to add the new row and right-click, then select 'Insert'.

  • To create a pivot table, select the data range and go to 'Insert' tab, click on 'PivotTable' and follow the prompts.

  • To add a new pivot table to an existing one, select a cell in the existing pivot table and go to 'Analyze' tab, click on 'PivotTable' and follow the prompts.

Q43. Different types of Joins in SQL and what are the outputs when you join two tables with nulls.

Ans.

Different types of Joins in SQL and the outputs when joining two tables with nulls.

  • Types of joins in SQL include inner join, left join, right join, and full outer join.

  • When joining two tables with nulls, the output depends on the type of join used.

  • In an inner join, null values are excluded from the result.

  • In a left join, all rows from the left table and matching rows from the right table are included, with nulls for non-matching rows.

  • In a right join, all rows from the right t...read more

Q44. How we fill some information in all the selected blank space in just one click in Google sheet ?

Ans.

Yes, we can use the Fill Down feature in Google Sheets to fill information in all selected blank spaces in just one click.

  • Select the cell with the information you want to fill

  • Hover over the bottom right corner of the cell until the cursor changes to a small blue square

  • Click and drag the blue square down to the last cell where you want the information to be filled

Q45. In a marketing campaign, how would you decide which metrics to track?
Ans.

Metrics selection based on campaign objectives, target audience, and key performance indicators.

  • Identify campaign objectives and goals

  • Consider target audience and their behavior

  • Select key performance indicators (KPIs) relevant to the campaign

  • Track metrics such as conversion rate, click-through rate, ROI, customer acquisition cost

  • Analyze data to measure success and make data-driven decisions

Q46. Whom are you going to query when you have TP discrepant data

Ans.

I would query the relevant stakeholders involved in the data collection process.

  • Identify the stakeholders involved in the data collection process

  • Reach out to them to understand the data collection process and identify any potential issues

  • Collaborate with them to resolve the TP discrepant data

Q47. What is the effect of stock split on market capitalisation of a company?

Ans.

A stock split increases the number of shares outstanding and decreases the price per share, but does not affect the market capitalisation.

  • Stock split does not affect the total value of the company

  • Market capitalisation remains the same after a stock split

  • Stock split increases the number of shares outstanding and decreases the price per share

  • For example, if a company has 1 million shares outstanding and the stock splits 2-for-1, the company will have 2 million shares outstandin...read more

Q48. What questions were you asked regarding Machine Learning, specifically in exploratory data analysis, the basics of deep learning, and can you describe the puzzle that was presented?
Ans.

Discussed machine learning topics in exploratory data analysis and deep learning during interview.

  • Discussed the importance of exploratory data analysis in understanding the dataset before applying machine learning algorithms.

  • Explained the basics of deep learning, including neural networks, activation functions, and backpropagation.

  • Described a puzzle related to machine learning, such as predicting customer churn based on historical data.

Q49. What according to you is financial Market?

Ans.

Financial market is a platform where buyers and sellers trade financial assets such as stocks, bonds, currencies, and commodities.

  • Financial market facilitates the exchange of financial assets between buyers and sellers

  • It includes stock markets, bond markets, currency markets, and commodity markets

  • Financial market plays a crucial role in the economy by allocating capital to businesses and governments

  • Examples of financial markets include NYSE, NASDAQ, London Stock Exchange, and...read more

Q50. What is aadhar card (because i am in aadhhar process)

Ans.

Aadhaar card is a unique identification card issued by the Indian government to residents of India.

  • Aadhaar card is a 12-digit unique identification number issued by the Unique Identification Authority of India (UIDAI).

  • It serves as proof of identity and address for Indian residents.

  • Aadhaar card contains biometric and demographic information of the cardholder, including fingerprints and iris scans.

  • It is used for various purposes such as opening bank accounts, getting a SIM card...read more

1
2
3
4
5
6
7
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.7k Interviews
3.8
 • 8.4k Interviews
3.6
 • 7.7k Interviews
3.7
 • 5.8k Interviews
3.7
 • 5.7k Interviews
3.7
 • 4.9k Interviews
3.8
 • 2.9k Interviews
3.7
 • 760 Interviews
4.1
 • 285 Interviews
3.3
 • 84 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Data Analyst Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter