Strategic Anaylst
Strategic Anaylst Interview Questions and Answers

Asked in Goldman Sachs

Q. What is the probability of an 8-bit string having no more than 2 consecutive 1s? Solve using dynamic programming.
Probability of an 8 bit string with no more than 2 consecutive 1's using dynamic programming.
Use dynamic programming to calculate the probability of a string with no more than 2 consecutive 1's
Create a 2D array to store the probabilities of each bit position and number of consecutive 1's
Use recurrence relation to calculate the probability for each bit position based on the previous bit position
Sum up the probabilities for all possible combinations of the last bit position and...read more

Asked in Goldman Sachs

Q. Given a list of numbers, provide an algorithm to find two numbers that add up to 600. Optimize the complexity to O(N).
Algorithm to find 2 numbers that add up to 600 from a list of numbers with O(N) complexity.
Use a hash table to store the difference between each number and 600.
Iterate through the list and check if the difference is in the hash table.
If the difference is in the hash table, return the current number and the difference.

Asked in Goldman Sachs

Q. Which is greater, (π^e) or (e^π)?
e^π is greater than π^e.
e^π ≈ 23.14
π^e ≈ 22.46
e^π > π^e

Asked in Goldman Sachs

Q. Given a graph, find whether there is a 3-cycle in the graph in an efficient manner.
Efficiently determine if a given graph contains a 3 cycle.
Use depth-first search (DFS) to traverse the graph
For each node, check if there is a path of length 3 that ends at that node
If such a path exists, return true
If DFS completes without finding a 3 cycle, return false

Asked in Goldman Sachs

Q. Given a fair coin, find the expected number of trials for 4 consecutive heads.
Expected number of trials for 4 consecutive heads with a fair coin.
The probability of getting 4 consecutive heads is 1/2^4 = 1/16
The expected number of trials for 4 consecutive heads is 1/p = 16
This is because the expected value of a geometric distribution with probability p is 1/p
Therefore, the expected number of flips for 4 consecutive heads is 16



Reviews
Interviews
Salaries
Users

