GoCardless interview questions & answers

9 real GoCardless interview questions with full model answers — Technical, Behavioral, Coding, System design. Drawn from the same verified bank ChannelPulse drills from (9 GoCardless questions in total).

BehavioralMediumGoCardlessSoftware EngineerFinal-round interview

1. Which parts of your previous job did you most enjoy, and which parts would you avoid in the future?

Model answer

  1. Situation — In my previous role, I worked on a product team responsible for customer-facing workflows and the services behind them. I enjoyed the mix of implementation, collaboration, and learning from production, but I also saw how team habits could either protect engineering time or steadily erode it.
  2. Task — I wanted to be clear about the work that brought out my best contribution, while recognizing that every engineering role includes some less enjoyable work that still needs to be done well.
  3. Action
  • I most enjoyed taking an ambiguous customer or operational problem and turning it into a small, testable change. For example, when users were confused by a failed payment flow, I worked with product and support to identify where the experience broke down, then helped ship clearer failure states and diagnostics.
  • I liked pairing and design reviews, especially when they exposed a simpler solution or a risk we could address before release. I also valued owning a change through deployment and checking whether it actually improved the outcome.
  • I particularly enjoyed debugging production issues when the team treated them as learning opportunities: establish impact, restore service, and then fix the underlying cause rather than assigning blame.
  • I would avoid a culture where priorities change repeatedly without explaining the customer or business reason. That makes it hard to finish work or make responsible trade-offs. When priorities did shift, I tried to make the cost visible and agree what would be paused.
  • I would also avoid treating operational work as somebody else’s responsibility. I’m happy to take on support and maintenance, but I want it to be shared, prioritized, and improved over time rather than an unbounded interruption stream.
  1. Result — That approach helped me deliver changes with clearer ownership and better collaboration across engineering, product, and support. In my next role, I’m looking for the same combination of meaningful customer problems, strong technical teamwork, and a culture that learns from production while making deliberate choices about priorities.
BehavioralMediumGoCardlessDevOps / SREApplication review

2. Describe a technical project or problem that you found particularly interesting.

Model answer

  1. Situation — At a payments company, a set of services that handled inbound payment events became difficult to operate during traffic spikes. I was the engineer responsible for improving the reliability of the event-processing path, where delays could mean merchants saw payment updates late.
  2. Task — I wanted to reduce processing delays and make incidents easier to diagnose, without risking duplicate or out-of-order business actions during a migration.
  3. Action
  • I traced events from the webhook endpoint through the queue and workers, then used queue age and processing latency—not just CPU—as the main indicators of customer impact.
  • I found that workers were scaling on queue depth alone, which reacted poorly to bursts of differently sized jobs. I proposed scaling on oldest-message age, with queue depth as a secondary signal.
  • I added bounded retries with exponential backoff and jitter, and routed exhausted messages to a dead-letter queue. For payment updates, I made handlers idempotent using the event ID so retries could not apply the same transition twice.
  • I worked with the service team to introduce the changes behind a feature flag. We replayed representative events in staging and compared outcomes before shifting production traffic gradually.
  • I added dashboards and runbook steps for queue age, retry rate, and dead-letter volume, then walked the on-call team through how to distinguish a downstream outage from a bad event.
  1. Result — During the next peak period, the oldest-message delay stayed below two minutes instead of reaching roughly twenty, and duplicate processing did not increase. The runbook and signals also made the next queue-related incident faster to triage. I found the project interesting because it combined distributed-systems behavior with operational design: a change is only useful if it remains safe under failure and understandable to the people on call.
CodingEasyGoCardlessSoftware EngineerIn-person interview

3. Implement a basic sorting algorithm.

Model answer

Here is an in-place bubble sort in ascending order. It stops early if a pass makes no swaps.

function bubbleSort(numbers) {
  // Compare adjacent values and move the largest remaining value to the end.
  for (let end = numbers.length - 1; end > 0; end--) {
    let swapped = false;

    for (let i = 0; i < end; i++) {
      if (numbers[i] > numbers[i + 1]) {
        [numbers[i], numbers[i + 1]] = [numbers[i + 1], numbers[i]];
        swapped = true;
      }
    }

    // The array is already sorted, so no more passes are needed.
    if (!swapped) break;
  }

  return numbers;
}

