Sample Test for interview of TechMojo
Question: Find the top 10 trending hashtags in twitter. You can write a standalone java class(es) / interfaces as deemed to be fit. Assumptions & notes :
- A tweet is a text being input by tweeters.
- A main method in a java class to be implemented which takes the tweet as an input.
- You need to extract hashtag from a tweet text (Ex: sachin is hashtag in the tweet -> " Worlds best cricketer is #sachin")
- Maintain a data structure that keeps tracking of the count of each hashtag that is coming to your main method
- print the list of top 10 hashtags at the end of main method execution
Solution defined in the simple standalone Java code using Java 1.8 Used lambda expressions and hence need to use Java 8 or higher to execute