Programming Question
Programming Question
Name: ________________________
Date: _________________________
Start Time: _____________________
City: __________________________
End Time: ______________________
Accepted by:
Complete name:
Signature:
Date:
publicissapient.com
Instructions
Duration of this exercise is 135 minutes. Please manage your time accordingly.
Make any necessary assumption, and clearly state the assumptions made.
Do not seek any help – online or through any other source
Expectations
The code should run and solve the requirement.
Write the Unit Test Cases using Junit or TestNG.
You may optionally list down the test cases in text or excel file in case you are
not comfortable with any unit testing framework like Junit or TestNG.
Sample Input and Sample Output files are attached in Section 3 of this
document. Please seek help from hiring team in case the files are missing or any
clarification.
Evaluation criteria
Code Completeness / Correctness
Code Structure and quality:
o Modularity
o Usage of OO Design Principles and Design Patterns
o Size of classes/functions
o Naming convention; Class/function/variable names
o package/class structure
o Choice of data structures
Unit Test cases.
The better you perform on these criteria; higher you will score.
Submission guidelines
Please follow Section 4 for project structure and packaging.
Please follow Section 5 for submission guidelines. You may demand extra time for
this step.
publicissapient.com
1. Problem Statement
Sapient has won the contract to implement processing fee calculator for a major
investment bank (henceforth referred as client). Client receives transactions from
various external sources.
These transactions are received in a pre-configured format, for example, CSV, EXCEL,
XML or a simple pipe delimited format text file placed at a file location.
The client needs to calculate the processing fees for the transaction and generate a
report which can be sent for invoicing.
1.1. Objective
Read the transactions into the system. The various transaction attributes are listed
below.
Execute the processing rules (mentioned below) over input transactions
Provide API to get the summary report in a particular format (format mentioned
below)
Note: The code should handle CSV format input however the design should be
extensible to support other input formats as well in future.
2. Processing Rules
publicissapient.com
A nominal fee is charged to process each transaction. Fee calculation is based on
following rules:
$500 for a transaction with high priority (denoted by the priority field in the
transaction)
$100 for a transaction with normal priority and Transaction Type is Sell and
Withdraw
$50 for a transaction with normal priority and Transaction Type Code is Buy and
Deposit
2. Click on File -> Save As -> This PC -> Desktop (any desired location)
It will open Save As dialog for saving the file.
publicissapient.com
7. Follow the same steps to save Sample_Output.csv.
4. Project Setup
Create Eclipse/IntelliJ project with name <SapeFeeCalc<Your First Name>>
e.g. – SapeFeeCalcJoe
Please prefer to create Maven/Gradle project, in case you are using any third party
libraries (jar files) or using any framework like Spring.
If you are not comfortable with maven configuration, place the required jars in lib
folder and include jar from lib folder into build path.
5. Project Submission
We expect a complete Eclipse/IntelliJ project. It is not recommended to submit java
files without any project structure.
Delete these folders, if any of these folders exist. These folders are very heavy and
exponentially increase the size of ZIP file.
.git, .svn, .metadata, RemoteSystemTempFiles
Delete everything inside bin, target or build folders, if any of those folders exist.
These files are not required and gets automatically generated when the project is
imported into any IDE (Eclipse/IntelliJ).
Zip the folder e.g. C:\Users\Public\SapeFeeCalcJoe and save the zip with same name,
e.g.: SapePerCapitaJoe.zip
In case you are unable to zip the third part jar files, create a file named
dependencies.txt and mention the names of all of the dependencies, place
dependencies.txt in the project folder.
Send the zip file, e.g.: SapeFeeCalcJoe.zip
publicissapient.com