Data Analyst
1500+ Data Analyst Interview Questions and Answers

Asked in Deloitte

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

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

Asked in MagicBricks

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

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
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'

Asked in Amazon

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

Asked in Microsoft Corporation

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




Asked in Tredence

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

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
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 🌟

Asked in Tiger Analytics

Q. How can you prove to the client that students in higher classes are taller than those in lower classes?
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

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

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

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

Asked in Jupiter Money

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

Asked in Standard Chartered

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

Asked in Daffodil Software

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

Q. How do you find the minimum number from a given set of numbers?
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

Asked in American Express

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

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 moreFinancial 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

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

Q. How to Work with dynamic data, how to remove duplicate data or fix the data
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

Q. What are the different approaches you use for data cleaning?
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 S&P Global

Q. 1) What Is IPO 2) Sides Of Balance Sheet 3) What Is Depreciation 4) Financial Statements
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

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 Walmart

Q. Sequence of Execution of SQL codes. Select - Where-from-Having- order by etc
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 ZS

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

Q. What elements are present in all financial statements, such as the Balance Sheet, Income Statement, and Cash Flow statement?
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

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 moreQuestions 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

Asked in Tredence

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.

Asked in Tredence

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

Asked in American Express

Q. You want to create an index that comprises a bunch of components. How would you choose to aggregate all the individual components? Is it context-specific?
Choosing an aggregation method for an index depends on the components and their context, ensuring relevance and accuracy.
Identify the components: Understand what individual metrics or data points will be included in the index.
Determine the aggregation method: Common methods include sum, average, weighted average, or geometric mean.
Consider the context: The importance of each component may vary based on the specific application or industry.
Example: In finance, a stock index mi...read more
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Data Analyst Related Skills



Reviews
Interviews
Salaries
Users

