Can anyone explain me the example problem and suggest me an approach to solve this


Forum Post 0 Answers Can anyone explain me the example problem and suggest me an approach to solve this

An enrollment analyst working in a top healthcare firm has to onboard genuine healthcare providers into the system by calculating the overall risk score associated with the provider. In general, if they had committed fraud, then, their associated risk score will be high. To calculate the provider's overall risk score, the analyst has to identify the risk score impact from the healthcare provider's direct social relationships. i.e. The analyst considers the risk scores associated with the healthcare provider's direct social influences (Blood relations, Friends, Professional relations) and arrives at the overall risk score for the healthcare provider.
The social influences can be one of the below three:
a.    Blood relation (impacts the overall healthcare Provider risk score by 80%) b.    Friend (impacts the overall healthcare Provider risk score by 60%) c.    Professional relation (impacts the overall healthcare Provider risk score by 40%)
i.e. if a healthcare provider carries a particular risk score say 100; his direct social influence - one of his friends carry a risk score of 100; In order to calculate the overall risk factor of the healthcare provider, his risk score is added with 60% of his friend's risk score. 60% because the relationship is a Friend. The overall risk score of healthcare provider = (Healthcare Provider's risk score) 100 + (60% of his friend's risk score) 60 = 160. It will be 80% in case of blood relation and 40% in case of a professional relationship.
Note:
To calculate the healthcare provider's overall risk score, you will only consider the impact of his social influences on him. The impact of healthcare provider's existing risk score on his social influences should not be considered.  
Say for example, a healthcare provider's friend has a professional relationship with another person who has committed fraud; then, the friend's risk score will be impacted by his direct professional relationship by 40%. And this friend's overall risk will impact the healthcare provider by 60%. In order to calculate the over all risk score associated with the healthcare provider, first, the risk score associated with his friend has to be calculated. Since his friend is directly impacted by his professional relationship, the risk associated with that professional relationship has to be first calculated and so on.
It is important to note both the healthcare provider and his friend's risk impact on others will not be considered while calculating the overall risk score of his friend.

Input Format: You will be given a function which contains 3 arguments -  Argument 1 will represent the relationship between the individuals.A:FRIEND:B#B:BLOOD_RELATION:C means A is a friend of B and B is a blood relation of C. Argument 2 will represent the risk value of each individual. A:100#B:50#C:10 means, A's risk value is 100, B and C has 50, 10 respectively. Argument 3 will represent the individual's name for whom the overall risk score has to be calculated, by considering his social influences.

Output Format: You need to return the risk score of that individual mentioned in the 3rd argument and it will be a floating point (decimal) value, rounded to 2 decimal places in the form of string.

Sample Test Case Sample Input: A:FRIEND:D#A:BLOOD_RELATION:B#A:PROF_RELATION:C#B:PROF_RELATION:C#B:FRIEND:D#D:PROF_RELATION:C A:100#B:100#C:100#D:100 C

Sample Output: 485.60

- iranireshma8 June 28, 2017 | Flag |






Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More