const values = [5, 1, 4, 2, 8];
console.log(bubbleSort(values)); // [1, 2, 4, 5, 8]
  • Each pass moves the largest unsorted value into its final position.
  • This version sorts the input array in place and returns it.

Complexity: Average and worst-case time O(n²); best-case time O(n); auxiliary space O(1).

CodingMediumGoCardlessSoftware EngineerCoding exercise

4. Write a client library for a real-world API or web service in a language of your choice.

Model answer

/**
 * Small GoCardless API client for Node.js 18+.
 * Supports creating a payment and retrieving/listing payments.
 */
class GoCardlessClient {
  constructor({ accessToken, baseUrl = "https://api.gocardless.com", timeoutMs = 10_000 }) {
    if (!accessToken) throw new Error("accessToken is required");
    this.accessToken = accessToken;
    this.baseUrl = baseUrl.replace(/\/$/, "");
    this.timeoutMs = timeoutMs;
  }

  async request(path, { method = "GET", query, body, idempotencyKey } = {}) {
    const url = new URL(`${this.baseUrl}${path}`);
    for (const [key, value] of Object.entries(query || {})) {
      if (value !== undefined && value !== null) url.searchParams.set(key, String(value));
    }

    // Retry transient failures only when repeating the request is safe.
    const retryable = method === "GET" || Boolean(idempotencyKey);
    const maxAttempts = retryable ? 3 : 1;

    for (let attempt = 0; attempt < maxAttempts; attempt++) {
      const controller = new AbortController();
      const timer = setTimeout(() => controller.abort(), this.timeoutMs);

      try {
        const headers = {
          Authorization: `Bearer ${this.accessToken}`,
          Accept: "application/json",
        };
        if (body !== undefined) headers["Content-Type"] = "application/json";
        if (idempotencyKey) headers["Idempotency-Key"] = idempotencyKey;

        const response = await fetch(url, {
          method,
          headers,
          body: body === undefined ? undefined : JSON.stringify(body),
          signal: controller.signal,
        });
        const text = await response.text();
        const data = text ? JSON.parse(text) : null;

        if (response.ok) return data;

        const error = new Error(
          data?.error?.message || `API request failed with HTTP ${response.status}`
        );
        error.status = response.status;
        error.details = data?.error;

        const transient = response.status === 429 || response.status >= 500;
        if (!transient || attempt === maxAttempts - 1) throw error;

        const retryAfter = Number(response.headers.get("retry-after"));
        const delayMs = retryAfter > 0
          ? retryAfter * 1000
          : 200 * 2 ** attempt + Math.random() * 100;
        await new Promise((resolve) => setTimeout(resolve, delayMs));
      } catch (error) {
        const transientNetworkError = error.name === "AbortError" || !error.status;
        if (!retryable || !transientNetworkError || attempt === maxAttempts - 1) throw error;
        await new Promise((resolve) => setTimeout(resolve, 200 * 2 ** attempt + Math.random() * 100));
      } finally {
        clearTimeout(timer);
      }
    }
  }

  async createPayment(payment, { idempotencyKey } = {}) {
    const result = await this.request("/payments", {
      method: "POST",
      body: { payments: payment },
      idempotencyKey,
    });
    return result.payments;
  }

  async getPayment(paymentId) {
    const result = await this.request(`/payments/${encodeURIComponent(paymentId)}`);
    return result.payments;
  }

  async listPayments({ limit = 50, after, before, status } = {}) {
    const result = await this.request("/payments", {
      query: { limit, after, before, status },
    });
    return { payments: result.payments, cursors: result.meta?.cursors || {} };
  }
}

