PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Meta

Design a Trade Ledger Class

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to design class interfaces, choose and justify data structures for ordered storage, and reason about sorting behavior and time complexity when recording timestamped trades.

  • easy
  • Meta
  • Software Engineering Fundamentals
  • Software Engineer

Design a Trade Ledger Class

Company: Meta

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

Design a class that records daily stock trading activity and returns all recorded trades in sorted order. Requirements: - Implement a method to register a trade. - Each trade contains at least: - a timestamp - a stock symbol - whether the action is buy or sell - a quantity or amount - Implement a method `getAllTrades()` that returns every recorded trade sorted by: 1. timestamp ascending 2. amount ascending when timestamps are equal You should describe the class interface, the data structures you would use, and the time complexity of the main operations.

Quick Answer: This question evaluates the ability to design class interfaces, choose and justify data structures for ordered storage, and reason about sorting behavior and time complexity when recording timestamped trades.

Related Interview Questions

  • Troubleshoot a production server outage - Meta (medium)
  • Troubleshoot a Midnight Web Server Outage - Meta (medium)
  • Troubleshoot a website outage with disk full - Meta (medium)
  • Explain ACID and isolation levels - Meta (medium)
  • Design concurrent expiring job registry - Meta (medium)
Meta logo
Meta
Feb 18, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
1
0
Loading...

Design a class that records daily stock trading activity and returns all recorded trades in sorted order.

Requirements:

  • Implement a method to register a trade.
  • Each trade contains at least:
    • a timestamp
    • a stock symbol
    • whether the action is buy or sell
    • a quantity or amount
  • Implement a method getAllTrades() that returns every recorded trade sorted by:
    1. timestamp ascending
    2. amount ascending when timestamps are equal

You should describe the class interface, the data structures you would use, and the time complexity of the main operations.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Meta•More Software Engineer•Meta Software Engineer•Meta Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
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.