FastPrepNumeric Poker Operations
Problems/Numeric Poker Operations

Numeric Poker Operations

Rippling logoRippling● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Rippling phone screen. The report defines how to evaluate a five-card numeric hand, how to break ties from right to left, and operations for the best and worst completion. It does not give a batch interface that works across languages, limits on the operations, or a clear token for a tie. We added those.

A numeric poker hand is a string of exactly five card ranks. Every rank is a digit from 1 through 9, and ranks may be reused without a deck-wide limit.

Hand Strength

Categories are ordered from strongest to weakest:

  1. five of a kind
  2. four of a kind
  3. full house
  4. two pair
  5. three of a kind
  6. one pair
  7. high card

A stronger category always wins. When two hands have the same category, compare their original card order from right to left without sorting. At the first different position, the hand with the larger rank is stronger. Identical hands tie.

Process each row of operations in order and return one string result per row:

  • ["COMPARE", first, second] compares two complete hands and returns FIRST, SECOND, or TIE.
  • ["BEST", partial] appends ranks until partial has length five and returns the strongest possible completed hand.
  • ["WORST", partial] appends ranks until partial has length five and returns the weakest possible completed hand.

Every completion preserves the given prefix. If the input to BEST or WORST already has length five, return it unchanged.

Function

processNumericPokerOperations(operations: String[][]) → String[]

Examples

Example 1

operations = [["COMPARE","99999","88888"],["COMPARE","11223","11123"],["COMPARE","12345","12345"]]return = ["FIRST","FIRST","TIE"]

The first result compares two five-of-a-kind hands by their ranks. In the second comparison, two pair is listed above three of a kind in this game's category order. The last hands are identical.

Example 2

operations = [["BEST","99"],["WORST","99"],["BEST","12345"],["WORST","12345"]]return = ["99999","99321","12345","12345"]

Appending three nines produces the strongest completion of 99. Every completion of that prefix has at least one pair, and 99321 is the weakest one-pair completion under right-to-left comparison. Complete hands remain unchanged.

Example 3

operations = [["COMPARE","12349","92341"],["BEST","1"],["WORST","1"],["BEST","1234"],["WORST","1234"]]return = ["FIRST","11111","15432","12344","12345"]

The first comparison is decided by the rightmost card, so the leading 9 in the second hand does not decide the result. The completion results follow the same category and right-to-left ordering.

Constraints

  • 1 <= operations.length <= 2000.
  • Every operation is exactly one valid shape listed above.
  • Every hand or partial hand contains only digits from 1 through 9.
  • COMPARE receives two strings of length 5.
  • BEST and WORST receive one string whose length is between 1 and 5, inclusive.
  • Each appended rank may independently be any digit from 1 through 9.

More Rippling Phone Screen questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • In-Memory Priority Task SchedulerPHONE SCREEN · Seen Oct 2026
  • Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Median Across N Sorted ArraysPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • File Storage ServiceCresta · PHONE SCREENCresta interview questions
  • Return Every Matching DecryptionDuolingo · PHONE SCREENDuolingo interview questions
  • Reference-Counted Deduplicating File SystemCitadel · PHONE SCREENCitadel interview questions
  • Machine Message RouterOpenAI · PHONE SCREENOpenAI interview questions
  • String Copy and Move LifecycleSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Design In-Memory File SystemSnowflake · PHONE SCREENSnowflake interview questions
  • File System Shell CommandsHarvey · ONSITE INTERVIEWHarvey interview questions
  • Parcel Event TrackingAirbnb · OAAirbnb interview questions
  • Account Scheduler - Availability and AcquireStripe · ONSITE INTERVIEWStripe interview questions

Rippling interview experiences

  • Rippling Senior SWE Full Loop Questions: 1 Experience
  • Rippling Experienced SWE Phone Screens: 2 Experiences
  • Rippling Design Rounds and Onsites: 17 Experiences (Part 3 of 3)
  • Rippling Phone Coding Screens: 14 Experiences (Part 2 of 3)
  • Rippling SWE Screens and Loops: 31 Experiences (Part 1 of 3)
  • Rippling No-Level Older Reports: 31 Experiences (Part 6 of 6)
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public String[] processNumericPokerOperations(String[][] operations) {
        // Write your code here.
    }
}
Checking account…