PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Meta

Maintain top N payers

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in streaming algorithms and data-structure design for maintaining top-k aggregates over transactional data, including handling real-time updates, tie-breaking rules, and time/space complexity reasoning.

  • Medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Maintain top N payers

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Implement topNPayers(n) that returns the n accounts with the highest cumulative outgoing payment amounts as strings formatted "{accountId}:{totalOutgoing}". Rank by the sum of amounts from debit operations (e.g., pay, executed scheduled payments). Support online updates as new debits occur. Explain your data structures (e.g., a size-N min-heap or an ordered map), tie-breaking rules, how to handle accounts with equal totals, and the time/space complexity per update and query.

Quick Answer: This question evaluates proficiency in streaming algorithms and data-structure design for maintaining top-k aggregates over transactional data, including handling real-time updates, tie-breaking rules, and time/space complexity reasoning.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Maze and Suffix Problems - Meta (medium)
Meta logo
Meta
Aug 9, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
0
0

Implement topNPayers(n) that returns the n accounts with the highest cumulative outgoing payment amounts as strings formatted "{accountId}:{totalOutgoing}". Rank by the sum of amounts from debit operations (e.g., pay, executed scheduled payments). Support online updates as new debits occur. Explain your data structures (e.g., a size-N min-heap or an ordered map), tie-breaking rules, how to handle accounts with equal totals, and the time/space complexity per update and query.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,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.