Skip to content

Instantly share code, notes, and snippets.

@ethan-wello
Last active November 24, 2025 09:10
Show Gist options
  • Select an option

  • Save ethan-wello/0bb67dfda102f4bc99a16e73ee7214df to your computer and use it in GitHub Desktop.

Select an option

Save ethan-wello/0bb67dfda102f4bc99a16e73ee7214df to your computer and use it in GitHub Desktop.
Interview Question

Interview Questions

Table of Contents

  1. Wello Airdrop
  2. Combine Transactions
  3. Stablecoin Acquiring

1. Wello Airdrop

Overview

To reward user enthusiasm, Wello has decided to conduct an airdrop for its active users. Ethan, a developer at Wello, has exported a recent transaction log to identify active user addresses.

Requirements

Input Data

Each transaction contains:

  • from: sender wallet address
  • to: receiver wallet address
  • amount: transaction amount

Active User Definition

A wallet address is considered active if:

  • It is involved in at least n transactions (either as sender or receiver)
  • The total amount it has sent or received is greater than m

Input Parameters

  • List of transactions with from, to, and amount
  • Two integers:
    • n: minimum number of transactions
    • m: minimum total amount

Output

  • List of wallet addresses that qualify as active users

Example

// input
transactions = [
 { "from": "0xA", "to": "0xB", "amount": 50 },
 { "from": "0xB", "to": "0xC", "amount": 30 },
 { "from": "0xA", "to": "0xC", "amount": 20 },
 { "from": "0xC", "to": "0xA", "amount": 10 },
 { "from": "0xA", "to": "0xB", "amount": 40 }
]
n = 3
m = 60

// output
// Explanation:
// • Address "A" is involved in 4 transactions with a total amount of 120 → qualifies
// • Address "B" is involved in 3 transactions with a total amount of 120 → qualifies
// • Address "C" is involved in 3 transactions, but total amount is 60 → does not qualify (must be greater than m)
["0xA", "0xB"]

2. Combine Transactions

Overview

To optimize system resources, Wello needs to batch transactions together. The challenge is to determine the maximum number of transactions that can be included in a batch while maintaining valid account balances.

Requirements

Input Data

Each transaction contains:

  • from: sender wallet address
  • to: receiver wallet address
  • amount: transaction amount

Balance Constraints

  • No address can have a negative net balance after processing transactions
  • Net balance = (incoming amounts) - (outgoing amounts)

Input Parameters

  • List of transactions with from, to, and amount fields

Output

  • Maximum number of transactions that can be included while maintaining valid balances

Example

// input
balance = {
  "0xA": 9,
  "0xB": 10,
  "0xC": 11
}
transactions = [
  { "from": "0xA", "to": "0xB", "amount": 10 },
  { "from": "0xB", "to": "0xC", "amount": 5 },
  { "from": "0xC", "to": "0xA", "amount": 5 },
  { "from": "0xA", "to": "0xC", "amount": 15 }
]

// output
3

// Explanation:
//  • If we include the first 3 transactions:
//  • A: 9 - 10 + 5 = 4
//  • B: 10 + 10 - 5 = 15  
//  • C: 11 + 5 - 5 = 11
// → All balances remain positive
//  • Adding the 4th transaction (A -> C 15) would make A's balance -11, which is invalid
//  • Therefore, the maximum number of transactions that can be included while maintaining valid balances is 3

3. Design a Stablecoin Payment Processing System

Problem Statement

Design a system that enables merchants to accept stablecoin payments from customers, with features for merchant onboarding, payment processing, and settlement.

Actors

  • Merchant: Wants to accept stablecoins for their products
  • Customer: Pays with stablecoins via their own wallet (e.g. MetaMask, WalletConnect)
  • Wello: Provides the payment infrastructure and interfaces

Possible Solution Structure (Ideal answer from interviewee)

  1. Merchant Management

    • Merchant onboarding and account creation
    • Generate payment requests via API/SDK
    • View transaction history and settlements
    • Process refunds
  2. Payment Processing

    • Generate QR codes/payment links for customers
    • Support wallet connections (MetaMask, WalletConnect)
    • Real-time payment status tracking
    • Support multiple stablecoins (e.g. USDC)
  3. Blockchain Integration

    • Monitor blockchain for incoming transactions
    • Validate transaction details (token, amount, sender)
    • Track confirmation status
    • Smart contract interaction
  4. Settlement System

    • Record confirmed transactions
    • Calculate merchant balances
    • Support auto-conversion to fiat
    • Manage custody wallets
  5. Security & Compliance

    • Fraud detection
    • Rate limiting
    • Transaction monitoring
    • KYB/KYC where required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment