0% found this document useful (0 votes)
20 views4 pages

Backend Task

Task for software

Uploaded by

mbhaiya005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

Backend Task

Task for software

Uploaded by

mbhaiya005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

📌Integration

Backend Task – Broker


Layer (One-Way
Sync)
Welcome to the second round of the backend engineering assessment for
Journalyst – our trade journaling platform.
This task is designed to test your ability to design clean architecture, write
modular code, and think through real-world backend systems.

⚠️ IMPORTANT:
Do not use AI tools (like ChatGPT/Copilot) to generate code or make
design decisions.

You are encouraged to refer to official documentation (e.g., Zerodha


Kite Connect API, Alpaca Docs) to understand how real broker APIs work.

Implement it with Typescript, strictly do not use Javascript.

🚀 Goal
Design and implement the backend module that syncs trades from third-party
brokers (eg., Zerodha, MetaTrader etc….). This is a core part of Journalyst's
Automated Broker Sync feature.
You’ll build:

A broker adapter (for one broker)

A data normalizer

Sync logic with token handling

Clear architecture for scaling to other brokers

🧩 What You’ll Build


1. Broker Adapter System
Implement one adapter (e.g., for Zerodha, MetaTrader etc….)

📌 Backend Task – Broker Integration Layer (One-Way Sync) 1


Define a reusable interface

Simulate fetching trade data

NOTE: If you have the ability to generate API keys and tokens, please do
so. If not, simply implement the code as though the API keys and tokens are
already available. The code may not be executable without valid keys, but
we will test it using our own API keys.

2. Trade Data Normalization


You must design the normalization logic yourself.

Real brokers return data in different formats — your task is to study the
structure and convert it into your own consistent format.

Choose relevant fields like symbol, quantity, prices, timestamps, etc.

Do not copy any example schema — use your own skills to build your own
Trade object.

3. Token Management
Simulate per-user token storage (in-memory is okay)

Implement basic token expiry & refresh flow

4. Sync Execution Logic


Create a function: syncTrades(userId, brokerName)

Fetch token → Refresh if needed → Fetch trades → Normalize → Return


trades

Add minimal error handling (invalid token, no trades, etc.)

5. Architecture Design
Structure code into adapters, services, utils, etc.

Make it easy to extend and test

📄 What to Submit
Source code in a public/private GitHub repo

A short README explaining:

📌 Backend Task – Broker Integration Layer (One-Way Sync) 2


Your design decisions

How to add a new broker

Assumptions or simplifications made

Architecture diagram (Markdown, draw.io, or Excalidraw)

(Optional) Sample Postman collection or curl example

(Optional) Walkthrough video link

🧪 Standard Practices We Value


Complete type safety with Typescript

Clean folder structure and modular code

Clear, meaningful function and variable names

Error handling and edge case awareness

Extensibility – your system should be easy to grow

(Optional) Basic testing (even 1–2 tests is appreciated)

💡 Bonus (Not Mandatory)


Provide unit tests for the normalizer or sync logic

Include a docker-compose file for local setup

Add caching or retry logic for failed syncs

📬 Submission
Source code in a public/private GitHub repo

A short README explaining:

Your design decisions

How to add a new broker

Assumptions or simplifications made

Architecture diagram (Markdown, draw.io, or Excalidraw)

(Optional) Sample Postman collection or curl example

(Optional) Walkthrough video link

📌 Backend Task – Broker Integration Layer (One-Way Sync) 3


If you have questions during the task, feel free to reach out — but we expect
you to make key architectural decisions yourself.

📌 Backend Task – Broker Integration Layer (One-Way Sync) 4

You might also like