FastPrepMutual Wishlist Rankings
Problems/Mutual Wishlist Rankings

Mutual Wishlist Rankings

Stripe logoStripe● MediumFULLTIMENEW GRADINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Stripe phone screen. The reports describe ordered wishlists, checks for mutual first choices, checks that both sides agree at a given rank, and what happens when a choice moves up one rank. Our version is about 94% the same as the reported question. The first-choice report does not describe the later rank or swap phases.

Users of an apartment-exchange service keep ordered wishlists of other users' apartments.

Each wishlist row is user:choice1,choice2,..., with rank 0 as the first choice. Process two kinds of operations:

  • MUTUAL user rank: return true when the apartment at that rank belongs to another user who also places user at the same rank.
  • CHANGED user rank: rank is at least 1. Imagine moving that entry up one position by swapping ranks rank and rank-1. Without mutating the stored wishlist, return the users whose mutual-ranked status with user would change.

Return one string per operation. A changed list is formatted as sorted usernames inside brackets, for example [a,c] or [].

Function

evaluateWishlist(wishlists: String[], operations: String[]) → String[]

Examples

Example 1

wishlists = ["a:c,d","b:d,a,c","c:a,b","d:c,a,b"]operations = ["MUTUAL a 0","MUTUAL b 0","MUTUAL a 1","CHANGED d 1","CHANGED b 2","CHANGED b 1"]return = ["true","false","true","[a]","[c]","[]"]

a/c are mutual first choices, a/d are mutual second choices, and only the source-described pairings change under each hypothetical rank bump.

Example 2

wishlists = ["amy:bo,cy","bo:cy,amy","cy:amy,bo"]operations = ["MUTUAL amy 0","MUTUAL amy 1","CHANGED amy 1"]return = ["false","false","[bo,cy]"]

Neither original rank is mutual. Swapping amy's choices creates mutual rank 0 with cy and mutual rank 1 with bo.

Constraints

  • 1 <= wishlists.length <= 1000.
  • Usernames are unique, and every listed choice names another supplied user at most once.
  • 1 <= operations.length <= 10000.
  • A MUTUAL rank may be out of range and then returns false.
  • A CHANGED rank is valid and at least 1.
  • Operations do not mutate the wishlists.

More Stripe Phone Screen questions

  • Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
  • Business Account KYC Verification — Parts 1–5PHONE SCREEN · Seen Nov 2026
  • Merchant Matching, Parts 1–2: Shared Fields and Weighted ThresholdsPHONE SCREEN · Seen Nov 2026
  • Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Merchant Payout Scheduler, Part 2: Per-Merchant SchedulesPHONE SCREEN · Seen Nov 2026
  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesPHONE SCREEN · Seen Nov 2026
  • Render a Task Tree from CSV RowsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Linked Merchants Within Two HopsPHONE SCREEN · Seen Nov 2026
  • Portfolio Valuation, Part 1PHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Order and Batch Open-Close LifecycleHudson River Trading · PHONE SCREENHudson River Trading interview questions
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Resource Reconciler: Plan and Apply CreatesPerplexity AI · PHONE SCREENPerplexity AI interview questions
  • Realized Gains from a Real-Estate Transaction StreamKikoff · PHONE SCREENKikoff interview questions
  • Process On-Call Routing OperationsOpenAI · PHONE SCREENOpenAI interview questions
  • Batched Key Fetch CallbacksAnrok · PHONE SCREEN
  • Earliest Car for Each PassengerWhatNot · PHONE SCREENWhatNot interview questions
  • Stateful Paginated Fetch NLyft · PHONE SCREENLyft interview questions

Interview reports that mention this question

  • Stripe SWE Intern Technical Screen Questions Guide
  • Stripe SDE Intern Wishlist and Transfer Loop: 1 Experience
  • Stripe New Grad Interview Question Bank: 47 Problems

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
All Stripe interview questionsSee Stripe hiring insights
Saved
class Solution {
    public String[] evaluateWishlist(String[] wishlists, String[] operations) {
      // write your code here
    }
}
Checking account…