CODING TEST

CODING TEST

Problem Statement Consider a inter dealer-broker network which various financial stock brokers use to execute customer stock trading orders. Everytime a customer needs to buy/sell a stock; it reaches out to its designated broker who then uses this broker-network to buy/sell the stock at the current market price. When the trade gets executed between two customers through brokers, it gets assigned a unique identifier called ââ?¬Å?TransIdââ?¬Â?. While trades get executed during the day, money settlement between the customers happens at the end of the day. To find out how much money needs to be transferred between buying/selling customers, every broker produces following report at end of day, which lists customer specific transactions as below:

Report from Broker Alpha

TransId Security Currency Volume Price TransType CustomerId
1112 114CD USD 100000 16.72 BUY 447FG
1113 121XQ EUR 50000 45.24 SELL 432DF
1114 178AA CHF 80000 24.00 BUY 444AK

Report from Broker Beta

TransId Security Currency Volume Price TransType CustomerId
1112 114CD USD 100000 16.72 SELL 852KS
1115 136RT GBP 50000 63.568 BUY 851GF

This data is first fed into a third-party Reconciliation System that first reconciles transaction data from various brokers based on the ââ?¬Å?TransIdââ?¬Â?. Reconciled trades are then fed into a central Accounting System that generates payment orders.

You need to write code ââ?¬Å?ONLYââ?¬Â? for this Reconciliation System (not Accounting System) based on the specifications below. Specifications The trade data from a broker is in the form of a CSV file (comma separated values), with the following fields: ââ?¬Â¢ TransId ââ?¬â?? Unique identifier for the transaction/trade. It will be same for a set of matching transactions. ââ?¬Â¢ Security ââ?¬â?? Financial security identifier (e.g. for Reliance stocks, this would be RIL). ââ?¬Â¢ Currency ââ?¬â?? 3-letter currency code for the transaction/trade. ââ?¬Â¢ Volume ââ?¬â?? Number of units of the traded security. ââ?¬Â¢ Price ââ?¬â?? Unit price of the traded security. ââ?¬Â¢ TransType ââ?¬â?? Type of transaction/trade from customerââ?¬â?¢s perspective. - BUY or SELL. For a valid trade, if one customer has ââ?¬Å?BUYââ?¬Â? for a security, then there must be another customer having ââ?¬Å?SELLââ?¬Â?. ââ?¬Â¢ CustomerId ââ?¬â?? Broker specific identifier for the customer who raised trade request with the broker. The system should be able to perform the following functions: ââ?¬Â¢ Load the trade data files from various brokers, and match transactions data. ââ?¬Â¢ Transaction data should be ââ?¬Å?matchedââ?¬Â? based on ââ?¬Å?TransIdââ?¬Â?. Following fields should be compared for differences: 1. Security 2. Currency 3. Volume 4. Price (Price data should be matched by rounding up to 2 decimal places) ââ?¬Â¢ If differences are found, output should be written to a differences file in the following format: TransId, Security, BrokerAName, BrokerBName, DiffFieldName, ValueA, ValueB ââ?¬Â¢ The above differences should be sorted by ââ?¬Å?Securityââ?¬Â? in the output differences file. ââ?¬Â¢ If for a given TransId, an opposite matching trade is not found, then that data should be stored in a separate file, so that it could be processed in the next dayââ?¬â?¢s run. Here we assume that the matching transaction might arrive in the next runââ?¬â?¢s input file from the other broker. (Hint: Consider this pending data as the additional file to be processed for comparison) ââ?¬Â¢ If the system is not able to find any disparities between the transaction data from multiple brokers during a process run, then the message ââ?¬Å?No differences found for last process runââ?¬Â? should be written to the output. Exception Scenarios: ââ?¬Â¢ If the ââ?¬Å?Currencyââ?¬Â? for a transaction is not a 3-letter code, then return a user-friendly error and log to a common exception output, but the process should continue to run for rest of the transactions within that file. ââ?¬Â¢ If the ââ?¬Å?TransTypeââ?¬Â? is either BUY or SELL for both sides of a transaction, then return a user-friendly error and log to a common exception output, but the process should continue to run for rest of the transactions.

Other Instructions Please keep following instructions in mind: � Do not write boiler-plate code for reading/writing from the file. Mock the function that does these things. � The solution should be scalable enough to accommodate input transaction files from multiple brokers, and considering that each broker could have hundreds of transactions in corresponding input file. The solution should be able to run the whole comparison process in minimum time possible.

Evaluation criteria � Code Completeness/ Correctness � Code Structure and quality: Modularity, usage of OO principles, size of classes/functions, class/function/variable names, package/class structure � Choice of data structures � Unit Test cases � Coding productivity (more time you take to submit the exercise, lesser you will score) Better you perform on this criteria, higher you will score.

View Answers









