← Goldman Sachs Interview Insights

Goldman Sachs·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Goldman Sachs SWE interview that centered on a transaction approval system built incrementally, starting simple and layering on complexity as follow-ups. The design angle was the real test, not the initial logic.

Questions Asked (1)

Q1

Write a function that approves or rejects a transaction based on its merchant category code. Start with a single rule (reject if MCC is 9999, approve otherwise), but structure it so additional rules like blocklists and velocity checks can be added later without rewriting everything.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

The first part is trivial, literally one if-statement.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then design a modular rule engine where each rule is a separate function or class implementing a common interface. Implement the initial single rule (reject MCC 9999) as one such rule, and set up a pipeline that evaluates rules in order, allowing easy addition of future rules like blocklists and velocity checks.

Pro tip: Emphasize that the rule engine should be data-driven and configurable, so new rules can be added without code changes, and discuss how to handle rule conflicts and ordering.

1. Clarify Requirements and Constraints

Ask about expected transaction volume, latency requirements, and whether rules need to be updated dynamically. This shows you consider non-functional aspects early.

2. Define Rule Interface and Engine

Design a common interface for rules (e.g., `Rule` with an `evaluate(transaction)` method) and a rule engine that iterates through rules, returning the first decision or aggregating results.

3. Implement Initial Rule and Pipeline

Create a concrete rule for MCC 9999 rejection and wire it into the engine. Ensure the engine can be easily extended with new rules without modifying existing code.

4. Discuss Extensibility and Future Rules

Explain how blocklists (e.g., list of MCCs) and velocity checks (e.g., count transactions per time window) can be added as new rule implementations, possibly with configuration.

5. Address Trade-offs and Edge Cases

Mention considerations like rule ordering, short-circuiting, performance, and how to handle conflicting rules (e.g., one approves, one rejects).

Key Points to Mention

  • Separation of concerns: rules as independent modules
  • Open/Closed Principle: open for extension, closed for modification
  • Data-driven configuration for rules (e.g., JSON/YAML)
  • Rule ordering and conflict resolution (e.g., first-match vs. priority)
  • Performance implications: caching, early exit, parallel evaluation
  • Testing strategy: unit tests for each rule and integration tests for the engine

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.