Team Name: Azure DevOps
Given an array of probability distribution, generate a function to return a char with given probability.
str=[‘a’, ’b’, ’c’]
probabilityDistribution =[50, 25, 25]
4 outputs when called 4 times =a, a, b, c. Create a function
There are coins stored in tree nodes. Each node is supposed to have exactly 1 coin. Total no of coins in a tree is = no of nodes. But the coins are not equally distributed and have to moved to proper nodes (which have >1 or <1 coins). Find the number of moves required.
1 website could link to many other websites. Design a crawler service that could return all websites that are recursively reachable from this website. Design a distributed system where all results cannot be stored in 1 node. [Ans= Decouple storage and compute]
Maximum sum subarray: https://www.geeksforgeeks.org/maximum-subarray-sum-using-divide-and-conquer-algorithm/
Factory pattern question
How do you consume info from an API which produces data faster than you can consume ?
OOPS- Design a Lift.( X cars, each car can have max P passengers, not destination controlled)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.