FastPrepFilter Transaction Logs and Calculate Reliability Metrics
Problems/Filter Transaction Logs and Calculate Reliability Metrics

Filter Transaction Logs and Calculate Reliability Metrics

Stripe logoStripe● EasyINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Stripe intern online assessment. The source keeps parsing a transaction log, filtering by error code, and metrics for latency and for success. It does not give the row grammar, the range for success, rounding, what to do when empty, or how the result is written. Our version is about 66% the same as the reported question.

Summarize transaction logs after filtering error codes that should not count toward reliability metrics.

Each log is a comma-separated string:

transaction_id,status_code,latency_ms

status_code is an integer from 100 through 599. A remaining log is successful when its status code is from 200 through 299, inclusive.

Ignore every log whose status code appears in ignoredErrorCodes. For all remaining logs, return:

  1. the average latency in milliseconds, rounded down to an integer; and
  2. the success rate in basis points, rounded down to an integer, where 10000 means 100%.

If no logs remain after filtering, return [0,0].

Function

calculateTransactionMetrics(logs: String[], ignoredErrorCodes: int[]) → long[]

Examples

Example 1

logs = ["t1,200,120","t2,500,300","t3,404,80","t4,201,100"]ignoredErrorCodes = [404]return = [173,6666]

The 404 row is ignored. The remaining latencies total 520, so the floored average is 173. Two of three remaining logs succeed, giving 6666 basis points.

Example 2

logs = ["a,503,9","b,503,11"]ignoredErrorCodes = [503]return = [0,0]

Every row is filtered, so both metrics are zero.

Constraints

  • 1 <= logs.length <= 10^5.
  • Transaction IDs contain lowercase English letters, digits, or underscores.
  • 100 <= status_code <= 599.
  • 0 <= latency_ms <= 10^9.
  • 0 <= ignoredErrorCodes.length <= 500, with unique values.
  • Use 64-bit arithmetic for latency totals and rate multiplication.

More Stripe Online Assessment questions

  • Split Tender Part 4 - RefundsOA · PHONE SCREEN · Seen Nov 2026
  • Split Tender Part 3 - SurchargesOA · Seen Nov 2026
  • Split Tender Part 2 - Expiration DatesOA · Seen Nov 2026
  • Split Tender Part 1 - Basic Split TenderingOA · Seen Nov 2026
  • Asynchronous Event ProcessingOA · Seen Nov 2026
  • Subscription and Usage-Based Billing CalculatorOA · Seen Nov 2026
  • Payment Partner RoutingOA · Seen Nov 2026
  • Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
  • Maximum Game Score with Fixed Forward JumpsOA · Seen Nov 2026
  • Reliable LLM Call with Independent Retry BudgetsOA · Seen Nov 2026

Similar questions at other companies

  • Cheating CodemakerJane Street · OAJane Street interview questions
  • Aggregate Paginated Project Run RecordsReplit · OA
  • Project JSON Fields into a Target FormatBooking.com · PHONE SCREEN
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • Most Frequent Call Path in Interleaved LogsRoblox · ONSITE INTERVIEWRoblox interview questions
  • Machine Message RouterOpenAI · PHONE SCREENOpenAI interview questions
  • Credit Card Command ProcessorChime · PHONE SCREEN
  • Macaron Order with Set DiscountsShopify · OAShopify interview questions
  • Branch with the Most FilesCapital One · OACapital One interview questions
  • Count User Mentions in Chat MessagesRamp · OARamp interview questions

Interview reports that mention this question

  • Stripe OA: What It Tests (2026)
  • Stripe Off-Campus SWE Intern Offer Loop: 1 Experience

Stripe interview experiences

  • Stripe New Grad SWE OA and Phone Screen: 2 Experiences
  • Stripe Experienced SWE OA and Onsite Questions: 3 Experiences
  • Stripe SWE Intern Linked Merchants Team Screen: 1 Experience
  • Stripe SWE Onsite over Two Days: 1 Experience
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public long[] calculateTransactionMetrics(String[] logs, int[] ignoredErrorCodes) {
        // write your code here
    }

}
Checking account…