Analyst

2000+ Analyst Interview Questions and Answers

Updated 16 Dec 2024

Popular Companies

search-icon
Q1. N-th Fibonacci Number

You are given an integer ‘N’, your task is to find and return the N’th Fibonacci number using matrix exponentiation.

Since the answer can be very large, return the answer modulo 10^9 +7.

Fi...read more
Ans.

Find N-th Fibonacci number using matrix exponentiation and return modulo 10^9+7.

  • Implement a function to find N-th Fibonacci number using matrix exponentiation.

  • Return the answer modulo 10^9+7.

  • Use the formula F(n) = F(n-1) + F(n-2) with F(1) = F(2) = 1.

  • The time complexity should be better than O(N).

  • The constraints are 1 <= T <= 10 and 1 <= N <= 10^5.

Q2. Ninja And The Game Of Words

Ninja and his friend playing a game in which his friend gave him a string ‘STR’ that can contain spaces and a List/Array ‘WORDS’ which is of type string containing ‘N’ strings of wor...read more

Analyst Interview Questions and Answers for Freshers

illustration image
Q3. Reverse of a number

Write a program to generate the reverse of a given number N. Print the corresponding reverse number.

Note : If a number has trailing zeros, then its reverse will not include them. For e.g., r...read more

Q4. A 10x10x10 cube is made up of 1x1x1 cubes. Its outer surface is painted red and then big cube is dismantled into smaller cubes. How many cubes are there with none of their faces painted red?

Ans.

A 10x10x10 cube is dismantled into smaller cubes. How many have none of their faces painted red?

  • The outer layer of the big cube has 8x8x8 cubes painted red

  • The number of cubes with at least one red face is 6x6x6

  • The number of cubes with no red faces is 10x10x10 - (8x8x8 - 6x6x6)

Are these interview questions helpful?
Q5. Wildcard Pattern Matching

Given a text and a wildcard pattern of size N and M respectively, implement a wildcard pattern matching algorithm that finds if the wildcard pattern is matched with the text. The matchi...read more

Q6. Digits Decoding

A few days back, Ninja encountered a string containing characters from ‘A’ to ‘Z’ which indicated a secret message. For security purposes he encoded each character of the string to its numeric va...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Good old standard problem: Playing number game with your friend to select any of the number between 1 to 3. Whoever reaches 20 first, wins. You have to tell the strategy to win the game. Basically, you start wi...

read more
Ans.

The strategy is to always subtract the number chosen by the friend from 4 to ensure reaching 16 first.

  • Start with 20 and subtract the number chosen by the friend from 4.

  • Continue this strategy until reaching 16 before the friend reaches 17-19.

  • Ensure the friend ends up at any number between 17 to 19 before reaching 16.

Q8. Subarray With Given Sum

Given an array ARR of N integers and an integer S. The task is to find whether there exists a subarray(positive length) of the given array such that the sum of elements of the subarray eq...read more

Analyst Jobs

Client Account Services - Analyst 2-7 years
JPMorgan Chase
4.1
Bangalore / Bengaluru
R&A Private Credit and Financing Analyst 1-4 years
JPMorgan Chase
4.1
Mumbai
PPM Rel Analyst - Eng BoM 3-5 years
Ford India Private Limited
4.4
Chennai

Q9. What type of customer queries you have handled in your previous role?

Ans.

Handled various customer queries related to product usage, billing, and technical issues.

  • Assisted customers with troubleshooting technical issues over the phone and email

  • Resolved billing discrepancies and processed refunds

  • Provided guidance on product usage and recommended solutions to meet customer needs

  • Handled complaints and escalated issues to management when necessary

Q10. what will you do if set of box suddenly switched off?

Ans.

I would check if it's a power outage or a technical issue and troubleshoot accordingly.

  • Check if other devices are also affected by the power outage

  • If it's a technical issue, check the power source and connections

  • Try turning the box back on and see if it works

  • If the issue persists, seek technical assistance