// Example:
// const client = new GoCardlessClient({ accessToken: process.env.GC_TOKEN });
// const payment = await client.createPayment(
//   { amount: 2500, currency: "GBP", links: { mandate: "MD123" } },
//   { idempotencyKey: "invoice-456-payment" }
// );
  • Keep credentials outside source control; production clients should also validate inputs and redact tokens from logs.
  • Retries are bounded, and payment creation is retried only with an idempotency key to avoid duplicate charges.
  • Complexity: Each request is O(response size) time and space; retries are bounded to three attempts.
CodingMediumGoCardlessSoftware EngineerIn-person interview

5. Calculate row n of Pascal’s triangle.

Model answer

This implementation treats n as a zero-based row index: n = 0 returns [1]. It builds the row in place, updating from right to left so each value uses the previous row’s values.

function pascalRow(n) {
  if (!Number.isInteger(n) || n < 0) {
    throw new RangeError("n must be a non-negative integer");
  }

  const row = [1];

  // Build rows 1 through n, updating right to left to preserve old values.
  for (let i = 1; i <= n; i++) {
    row.push(1);
    for (let j = i - 1; j > 0; j--) {
      row[j] += row[j - 1];
    }
  }

  return row;
}

console.log(pascalRow(4)); // [1, 4, 6, 4, 1]
  • Each interior value is the sum of the two values above it; the edges are always 1.
  • Updating right to left prevents overwriting values needed for the current row.

Complexity: Time O(n²); space O(n) for the returned row.

System designHardGoCardlessSoftware EngineerCoding exercise debrief

6. If you were maintaining the API, how would you handle very high volumes of requests?

Model answer

1. Requirements & scale

I’d first clarify whether “high volume” means read-heavy traffic, payment mutations, or both. For a GoCardless-style API, I’d assume merchants make authenticated requests to create mandates and payments, read their status, and receive asynchronous updates. Correctness matters as much as throughput: a retry must not create a duplicate payment.

  • Functional: authenticate and authorize requests, validate them, enforce quotas, return predictable errors, and support safe retries.
  • Non-functional: horizontal scalability, low latency for synchronous responses, durable processing for financial mutations, tenant isolation, and operational visibility.
  • Illustrative scale: 10,000 requests/second average and 50,000 peak. At 2 KB per request and response, peak traffic is about 200 MB/s combined before protocol overhead.
  • If 10% of peak traffic creates durable work, that is 5,000 writes/second. At roughly 1 KB per stored event, that is about 430 GB/day before indexes, replication, and retention. I’d validate these assumptions with traffic data and load tests.

2. High-level architecture

flowchart TD
  subgraph Client
    C["Merchant clients"]
  end
  subgraph EdgeCDN["Edge / CDN"]
    E["WAF and rate limits"]
  end
  subgraph LoadBalancer["Load Balancer"]
    L["Regional load balancer"]
  end
  subgraph Services["API / Services"]
    A["Stateless API instances"]
    V["Validation and auth"]
    P["Payment service"]
  end
  subgraph Cache["Cache"]
    R["Redis quotas and hot reads"]
  end
  subgraph Datastores["Datastores"]
    D["PostgreSQL primary and replicas"]
  end
  subgraph MessageQueue["Message Queue"]
    Q["Partitioned durable queue"]
  end
  subgraph Workers["Workers"]
    W["Payment and webhook workers"]
  end
  C -->|"HTTPS requests"| E
  E -->|"filtered traffic"| L
  L -->|"balanced requests"| A
  A --> V
  V -->|"quota and cached reads"| R
  V -->|"authorized commands"| P
  P -->|"transaction and outbox"| D
  D -->|"committed events"| Q
  Q -->|"partitioned jobs"| W
  W -->|"status updates"| D
  A -->|"read queries"| D
  A -->|"API responses"| C
Diagram

3. API design

  • POST /v1/payments — create a payment; require an Idempotency-Key for safe retries.
  • GET /v1/payments/{id} — fetch current status, with optional conditional requests such as If-None-Match.
  • GET /v1/payments?cursor=... — paginate using stable cursor pagination, not large offsets.
  • GET /v1/events — optionally expose a change feed for clients that need to reconcile state.

Return 429 with Retry-After for throttling, and consistent request IDs and error bodies for diagnosis.

