Question 1 : Design a customer preference system for a video streaming company.
Answer : I gave below design image in next 45 minutes along with some queries for such client to understand more about this
requirement-
Answer : I gave below design image in next 45 minutes along with some queries for such client to understand more about this
requirement-
Question 2 : Develop a program called VowelCounter. It should take a sentence as an input and should output the top 3
words having most number of vowels(a, e, I, o, or u).
Answer : As shown in below image -
words having most number of vowels(a, e, I, o, or u).
Answer : As shown in below image -
Improvements :
a) Create instance of VowelCounter once & use that in the loop.
b) Better make push() as static.
c) Rather converting to lower & upper case each character everytime, add both lower & upper case vowels in the set 'vowels'.
d) Using Java8, we can have printTop3() method like shown in below image -
a) Create instance of VowelCounter once & use that in the loop.
b) Better make push() as static.
c) Rather converting to lower & upper case each character everytime, add both lower & upper case vowels in the set 'vowels'.
d) Using Java8, we can have printTop3() method like shown in below image -
Below is another variation around the Predicate used above, now below I am using predicate for characters not for integers -