Strategic Anaylst
Strategic Anaylst Interview Questions and Answers
Q1. What is the probability of a 8 bit string to have no more than 2 consecutive 1's. This might seem like a probability question :p. But it is actually 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
Q2. Given a list of numbers give an algorithm that to find 2 numbers that add up to 600. He asked me to improve the complexity with every attempt I made finally got it down to complexity of 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.
Q3. Which one is greater, (Pie power e ) or (e power pie) ?
e^π is greater than π^e.
e^π ≈ 23.14
π^e ≈ 22.46
e^π > π^e
Q4. Given a fair coin , find the expected number of trails 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
Q5. 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
Strategic Anaylst Jobs
0Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month