Click HERE to see the complete interview process at sapient
Problem Statement :
Our Company has been asked to implement Metro Smart Card System (MSCS) for Delhi City. For this application assume there is a single metro line covering 10 stations linearly.
The stations name are A1,A2,A3,A4,A5,A6,A7,...A10. The travel can be in any direction from any station except A1 and A10.
Travelers have smart card that behave just like any other regular debit card that has an initial balance when purchased. Travelers swipe in when they enter a metro station and swipe out when they exit. Card balance is automatically updated at swipe out.
Objective :
Objective of this exercise is to create an automated system that has following functionality.
Card should have a minimum balance of Rs. 50 at swipe-in. At swipe-out, system should calculate the fare based on below strategies. The fare must be deducted from the card. Card should have the sufficient balance otherwise user should not be able to exit.
Weekday - Rs 7 * (Number of stations travelled)
Weekend - Rs 5.5 * (Number of station traveled if it is Saturday or Sunday )
(* there could be more such fare strategies in future).
Additionally system needs to have functionality to generate some statistics/report defined below. So system needs to provide following API.
- API to get total foot-fall(swipe-in + swipe-out) for a given station.
- API to generate a "per-card report" on demand. It should print the following information on console.
CLICK Code Sample to download the sample code for this problem.
Above code sample is created by using command line design pattern which is appropriate for this problem. However this is just for reference and you could practice this problem to find more appropriate solution.
Thnaks bro to helping us
ReplyDeleteMy pleasure, thanks Gaurav
DeleteThanks for the code details.
ReplyDeleteHowever, I am unable to download the sample code. Below error is coming while clicking on the Code Sample link.
CONFIDENTIAL
This document contains sensitive information
Please help.
Request you to change the browser and try again. Its downloading without any issue or send me your mail address, I will send you the code.
DeleteThis comment has been removed by the author.
Deletenice bro
ReplyDeleteThanks Mayank
ReplyDeleteHi Mayank,
ReplyDeleteI am also not able to download the code if possible kindly send me code on this email address prashantlko2009@gmail.com
Hi,
ReplyDeleteI have mailed you the code.
Hi Mayank,
ReplyDeleteNice article, really helpful.
Even I am not able to download the code if possible kindly send me the code on this email address salmanhauqec1063@gmail.com
Hi Mayank,
ReplyDeleteNot able to download in chrome,firefox and IE. if it is possible to send this on my email id -surendrapandey3788@gmail.com
hello sir,
ReplyDeleteproject file is not able to open if it is possible by mail, humble request you to mail at chetangupta664@gmail.com.
please mail me now if possible .. I have my interview tomorrow
ReplyDeleteMailed you, Best of luck
ReplyDeleteCan you please mail me also
DeleteAishaishlaxmi.ar@gmail.com
I am also not able to download.Could you please mail me at kankariyaabhi@gmail.com
ReplyDeleteHi,did you get the code.I am able to download it properly. If you need, I can mail you.
DeletePlease mail me as well, tanveer.jss@gmail.com.
DeleteThanks.
please mail me the code too,
ReplyDeleterajesh.aneja3049@gmail.com
Hi,
ReplyDeleteCan anyone please let me know what sort of usecase are they giving in the Coding Round to implement for Apache Spark Developer.
I am unable to download the file in chrome please mail me the code : pramod4it@gmail.com
ReplyDeleteIf you face any issues in downloading code, please try with different browser.
ReplyDeleteHi There,
ReplyDeleteI have made an attempt to download your code but it shows message
'We're sorry, this file type is not currently supported.' , somehow I have downloaded the source file and have imported the same into eclipse.
After import I am getting problem with the 'Helper.api' package section(especially the class 'TravelDetailsJDBCTemplate'),code in the same class is highlighted with red color.
Please help me on the same.
ReplyDeletePlease provide me the code at vivek.charak@gmail.com as am not able to download from the link.
ReplyDeleteThanks
please help me with the code at aakritiagarwal009@gmail.com
ReplyDeletePlease provide me the code at kuldeep.choudhary144@gmail.com as am not able to download from the link.
ReplyDeletePlease provide me the code at umme77520@gmail.com as ism not able to download it i have an interview tomorrow
ReplyDeletehi, pls send this on my id daksh2801@gmail.com. also, can you tell which codind software do they use for coding test? Thanks!
ReplyDeletePlease provide me the code for this arpitguptahcst9@gmail.com
ReplyDeletePlease provide the code on ketangupta05@gmail.com
ReplyDeletePlease mail me as well at monica8727@gmail.com
ReplyDeleteplease mail me as well at shaleenjain999@gmail.com
ReplyDeletehi Can you please provide me the code , i need it today .
ReplyDeleteEmail : rohit.ntil@gmail.com
please mail me as well at udayrai1512@gmail.com
ReplyDeleteIts not opening in browser..tried lot of times
are they provide internet connectivity or not to complete the assignment.
ReplyDelete