seQura backend coding challenge

Welcome to seQura’s backend code challenge!

This challenge is for candidates applying to the Senior Backend Engineer position. It reflects a simplified version of the types of problems we tackle daily at seQura.

Our goal is to evaluate your pragmatism, precision, clarity, ownership, production-readiness, adaptability, and thoughtful use of tools. A successful candidate is someone who can balance technical skills with strong communication and a product-focused mindset.

Context

At seQura, we provide e-commerce businesses with a flexible payment method that allows shoppers to split their purchases into three installments without any additional cost. In exchange, seQura earns a fee for each purchase.

When shoppers use this payment method, they pay directly to seQura. Then, seQura disburses payments to merchants with different frequencies and pricing structures.

This challenge focuses on implementing the process of paying merchants while meeting specific business and technical requirements.

Problem statement

Your task is to build a system to automate the calculation of merchant disbursements and seQura commissions for new and existing orders (found in the CSV files provided) and prepare it to handle new orders in the future.

Disbursement processing requirements

A disbursement groups all the orders for a merchant in a given day or week. The system must:

Disbursement processing must occur daily and be completed by 8:00 UTC, including only merchants eligible for disbursement that day. Merchants can have one of two disbursement schedules:

Commission calculations

For each order, calculate seQura’s commission fee based on the order amount:

Commissions will be subtracted from the merchant order value gross of the current disbursement.

Monthly minimum fee

At the start of each month, we have to ensure the minimum_monthly_fee for the previous month was reached. The minimum_monthly_fee ensures that seQura earns at least a given amount for each merchant.

When a merchant generates less than the minimum_monthly_fee of orders commissions in the previous month, we will charge the amount left, up to the minimum_monthly_fee configured, as a “monthly fee.” Nothing will be charged if the merchant generated more fees than the minimum_monthly_fee.

Charging the minimum_monthly_fee is out of the scope of this challenge. It is not subtracted from the disbursement commissions. Just calculate and store it for later usage.

Important note:

Remember that we are dealing with monetary values, so calculations must be handled with precision. Always round up to two decimal places for every amount.

Data

Merchants sample

ID REFERENCE EMAIL LIVE_ON DISBURSEMENT_FREQUENCY MINIMUM_MONTHLY_FEE
2ae89f6d-e210-4993-b4d1-0bd2d279da62 treutel_schumm_fadel info@treutel-schumm-and-fadel.com 2022-01-01 WEEKLY 29.0
6596b87d-7f13-460f-ba1a-00872c770092 windler_and_sons info@windler-and-sons.com 2021-05-25 DAILY 29.0
70de4478-bfa8-4c4c-97f1-4a0a149f8264 mraz_and_sons info@mraz-and-sons.com 2020-03-20 WEEKLY 0.0
52f0e308-4a9d-4b32-ace4-c491f457d9a5 cummerata_llc info@cummerata-llc.com 2019-02-04 DAILY 35.0

Download merchants CSV

Orders sample

ID MERCHANT REFERENCE AMOUNT CREATED_AT
056d024481a9 treutel_schumm_fadel 61.74 2023-01-01
33c80364591c cummerata_llc 293.08 2023-01-01
5eaeabf54862 mraz_and_sons 373.33 2023-01-01
70530cdc7b59 treutel_schumm_fadel 60.48 2023-01-01
871e0d072782 mraz_and_sons 213.97 2023-01-01

Download orders CSV

The provided CSV files contain sample data for merchants and orders. Assume the data is correct, but your system should handle edge cases gracefully, such as missing or invalid data, to ensure production-readiness.

What you need to deliver

This section outlines the deliverables expected for the challenge. It explains what you need to calculate, design, and present to complete the task.

We expect you to:

  1. Design and implement the necessary data structures and a way to persist data. You don’t need to follow the CSV schema if another structure suits the problem better.
  2. Calculate and store the disbursements for all provided orders and ensure the system is ready to process new orders.
  3. Complete the following table and include it in your README. Ensure the data is complete and clearly structured for reporting purposes:
Year Number of disbursements Amount disbursed to merchants Amount of order fees Number of monthly fees charged Amount of monthly fees charged
2022 365 50,023.45 € 750.34 € 50 650.00 €
2023 400 75,000.35 € 950.43 € 49 750.00 €

The values in this table are examples and not the expected results.

How to approach the challenge

This section explains the mindset and practices we encourage you to adopt while solving the challenge. It’s about how you approach the work, communicate your thought process, and align with our values.

  1. Be pragmatic: Build the Best Simple System for Now—a solution that solves the problem effectively while remaining adaptable and easy to iterate on. Avoid overengineering.
  2. Communicate effectively:
    • Share your thought process, including:
      • Decisions you made and why.
      • Decisions you didn’t take and your reasoning.
    • Include your assumptions, trade-offs, and any areas left incomplete due to time constraints.
  3. Demonstrate ownership:
    • Make decisions confidently and justify them.
    • Ask any question to us (the hiring team) if something is unclear, ideally, as you would to stakeholders in a real-world scenario.
  4. Design, test, develop, document: Treat this solution as production-ready code. Commit your changes as if this were a real-world feature.
    • You may implement your solution in any programming language. While we are most familiar with JavaScript, Ruby, Python, Go, Elixir, Java, Kotlin, and PHP, feel free to use the language you are most comfortable with.
    • Your experience level will also be taken into consideration during evaluation.
    • We value clarity, maintainability, and problem-solving over the specific technology used.
  5. AI usage and workflow (optional):
    If you typically use AI tools (like Copilot, Supermaven, Cursor, … for coding and productivity workflows, or ChatGPT, Claude, Gemini, … for idea refinement, deeper insights and assistance) as part of your workflow, we are happy to see you use them in this challenge as well.

    Using AI won’t give you extra points, and not using it won’t count against you either.

    However, if you do choose to use AI, we’d love to understand how you integrated it into your process. Specifically:

    • Which tools you used.
    • The prompts or instructions you provided (sharing a link to the conversation like this, when available and if it makes sense).
    • How you tailored the AI’s outputs to your needs.
    • Your reasoning behind using (or not using) AI for specific parts of the challenge.

Submission instructions

When you’re done, make sure that you:

  1. Created a README file explaining:
    • How to set up and run your solution.
    • An explanation of your technical choices, trade-offs, and assumptions.
    • Areas you would improve given more time.
    • (Optional) How you used AI tools, if applicable. We’d love to understand how you integrated it into your process (see point 5 in How to approach the challenge
  2. Included all your code and the .git folder in a zip file to show your commit history.
  3. Send your submission to your hiring contact.

We’re excited to see your solution and learn more about how you think and work!