PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Rippling

Design an extensible expense rule evaluator

Last updated: Mar 29, 2026

Quick Overview

This question evaluates system-design and API/interface skills for rule engines, focusing on data modeling, extensibility, maintainability, and rule/result schema design in the Software Engineering Fundamentals domain.

  • medium
  • Rippling
  • Software Engineering Fundamentals
  • Software Engineer

Design an extensible expense rule evaluator

Company: Rippling

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

## Scenario You are building a corporate employee expense card product. Admins define policies (“rules”) to prevent misuse and to flag policy violations. You need to design a rules evaluation component that takes: - a list of **rules** - a list of **expenses** (each expense is a hash map / dictionary) and returns a result that clearly marks: - which **individual expenses** violate which rules - which **trips** (a trip is a group of expenses sharing the same `trip_id`) violate which rules All keys and values in the input expense objects are **strings**. ### Example rules (initial set) Assume money is in USD. 1. Any restaurant expense must not exceed `X` dollars. (`merchant_type == "restaurant"`) 2. No airfare purchases allowed. (`category == "airfare"`) 3. No entertainment purchases allowed. (`category == "entertainment"`) 4. Any single transaction must not exceed `Y` dollars. 5. Total spend per trip must not exceed `Z` dollars. 6. Total restaurant spend per trip must not exceed `R` dollars. ### Example expense object Each expense is a dictionary like: - `expense_id`: "001" - `trip_id`: "001" - `amount`: "23.312" (string) - `purpose`: "client hosting" - `merchant_type`: "restaurant" - `merchant_name`: "Outback Roadhouse" ### Task Design the function: `evaluate_rules(rules: List[...], expenses: List[Dict[str, str]]) -> ???` 1. Propose a **return type** (structure/schema) that supports: - per-expense violations - per-trip violations - clear human-readable reasons - machine-readable rule identifiers 2. Explain how you would design the rules representation so that **new rule types** can be added later, and rules can eventually be created via an API (i.e., emphasize extensibility and maintainability). You do **not** need to write code; focus on interface and design.

Quick Answer: This question evaluates system-design and API/interface skills for rule engines, focusing on data modeling, extensibility, maintainability, and rule/result schema design in the Software Engineering Fundamentals domain.

Related Interview Questions

  • Design several backend components - Rippling (hard)
  • Implement a RESTful Q&A service - Rippling
  • Design an extensible poker-hand evaluator - Rippling (medium)
  • Design article voting and flip-tracking system - Rippling (medium)
  • Explain JS event loop and related concepts - Rippling (medium)
Rippling logo
Rippling
Feb 12, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
25
0
Loading...

Scenario

You are building a corporate employee expense card product. Admins define policies (“rules”) to prevent misuse and to flag policy violations.

You need to design a rules evaluation component that takes:

  • a list of rules
  • a list of expenses (each expense is a hash map / dictionary)

and returns a result that clearly marks:

  • which individual expenses violate which rules
  • which trips (a trip is a group of expenses sharing the same trip_id ) violate which rules

All keys and values in the input expense objects are strings.

Example rules (initial set)

Assume money is in USD.

  1. Any restaurant expense must not exceed X dollars. ( merchant_type == "restaurant" )
  2. No airfare purchases allowed. ( category == "airfare" )
  3. No entertainment purchases allowed. ( category == "entertainment" )
  4. Any single transaction must not exceed Y dollars.
  5. Total spend per trip must not exceed Z dollars.
  6. Total restaurant spend per trip must not exceed R dollars.

Example expense object

Each expense is a dictionary like:

  • expense_id : "001"
  • trip_id : "001"
  • amount : "23.312" (string)
  • purpose : "client hosting"
  • merchant_type : "restaurant"
  • merchant_name : "Outback Roadhouse"

Task

Design the function:

evaluate_rules(rules: List[...], expenses: List[Dict[str, str]]) -> ???

  1. Propose a return type (structure/schema) that supports:
    • per-expense violations
    • per-trip violations
    • clear human-readable reasons
    • machine-readable rule identifiers
  2. Explain how you would design the rules representation so that new rule types can be added later, and rules can eventually be created via an API (i.e., emphasize extensibility and maintainability).

You do not need to write code; focus on interface and design.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Rippling•More Software Engineer•Rippling Software Engineer•Rippling Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.