Scan to access the challenge repository
Scan with your phone to quickly access the GitHub repository
Time Limit: 1.5 hours β°
Core Task: Modernize banking client code to integrate with our REST API
Supported Languages: Java, Python, or JavaScript only
Goal: Demonstrate code modernization skills, apply best practices, and upgrade legacy implementations to current standards
Start the server:
docker run -d -p 8123:8123 singhacksbjb/sidequest-server:latestπ Need Java installed? See our comprehensive setup guide: SETUP.md
Quick Java Check:
java -version
# Should show Java 17 or higherIf you don't have Java 17+, follow the setup guide for installation instructions for your platform.
-
Navigate to server folder:
cd server -
The JAR file is located here:
core-banking-api.jar -
Start the server:
java -jar core-banking-api.jar
- Server runs on:
http://localhost:8123 - Alternative port:
java -Dserver.port=8080 -jar core-banking-api.jar
- Server runs on:
-
Verify server is running:
curl http://localhost:8123/accounts/validate/ACC1000
- Swagger UI: http://localhost:8123/swagger-ui.html
- API Documentation: http://localhost:8123/v3/api-docs
- Quick Test: Use the provided demo_curls_no_jq.sh script
π Run the demo script:
# Make it executable and run
chmod +x demo_curls_no_jq.sh
./demo_curls_no_jq.shThis script demonstrates all API endpoints with authentication, transfers, and validation examples.
Your mission is to:
- Analyze the provided legacy code examples (see below)
- Modernize and refactor using current best practices
- Implement proper REST API integration for the
/transferendpoint - Apply modern coding standards and design patterns
Minimum Transfer Request:
{
"fromAccount": "ACC1000",
"toAccount": "ACC1001",
"amount": 100.00
}Example Success Response:
{
"transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "SUCCESS",
"message": "Transfer completed successfully",
"fromAccount": "ACC1000",
"toAccount": "ACC1001",
"amount": 100.00
}- Python: Upgrade from 2.7 to 3.x syntax, use modern libraries (requests, asyncio, etc.)
- JavaScript: Convert ES5 to ES6+, use modern APIs (fetch, async/await, modules)
- Java: Upgrade from Java 6 to 11+, use modern features (HTTP Client, var keyword, streams)
- Replace legacy HTTP libraries with modern alternatives
- Implement proper async/await patterns where applicable
- Add connection pooling and timeout configuration
- Use structured JSON handling instead of string concatenation
- Replace print statements with proper logging frameworks
- Implement structured exception handling
- Add meaningful error messages and user feedback
- Include proper HTTP status code handling
- Implement JWT authentication with proper token management
- Add input validation and sanitization
- Use secure configuration management
- Implement proper credential handling
- Apply SOLID principles and clean code practices
- Implement dependency injection where appropriate
- Use modern design patterns (Builder, Factory, etc.)
- Separate concerns with proper layering
- Add comprehensive unit and integration tests
- Implement proper configuration management
- Use modern build tools and dependency management
- Add code quality tools (linting, formatting)
- Add containerization (Docker)
- Implement CI/CD pipeline concepts
- Add health checks and monitoring
- Use environment-based configuration
- Create modern CLI with proper argument parsing
- Build responsive web interface with modern frameworks
- Add interactive features and real-time updates
- Implement proper user feedback and validation
- Implement connection pooling and caching
- Add retry logic with exponential backoff
- Use async programming patterns effectively
- Add performance monitoring and metrics
- Code Refactoring: Ask AI to modernize legacy code patterns
- Best Practices: Get recommendations for current language standards
- Library Migration: Find modern alternatives to deprecated libraries
- Testing: Generate unit tests for refactored code
- Documentation: Create migration guides and code comments
"Modernize this Python 2.7 code to Python 3.x with best practices"
"Convert this ES5 JavaScript to modern ES6+ with async/await"
"Upgrade this Java 6 code to Java 11+ using modern HTTP client"
"Add proper error handling and logging to this legacy code"
"Generate unit tests for this modernized banking client"
"Create a modern CLI interface replacing this legacy implementation"
| Category | Points | Description |
|---|---|---|
| Core Modernization | 40 pts | Successfully modernized legacy code to work with API |
| Code Quality | 20 pts | Clean, modern, well-organized code |
| Language Modernization | +10 pts | Proper upgrade to current language standards |
| HTTP Client Modernization | +10 pts | Modern HTTP libraries and patterns |
| Error Handling & Logging | +10 pts | Professional error management and logging |
| Architecture & Design | +15 pts | Modern design patterns and best practices |
| Testing & Documentation | +10 pts | Unit tests, README, migration notes |
| Innovation | +5 pts | Creative modernization solutions |
Total Possible: 120 points (60 base + 60 modernization bonus)
# Legacy Python 2.7 code - MODERNIZE THIS!
import urllib2
import json
def transfer_money(from_acc, to_acc, amount):
# Old-style string formatting
url = "http://localhost:8123/transfer"
# Manual JSON encoding
data = '{"fromAccount":"' + from_acc + '","toAccount":"' + to_acc + '","amount":' + str(amount) + '}'
# Old urllib2 approach
req = urllib2.Request(url, data)
req.add_header('Content-Type', 'application/json')
try:
response = urllib2.urlopen(req)
result = response.read()
print "Transfer result: " + result
return result
except urllib2.HTTPError, e:
print "Error: " + str(e.code)
return None
# Usage - old style
if __name__ == "__main__":
transfer_money("ACC1000", "ACC1001", 100.00)π― Modernization Tasks:
- Upgrade to Python 3.x syntax
- Use modern
requestslibrary - Add proper error handling and logging
- Implement configuration management
- Add type hints and documentation
- Use f-strings and modern formatting
// Legacy ES5 JavaScript - MODERNIZE THIS!
function transferMoney(fromAccount, toAccount, amount) {
// Old XMLHttpRequest approach
var xhr = new XMLHttpRequest();
var url = "http://localhost:8123/transfer";
// Manual JSON string building
var data = '{"fromAccount":"' + fromAccount + '","toAccount":"' + toAccount + '","amount":' + amount + '}';
xhr.open("POST", url, false); // Synchronous - BAD!
xhr.setRequestHeader("Content-Type", "application/json");
try {
xhr.send(data);
if (xhr.status == 200) {
var result = JSON.parse(xhr.responseText);
console.log("Transfer successful: " + result.transactionId);
return result;
} else {
console.log("Error: " + xhr.status);
return null;
}
} catch (e) {
console.log("Request failed: " + e.message);
return null;
}
}
// Usage - old style
transferMoney("ACC1000", "ACC1001", 100.00);π― Modernization Tasks:
- Convert to ES6+ syntax (const/let, arrow functions)
- Use modern
fetchAPI oraxios - Implement async/await pattern
- Add proper error handling with try/catch
- Use template literals for strings
- Add input validation and sanitization
- Implement proper logging and debugging
// Legacy Java 6 code - MODERNIZE THIS!
import java.io.*;
import java.net.*;
public class BankingClient {
private String baseUrl = "http://localhost:8123";
public String transferFunds(String fromAccount, String toAccount, double amount) {
try {
// Old URL and HttpURLConnection approach
URL url = new URL(baseUrl + "/transfer");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// Manual JSON string building
String jsonData = "{\"fromAccount\":\"" + fromAccount +
"\",\"toAccount\":\"" + toAccount +
"\",\"amount\":" + amount + "}";
// Old-style connection setup
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
// Manual stream handling
OutputStream os = conn.getOutputStream();
os.write(jsonData.getBytes());
os.flush();
os.close();
// Manual response reading
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
StringBuffer response = new StringBuffer();
while ((line = br.readLine()) != null) {
response.append(line);
}
br.close();
System.out.println("Response: " + response.toString());
return response.toString();
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
return null;
}
}
// Usage - old style
public static void main(String[] args) {
BankingClient client = new BankingClient();
client.transferFunds("ACC1000", "ACC1001", 100.00);
}
}π― Modernization Tasks:
- Upgrade to Java 11+ features (var, HTTP Client API)
- Use modern JSON libraries (Jackson, Gson)
- Implement proper exception handling
- Add logging framework (SLF4J, Logback)
- Use dependency injection and configuration
- Add unit tests with JUnit 5
- Implement builder patterns and immutable objects
- Use modern HTTP client libraries
- Repository URL:
https://github.com/SingHacks-2025/julius-baer-side-quest(provided by instructor) - Fork the repository to your GitHub account
- Clone your fork locally:
git clone https://github.com/SingHacks-2025/julius-baer-side-quest.git cd core-banking-hackathon-submissions
-
Create a folder in
/submissions/named after your GitHub username:mkdir submissions/your-github-username cd submissions/your-github-username -
Example structure:
submissions/ βββ mark-h/ β βββ banking_client.py β βββ README.md β βββ requirements.txt βββ john-doe/ β βββ BankingClient.java β βββ README.md β βββ pom.xml βββ your-github-username/ βββ [your solution files] βββ README.md
-
Add and commit your files:
git add submissions/your-github-username/ git commit -m "Add banking client solution by [your-name]" -
Push to your fork:
git push origin main
-
Create Pull Request:
- Go to your fork on GitHub
- Click "New Pull Request"
- Title:
Banking Client Solution - [Your Name] - Description: Include language used, key features implemented, and how to run
Use this template in your PR description:
## Hacker Submission
**Name**: [Your Full Name]
**GitHub Username**: [your-username]
**Email**: [[email protected]]
**LinkedIn**: [https://linkedin.com/in/your-profile]
**Programming Language**: [Java/Python/JavaScript]
**Time Spent**: [e.g., 1.5 hours]
### Features Implemented
- [x] Core transfer functionality
- [x] JWT authentication (if implemented)
- [x] Error handling (if implemented)
- [ ] Additional features...
### How to Run
# Your setup and run commands here
# Example:
# python banking_client.py
# or
# java -cp . BankingClient
### Bonus Features
- Brief description of any bonus features implemented
### Questions/Notes
- Any questions or notes for the mentor
If GitHub is not accessible or you prefer this method:
-
Create a project folder:
mkdir banking-client-[your-github-username] cd banking-client-[your-github-username] -
Add your solution files:
- Source code files
- README.md with setup instructions
- Dependencies file (requirements.txt, package.json, etc.)
- Any test files
-
Create the ZIP file:
# Navigate back to parent directory cd .. # Create ZIP file zip -r banking-client-[your-github-username].zip banking-client-[your-github-username]/
send it to [email protected]
-
Submit the ZIP file as instructed by your mentor
- Source Code: Your client implementation
- README.md: Setup instructions, usage examples, features implemented
- Dependencies:
requirements.txt,package.json,pom.xml, etc. (if applicable) - Tests: Test files (bonus points)
- Documentation: Any additional docs or screenshots
- Deadline: Submit within 1.5 hours of starting
- Folder Naming: Use your GitHub username exactly (case-sensitive)
- No Merge Conflicts: Pull latest changes before pushing if using folder method
- File Size: Keep submissions under 10MB (no large binaries)
- Public Repository: The challenge repo is public - your solution will be visible to others after submission
- 20 min: Setup, explore API, plan approach
- 50 min: Implement core transfer functionality
- 20 min: Add one bonus feature (auth or validation)
- 10 min: Documentation and cleanup
- First: Get basic transfer working
- Second: Add JWT authentication
- Third: Add error handling
- Fourth: Choose one advanced feature
- Last: Polish documentation
- Don't spend too much time on UI if you're not comfortable with it
- Don't try to implement all bonus features - pick 2-3 and do them well
- Don't forget to test your client against the actual server
- Don't skip documentation - it's easy bonus points
| Method | Endpoint | Purpose | Auth Required |
|---|---|---|---|
POST |
/authToken |
Get JWT token | No |
POST |
/transfer |
Transfer funds | No (bonus if yes) |
GET |
/accounts |
List accounts | No (bonus if yes) |
GET |
/accounts/validate/{id} |
Validate account | No (bonus if yes) |
| Method | Endpoint | Purpose | Auth Required |
|---|---|---|---|
POST |
/auth/validate |
Validate JWT | Yes |
GET |
/transactions/history |
Transaction history | Yes |
GET |
/accounts/balance/{id} |
Account balance | No (bonus if yes) |
- Valid: ACC1000-ACC1099 (can send/receive funds)
- Invalid: ACC2000-ACC2049 (transfers will fail)
- Non-existent: All others (transfers will fail)
- Focus on meaningful modernization over cosmetic changes
- Use AI tools to accelerate the refactoring process
- Test frequently against the live server during modernization
- Document your modernization decisions in the README
- Show before/after comparisons to highlight improvements!
Remember: The goal is to demonstrate your ability to modernize legacy code using current best practices. A well-refactored, working solution with clear improvements beats a complex rewrite that doesn't work!
Good luck! π
Questions? Ask your mentor or check the Swagger UI at http://localhost:8123/swagger-ui.html