4. Data model & storage

  • Use PostgreSQL for payments, mandates, idempotency records, and an outbox table: these need transactions, constraints, and clear consistency guarantees.
  • Store an idempotency record keyed by (merchant_id, idempotency_key), including a request hash and the original response. Reusing a key with a different request should return a conflict, not silently replay another operation.
  • Partition large payment and event tables by time, and index tenant plus resource ID. If one database can no longer meet write or storage needs, shard by merchant_id to keep a merchant’s related operations together.
  • Use Redis for short-lived rate-limit counters and carefully selected hot reads, not as the source of truth. Use a durable partitioned queue for asynchronous work.

5. Deep dive

The critical path is accepting a payment exactly once from the client’s perspective, while processing it asynchronously and at high volume.

  1. Authenticate the merchant, validate the request, and apply per-merchant and per-IP limits at the edge and service layer. Use token buckets to allow short bursts while bounding sustained traffic; isolate noisy tenants rather than letting them consume all capacity.
  2. In one database transaction, check the idempotency key, insert the payment, and insert an outbox event. Return the same response for a legitimate retry. Keep synchronous work small and return 202 Accepted when downstream processing is not complete.
  3. An outbox publisher writes committed events to the queue. This avoids the failure mode where the database commits but publishing fails. Workers consume with bounded concurrency, deduplicate by event ID, and use exponential backoff with jitter for transient failures. Send exhausted jobs to a dead-letter queue for investigation.
  4. Acknowledge the queue message only after the state update is durable. Queue delivery may be at least once, so consumers must be idempotent; claiming “exactly once” across the database and queue would be misleading.
sequenceDiagram
  participant M as Merchant
  participant A as API
  participant D as Database
  participant Q as Queue
  participant W as Worker
  M->>A: POST payment with idempotency key
  A->>D: Store payment and outbox in transaction
  D-->>A: Commit
  A-->>M: 202 Accepted with payment ID
  D->>Q: Publish outbox event
  Q->>W: Deliver event
  W->>D: Apply idempotent status update
  W-->>Q: Acknowledge after commit
Diagram

6. Scale, bottlenecks & trade-offs

  • Keep API instances stateless and autoscale on request rate, latency, and saturation. Apply admission control before dependencies are overloaded; more API servers cannot fix a saturated database.
  • Replicate the database for read scaling, but route correctness-sensitive reads to the primary when replica lag could mislead a client. Cache only data with an explicit staleness policy.
  • Partition queue messages by merchant or payment ID to preserve relevant ordering, while watching for hot partitions. Use regional isolation and tested failover for availability; financial writes should not be accepted in two regions without a clear conflict strategy.
  • Favor strong consistency for payment creation and idempotency, and eventual consistency for status propagation and analytics. This costs some write latency, but protects correctness. Measure p95/p99 latency, error and throttling rates, queue lag, database saturation, and per-tenant usage, then load-test realistic retry spikes and dependency failures before raising limits.
TechnicalMediumGoCardlessSoftware EngineerCoding exercise debrief

7. What are the different approaches to caching?

Model answer

  1. Choose a caching location - Client/browser cache: Reuses data close to the user; HTTP Cache-Control, ETag, and Last-Modified control freshness and revalidation. - CDN/reverse proxy: Caches public or safely shareable responses near users; useful for static assets and public content, usually not personalized payment data. - Application cache: An in-process cache is very fast but isolated to one instance. A distributed cache such as Redis shares entries across instances and supports TTLs and eviction. - Database cache: Database buffer pools and materialized views reduce repeated disk work or expensive query computation, but do not remove the need to understand query patterns.
  2. Choose a read/write strategy - Cache-aside (lazy loading): The application checks the cache, reads the database on a miss, and populates the cache. It is flexible and common, but concurrent misses can stampede the database. - Read-through: The cache loads missing values from the backing store. This centralizes read behavior, though it requires a cache layer that supports the loading contract. - Write-through: Writes update the cache and backing store together. Reads are fresh after successful writes, at the cost of write latency and coordination. - Write-behind (write-back): A cache acknowledges writes and persists them asynchronously. This can improve throughput but risks losing or delaying data, so it is generally unsuitable for authoritative payment state. - Write-around: Writes go directly to the database; the cache is populated only on a later read. This avoids caching one-off writes but can cause a miss immediately afterward. - Refresh-ahead: Frequently used entries are refreshed before expiry, reducing latency spikes while adding refresh load and complexity.