Related Tutorials/Questions & Answers:
CODING TEST
CODING TEST  Problem Statement Consider a inter dealer-broker network.../class structure ââ?¬Â¢ Choice of data structures ââ?¬Â¢ Unit Test cases ââ?¬Â¢ Coding productivity (more time you take to submit the exercise, lesser you
CODING TEST
CODING TEST  Problem Statement Consider a inter dealer-broker network.../class structure ââ?¬Â¢ Choice of data structures ââ?¬Â¢ Unit Test cases ââ?¬Â¢ Coding productivity (more time you take to submit the exercise, lesser you
Advertisements
ModuleNotFoundError: No module named 'coding-test-foo'
ModuleNotFoundError: No module named 'coding-test-foo'  Hi, My... named 'coding-test-foo' How to remove the ModuleNotFoundError: No module named 'coding-test-foo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'coding-test-foo'
ModuleNotFoundError: No module named 'coding-test-foo'  Hi, My... named 'coding-test-foo' How to remove the ModuleNotFoundError: No module named 'coding-test-foo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'coding-test-foo'
ModuleNotFoundError: No module named 'coding-test-foo'  Hi, My... named 'coding-test-foo' How to remove the ModuleNotFoundError: No module named 'coding-test-foo' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'coding-test-foo'
ModuleNotFoundError: No module named 'coding-test-foo'  Hi, My... named 'coding-test-foo' How to remove the ModuleNotFoundError: No module named 'coding-test-foo' error? Thanks   Hi, In your python
coding
coding  I need the logout coding. can you please help me.   Please visit the following links: http://www.roseindia.net/quickguide/tomcat/Logout.shtml http://www.roseindia.net/jsp/loginstatus.shtml
coding for project
coding for project  hai how to write jsp coding for project smart accessories ...... that s to navigate to another page when you click on a tag
program coding
program coding  how to rearrange the array a[1]. . a[n] even elements and odd elements? please give the example coding program.please provide the coding for this problem
Java Coding
Java Coding  Hello, Can u please tel me how to improve my coding techniques.I am feeling difficulty with coding but I am perfect with my theory part
coding for chart
coding for chart  I want to convert a character into binary then convert it into its diagram in form of digital electrical signals.How can I do java coding for this diagram
coding of button
coding of button  What is code of fetching the value of button in a textbox using javascript
program coding
program coding  how to rearrange the array a[1]. . a[n] even elements and odd elements? please give the example coding program
coding C
coding C  Write a program for a GENERAL NUMBER CONVERTERS which include binary, decimal, octa and hexadecimal. You need to write the program using C language
coding for login page
coding for login page  coding for login page
coding for anchor tags
coding for anchor tags  coding for anchor tags
coding for anchor tags
coding for anchor tags  coding for anchor tags
coding for anchor tags
coding for anchor tags  coding for anchor tags
coding for anchor tags
coding for anchor tags  coding for anchor tags
coding for online reservation
coding for online reservation  coding for online reservation
coding for updating profile
coding for updating profile  coding for updating profile
coding for forgot password
coding for forgot password  coding for forgot password
coding for update profile
coding for update profile  coding for update profile
coding for deleting file
coding for deleting file  coding for deleting file
need coding
need coding  sir i need code for simple bank application in jsp please send it   sir i need the coding for simple bank application in jsp.   Please visit the following link: Jsp Bank Application
Coding with Ejb
Coding with Ejb  Hi Team, I am learning Ejb now. Can anybody help me how to implement this Stateful Session Bean Example by using this Hibernate example. Thanks in advance.   Sorry, actually I want simple code adding
coding shape
coding shape  i need to write a simple java program. the system must be in an applet and allows a user to choose whether to draw shapes such as circles, rectangles or lines on the screen. also, user can add circles by choosing
coding in java
coding in java  write a code to calculate the product of odd integers from 1-15   class ProductOfOddIntegers { public static void main(String[] args) { long product=1; for(int i=1;i<=15;i
CODING
coding
coding
coding
coding
coding
coding
coding
coding for logout - Development process
coding for logout  hi.. coding for logout using the session in jsp
coding for emloyee managent system
coding for emloyee managent system  coding for employee management system
coding for employee management system
coding for employee management system  coding for employee management system
coding for re-type password
coding for re-type password  coding for re-type password
Coding In Paradise
Coding In Paradise       Excellent and thoughtful AJAX tutorials and techniques by Brad Neuberg Read full DescriptionADS_TO_REPLACE_1
Home page coding
Home page coding  coding fot html
Java coding - WebSevices
Java coding for web services  How to start Java Coding for web services
coding in jsp & servlet
coding in jsp & servlet  plz... provide me coding of "online examination system" in jsp & servlet
coding for gnerating timesheet
coding for gnerating timesheet  hi.... how to do coding for generating timesheet of the employees...working in the office
coding for railway reservation project
coding for railway reservation project  i want to help for creating coding in visual basic for railway reservation project
ModuleNotFoundError: No module named 'coding'
ModuleNotFoundError: No module named 'coding'  Hi, My Python... 'coding' How to remove the ModuleNotFoundError: No module named 'coding'... to install padas library. You can install coding python with following command
ModuleNotFoundError: No module named 'coding'
ModuleNotFoundError: No module named 'coding'  Hi, My Python... 'coding' How to remove the ModuleNotFoundError: No module named 'coding'... to install padas library. You can install coding python with following command
Coding for life cycle in threads
Coding for life cycle in threads  program for life cycle in threads
complete coding for shopping card
complete coding for shopping card  complete coding for shopping card   Please visit the following link: Shopping Cart Application

Ads