Feature #5: Drawing a Global Profile of Viral Tweets

Implementing the "Drawing a Global Profile of Viral Tweets" feature for our "Twitter" project.


For our Twitter application, we want to keep track of the globally viral tweets on a particular day. For this reason, we must keep track of the duration in which a particular hashtag was trending along with its peak number of mentions. We have already collected the data of these top trending hashtags. We have stored the tweets information in the tweets list where each element in the list i.e., tweet[i]contains the following:

  • starti: The time at which the hashtag started trending.
  • endi: The time at which the hashtag stopped trending.
  • peak_mentionsi: The number of peak mentions of that hashtag.

For example, in the following illustration, the tweet with the red block started trending at time 2, stopped trending at 9 and its peak number of mentions was 10.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.