flowchart TD
    A[Request] --> B{Cache hit?}
    B -->|Yes| C[Return cached value]
    B -->|No| D[Read backing store]
    D --> E[Populate cache with TTL]
    E --> F[Return value]
    G[Write request] --> H[Choose write policy]
    H --> I[Update store and cache]
    H --> J[Write store only]
Diagram
  1. Make freshness and failure behavior explicit - Set TTLs based on how quickly data must become visible, and define invalidation for updates. TTL alone bounds staleness; it does not guarantee immediate consistency. - Protect against cache stampedes with request coalescing, jittered expirations, or stale-while-revalidate. Use size limits and monitor hit rate, evictions, latency, and origin load. - Cache keys must include the relevant tenant, permissions, locale, and query parameters. A missing dimension can leak one customer’s data to another. - For payment systems, cache stable reference data more readily than mutable payment status or balances. Treat the database or ledger as authoritative, and make stale-data behavior visible in the product.
TechnicalMediumGoCardlessSoftware EngineerCoding exercise debrief

8. How might you fetch a large number of records simultaneously?

Model answer

For a large result set, I would avoid trying to fetch everything in one request. I’d paginate through the records, then use bounded concurrency to fetch multiple pages at once if the API supports independent page requests.

  1. Choose pagination deliberately. Prefer cursor-based pagination for changing datasets; offset pagination can become slow and may skip or duplicate records as rows are inserted or deleted. Use a stable sort order and request a consistent snapshot if the API supports it.
  2. Bound parallelism. Fetch a small number of pages concurrently, then tune that limit against latency, throughput, and the provider’s rate limits. Unbounded concurrency can overload either service.
  3. Handle failures safely. Retry transient errors such as timeouts and 429 responses with exponential backoff and jitter; respect Retry-After. Make retries idempotent, and checkpoint progress so a long-running fetch can resume.
  4. Apply backpressure. Process or persist each batch before fetching too far ahead, rather than holding the entire dataset in memory. For very large exports, an asynchronous bulk-export job may be a better fit.
flowchart TD
    A[Start fetch] --> B[Request page or cursor]
    B --> C{Request succeeded?}
    C -- No --> D[Back off and retry]
    D --> B
    C -- Yes --> E[Process and persist batch]
    E --> F{More pages?}
    F -- Yes --> G[Schedule within concurrency limit]
    G --> B
    F -- No --> H[Finish]
Diagram
TechnicalMediumGoCardlessSoftware EngineerCoding exercise debrief

9. What are the various ways of handling API versioning?

Model answer

Common API versioning approaches include:

  1. URL path: /v1/payments. Easy to see, route, document, and test. It is a pragmatic default, though it can make URLs change between major versions.
  2. Query parameter: /payments?version=1. Simple to add, but versions can be less visible and easier to omit or handle inconsistently.
  3. Custom request header: Api-Version: 2025-01-01. Keeps the resource URL stable, but is less discoverable and can be awkward with caches or manual requests.
  4. Media type negotiation: Accept: application/vnd.example.v2+json. Uses HTTP content negotiation, but adds complexity for clients and debugging.
  5. Date-based versions: A header or media type can specify a version date. This can suit APIs that release changes frequently, provided the compatibility and support policy is clear.

Whichever scheme I choose, I’d keep changes backward-compatible where possible, version only when a breaking change requires it, and publish a deprecation window and migration guidance. I’d also monitor usage by version so old versions can be retired safely.

flowchart LR
    A[Client request with version] --> B[Version negotiation or routing]
    B --> C[Compatible API handler]
    C --> D[Response in selected contract]
Diagram

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions