Microsoft | System Design | Implement class to get mostVisited and leastVisited path

Anonymous User
330
Jul 11, 2022

Implement the following method of the class.
So that it increment the counter of path when user visitPage
Decrements counter of path when we leave page.
Also, return most visited page path and least visited pages page path on demand.

PageUserStat{
		void visitPage(string Path){
		//increments counter
		}
		void leavePage(String Path){
		//Decrements counter
		}
		String getWithMostUsers(){
		//get most visited path
		}
		String getPageWithLeastUsers(){
		//get least visited path
		}
}
Comments (2)