You are given multiple tabs in your browser, you have to design such a system that when you close one tab then it jumps back to last visited tab just before it. New tabs can also be opened.
Eg. If you have three tabs –
youtube.com, google.com, yahoo.com respectively opened in your browser and you are on yahoo.com, from yahoo.com you switched to google.com, (in here if you close google tab then you should jump to yahoo.com not youtube.com) Now you open gmail.com in a new tab (in here if you close gmail tab then you should go back to