Q11. Chocolate Problem

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the t...read more

Frequently asked in,
Q12. Gold mine problem

You have been given a gold mine represented by a 2-d matrix of size ('N' * 'M') 'N' rows and 'M' columns. Each field/cell in this mine contains a positive integer, the amount of gold in kgs.

In...read more

Q13. 1) What are the types of master data in SAP MM? 2) What is T-code for creation of material master? 3) What are the types of document in SAP MM? 4) What is T- code for creation of vendor master? 5) What is STO? ...

read more
Ans.

1) Material, Vendor, Customer, and Service master data are types of master data in SAP MM.

  • Material master data contains information about materials used in production or procurement.

  • Vendor master data contains information about the vendors or suppliers.

  • Customer master data contains information about the customers.

  • Service master data contains information about the services provided.

Q14. Cycle Detection in a Singly Linked List

You have given a Singly Linked List of integers, determine if it forms a cycle or not.

A cycle occurs when a node's next points back to a previous node in the list. The li...read more

Frequently asked in,
Q15. Group Anagrams Together

You have been given an array/list of strings 'STR_LIST'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one...read more

Q16. Given a tank with liquid, and there are flows in and out, inflow is U and outflow is Kx, where x is current height of liquid in tank, all needed quantities given, what are the conditions for overflow and steady...

read more
Ans.

Conditions for overflow and steady state in a tank with inflow and outflow

  • Overflow occurs when the inflow rate is greater than the outflow rate

  • Steady state is achieved when the inflow rate equals the outflow rate

  • Overflow can be prevented by adjusting the inflow rate or increasing the outflow rate

  • Steady state can be maintained by balancing the inflow and outflow rates

Q17. Greatest Common Divisor

You are given two numbers, ‘X’ and ‘Y’. Your task is to find the greatest common divisor of the given two numbers.

The Greatest Common Divisor of any two integers is the largest number th...read more

Q18. Idempotent Matrix

Given a N * N matrix and the task is to check matrix is idempotent matrix or not.

See the sample input.

Idempotent matrix M follows the following property :

M*M = M 
Input format :
Line 1 : Siz...read more

Q19. In your hostel every girl plays badminton atleast once a month. The probability of one playing badminton in 1st week is a, probability that if one doesn’t play in 1st week than she will play in 2nd week is b, p...

read more
Ans.

Calculating the probability of two friends playing badminton in the same week given certain probabilities.

  • Calculate the probability of both playing in the first week (a*a)

  • Calculate the probability of both playing in the second week ((1-a)*b*(1-c))

  • Calculate the probability of both playing in the third week ((1-a)*(1-b)*c)

  • Calculate the probability of both playing in the last week ((1-a-b-c)*(1-a-b-c))

  • Add up all the probabilities to get the final answer

Q20. Given a web portal that is running slow, how would you debug the solution for that? Answer stepwise.

Ans.

Debugging steps for a slow web portal

  • Check server load and resource usage

  • Analyze network traffic and latency

  • Review code for inefficiencies and optimize

  • Use profiling tools to identify bottlenecks

  • Consider caching and content delivery networks

  • Test and monitor performance after changes

Q21. All prime numbers

Given an integer N, print all the prime numbers that lie in the range 2 to N (both inclusive).

Input Format :
Integer N 
Output Format :
Prime number...read more
Q22. Boyer Moore Algorithm For Pattern Searching

You are given a string ‘text’ and a string ‘pattern’, your task is to find all occurrences of pattern in the string ‘text’ and return an array of indexes of all those ...read more

Q23. Circular Tour

You have been given a circular path. There are N petrol pumps on this path that are numbered from 0 to N - 1 (Both inclusive). Each petrol pump has two values associated with it:

1)The amount of pe...read more

Q24. Given we have a (un)biased die, with given probabilities, and we toss it till we get a sum of 100 or more (basically if the sum crosses 100), and we stop. What is the most probable number you will get on the la...

read more
Ans.

The most probable number on the last toss is 6.

  • The probability of getting a sum of 100 or more is highest when the sum is 99.

  • The last toss will be made to reach the sum of 100, so the most probable number is the one that will take the sum closest to 100.

  • The sum of 94 can be achieved by rolling a 6 on the last toss, which is the most probable number.

Q25. If I give you the data can you use Excel formulas to give the output?

Ans.

Yes, I can use Excel formulas to process the given data and provide the desired output.

  • Excel formulas can be used to perform various calculations and manipulations on data

  • They can be used to perform mathematical operations, create formulas based on logical conditions, and manipulate text

  • Examples of Excel formulas include SUM, IF, VLOOKUP, CONCATENATE, etc.

Q26. Maximum Subarray Sum

You are given an array/list ARR consisting of N integers. Your task is to find the maximum possible sum of a non-empty subarray(contagious) of this array.

Note: An array C is a subarray of a...read more

Frequently asked in,

Q27. What is truth? Like the one you have been taught or the one you learn yourself like your parents teach you to not cut nails at night etc ot go to the temple?

Ans.

Truth is subjective and can be influenced by personal experiences and cultural beliefs.

  • Truth is not always objective or universal

  • It can be shaped by personal experiences and cultural beliefs

  • What is considered true in one culture may not be true in another

  • Truth can also change over time as new information is discovered

  • For example, the belief that the earth was flat was once considered true, but is now known to be false

Q28. Rotate array

Given an array with N elements, the task is to rotate the array to the left by K steps, where K is non-negative.

Input Format:

The first line contains an integer N representing the size of the array...read more
Q29. LRU Cache Implementation

Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:

1. get(key) - Return the value of the key if the key exists in the cache, o...read more
Frequently asked in,
Q30. Shortest Path in a Binary Matrix

You have been given a binary matrix of size 'N' * 'M' where each element is either 0 or 1. You are also given a source and a destination cell, both of them lie within the matrix....read more

Frequently asked in,

Q31. Suppose a man starts at 0, and has to go to 20 on the number line. He can either move in steps of 1 or 2. How many number of ways can he do this? Extending this, if we know the number of ways for going from 0 t...

read more
Ans.

Count number of ways to reach 20 on number line starting from 0 in steps of 1 or 2. Derive recursive formula for n+1.

  • Use dynamic programming to count number of ways for each step.

  • For each step, number of ways is sum of number of ways for previous 1 or 2 steps.

  • Recursive formula: ways[n+1] = ways[n] + ways[n-1]

Q32. How will you find the top 5 customer of HSBC from the entire world?

Ans.

Top 5 customers of HSBC can be found by analyzing transaction history and account balances.

  • Analyze transaction history of all HSBC customers worldwide

  • Identify customers with highest transaction volumes and account balances

  • Rank customers based on transaction volumes and account balances

  • Select top 5 customers based on ranking

  • Consider other factors such as creditworthiness and profitability

Q33. If you are asked to play a game where you toss a fair coin again and again until you get consecutive heads and win Re. 1 or you get consecutive tails and lose and quit, how much will you be willing to pay to pl...

read more
Ans.

I would be willing to pay 50 paise to play this game.

  • The expected value of the game is 50 paise.

  • This is because the probability of getting consecutive heads is 1/3 and the probability of getting consecutive tails is 1/4.

  • Therefore, the expected value of the game is (1/3 * 1) - (1/4 * 1) = 1/12 = 8.33 paise.

  • However, since the minimum amount that can be won is Re. 1, I would be willing to pay 50 paise to play the game.

Q34. 3. Do you know about OOP concepts? Explain.

Ans.

Yes

  • OOP stands for Object-Oriented Programming

  • It is a programming paradigm that organizes code into objects

  • OOP concepts include encapsulation, inheritance, and polymorphism

  • Encapsulation allows bundling of data and methods into a single unit

  • Inheritance enables the creation of new classes based on existing ones

  • Polymorphism allows objects of different classes to be treated as the same type

  • Example: A car class can have properties like color and speed, and methods like start and st...read more

Q35. What is Active Directory? How do we manage role from active directory

Ans.

Active Directory is a Microsoft service that manages network resources and user access.

  • Active Directory is used to manage user accounts, computers, and other network resources.

  • It allows for centralized authentication and authorization for users and computers in a network.

  • Roles can be managed through Active Directory by assigning users to specific groups with corresponding permissions.

  • Examples of roles that can be managed through Active Directory include domain administrators,...read more

Q36. There is an urn with n red balls and 1 black ball in it. You and your friend play a game where you take turns drawing from the urn. The player who draws the black ball first wins. Should you go first or second?

Ans.

Go second. The probability of winning is higher when going second.

  • The probability of winning when going first is (1/n+1), while the probability of winning when going second is (n/n+1)

  • This is because the first player has a chance of drawing the black ball on their turn, while the second player has a chance of drawing the black ball on their turn or the first player's turn

  • For example, if there are 10 red balls and 1 black ball, the probability of winning when going first is 1/1...read more

Q37. Suppose there are N chocolates, and I pick a random one, and eat that chocolate and also everything to the right of it. I then continue this process with the remaining. How many ways are there to do this?

Ans.

There are (N-1)! ways to eat chocolates from left to right.

  • The first chocolate can be chosen in N ways, the second in (N-1) ways, and so on.

  • However, since the order of chocolates eaten matters, we need to divide by the number of ways to order N chocolates, which is N!.

  • Therefore, the total number of ways to eat chocolates is (N-1)!

  • For example, if N=4, there are 3! = 6 ways to eat the chocolates.

Q38. Given 3 functions, f which gives the first day of the current month, g gives the next working day and h gives the previous working day, conpute the 3rd working day? Compute the 2nd working day of the previous m...

read more
Ans.

Compute working days using given functions f, g, and h.

  • To compute the 3rd working day, apply function g three times to function f.

  • To compute the 2nd working day of the previous month, apply function h to function f, then apply function g twice.

  • To compute the 4th working day of the next month, apply function g four times to function f.

Q39. How would you segment a population based on certain attributes, which algorithm would you use. SAS and proc sql related questions are must for analyst interview. If lateral hire, expect questions based on work ...

read more
Ans.

To segment a population based on attributes, use clustering algorithms like k-means or hierarchical clustering.

  • Identify relevant attributes such as age, income, education level, etc.

  • Normalize the data to ensure all attributes are on the same scale.

  • Choose a clustering algorithm based on the size of the dataset and the desired number of segments.

  • Evaluate the results using metrics like silhouette score or within-cluster sum of squares.

  • Use SAS and proc sql to perform the analysis...read more

Q40. Puzzle

Puzzle was three numbers are in ratio 4:5:6, the lcm of 3 numbers in 2400, what would be the hcf of the numbers.
If today is Wednesday what will be the day after 132 days.

Q41. what do you know about networking?

Ans.

Networking refers to the practice of connecting devices together to share resources and communicate with each other.

  • Networking involves the use of protocols and standards such as TCP/IP, DNS, and HTTP.

  • Networking can be done through wired or wireless connections.

  • Networking can be used for various purposes such as sharing files, printers, and internet access.

  • Networking can be secured through the use of firewalls, encryption, and authentication.

  • Examples of networking devices inc...read more

Q42. An IT sector multinational wants to expand its business into more countries. Suggest a strategy. This was the question given in the VC round by the Partner. It was followed by a lot of numerical and qualitative...

read more
Ans.

