Skip to content

fahadtufail007/inactive-users

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

The users in your system have a lastActivity prop associated with them which gets updated everytime user performs some activity into the system. In the file inactive.js we're sampling a single user. When the program starts, the user's lastActivity time is set to latest.

In the code we also start an interval that runs every minute. You have to write an algorithm that classifies users according to inactivity as follows:

1-2 minutes of inactivity => call inactiveFirstStage() 2-3 minutes of inactivity => call inactiveSecondStage() 4-5 minutes of inactivity => call inactiveThirdStage()

After 5 minutes, and if the user is still inactive, the cycle starts repeating itself. So if the user has been inactive for 6-7 minutes, it is considered as 1-2 minutes of inactivity and inactiveFirstStage() is invoked. This is an important point to consider.

** Important **

  • Fork this repo before you do anything
  • Make all the commits in your forked repo
  • Submit link to your forked repo that has all the code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%