To expand into more countries, the IT sector multinational can adopt a market entry strategy that includes market research, partnerships, localization, and scalability.

  • Conduct thorough market research to identify potential countries for expansion

  • Establish strategic partnerships with local companies to leverage their knowledge and networks

  • Adapt products and services to meet the specific needs and preferences of each target market

  • Ensure scalability of operations to handle the i...read more

Q43. Which language do you prefer to code in? "Have you read The C Programming Language book by Dennis Retchie?" Which technical book have you read recently?.-So you like C, have you ever thought of bringing up the ...

read more
Ans.

Yes, I prefer coding in C and have read The C Programming Language book. I have also explored the concept of Inheritance in C.

  • I find C to be a powerful and efficient language for system programming.

  • Yes, I have read The C Programming Language book by Dennis Retchie and found it to be a great resource.

  • Recently, I have been exploring the concept of Inheritance in C through various online resources and tutorials.

  • While C does not have built-in support for Inheritance, it is possib...read more

Q44. There is a closed room with 3 bulbs and there are three switches outside. You can toggle any two switches once without looking inside the room and map the bulbs to their corresponding switches. (Since I had don...

read more
Ans.

You can map the bulbs to their corresponding switches by toggling two switches and leaving one switch untouched.

  • Toggle switch 1 and switch 2, leave switch 3 untouched.

  • After a few minutes, toggle switch 2 back to its original position.

  • Enter the room and observe the bulbs.

  • The bulb that is on corresponds to switch 1, the bulb that is off and still warm corresponds to switch 2, and the bulb that is off and cool corresponds to switch 3.

Q45. Technical Questions

OOPS concepts.

What is SQL and NO SQL database?

What is difference between Stored procedures and functions?

Q46. How would you find whether a number is even or odd without using any conditions?

Ans.

Using bitwise operator to check the last bit of the number.

  • Use bitwise AND operator with 1 to check the last bit of the number.

  • If the result is 0, the number is even. If the result is 1, the number is odd.

  • Example: 6 & 1 = 0 (even), 7 & 1 = 1 (odd)

Q47. In how many ways can i permute n numbers 1 2 3...n so that all the no.s between u and i+1 are less than i (for all i in the permutation)?

Ans.

Counting permutations where numbers between u and i+1 are less than i for all i in the permutation.

  • The first number in the permutation must be 1.

  • For each i in the permutation, all numbers between u and i+1 must be less than i.

  • Use dynamic programming to count the number of valid permutations.

  • The answer is (n-1)th Catalan number.

  • Example: for n=4, the answer is 5.

Q48. One puzzles--How to calculate the average no of person coming to the airport daily?

Ans.

The average number of people coming to the airport daily can be calculated by taking the total number of people arriving and departing and dividing it by two.

  • Collect data on the number of arrivals and departures for a given period, such as a week or a month.

  • Add the number of arrivals and departures together to get the total number of people coming to the airport.

  • Divide the total number by the number of days in the period to get the average number of people coming to the airpo...read more

Q49. Can some work you did at Microsoft be used in DB (I wasn’t at all expecting this but thought and found that an algo I designed could be applied to a problem in the stock market domain)?

Ans.

Yes, an algorithm I designed at Microsoft can be applied to a problem in the stock market domain.

  • I designed an algorithm at Microsoft that can be used in the stock market domain

  • The algorithm can be applied to solve a specific problem in the stock market

  • The work I did at Microsoft has potential applications in the financial industry

Q50. DBMS Question

A SQL query was shown to me my screen sharing along with the table, and I had to give the output of that query. It was a pretty simple query but had a trick condition like --> (where 1=1)--> this w...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
 • 10k Interviews
3.9
 • 7.8k Interviews
3.7
 • 5.2k Interviews
3.8
 • 4.6k Interviews
3.6
 • 3.6k Interviews
3.8
 • 2.8k Interviews
3.5
 • 766 Interviews
3.4
 • 485 Interviews
3.6
 • 399 Interviews
3.9
 • 348 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

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
Get AmbitionBox app

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