← eBay Interview Insights

eBay·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

eBay software engineer interview where they had me extend a file system design with user ownership and storage quotas. Pretty focused on getting the state management right under constraints.

Questions Asked (1)

Q1

You're given an in-memory file system that already handles basic file operations and a prefix/suffix search. Extend it to support user accounts with storage capacity limits: adding a user returns false on duplicates, and adding a file by user rejects if the user doesn't exist, the file already exists, or the upload would push the user over their storage cap.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

The core of the question is really just bookkeeping.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then design the data structures and algorithms to support user management and storage limits. Explain how you would integrate the new functionality with the existing file system, ensuring efficient operations and proper error handling. Finally, discuss trade-offs and potential optimizations.

Pro tip: Demonstrate awareness of real-world concerns like concurrency and scalability, and suggest how to handle them (e.g., locking, sharding). Also, mention the importance of clear error messages and logging for debugging.

1. Clarify Requirements

Ask questions to understand the expected scale, concurrency needs, and whether storage limits are per-user or global. Confirm the exact behavior for edge cases like zero-byte files or duplicate usernames.

2. Design Data Structures

Propose structures: a map for users (username -> User object with used storage), and a map for files (filename -> File object with size and owner). Consider how to track total storage per user efficiently.

3. Implement Operations

Outline algorithms for addUser (check duplicate, insert) and addFile (validate user, check file existence, check storage cap, then insert and update user's used storage). Ensure atomicity if needed.

4. Integrate with Existing System

Explain how to extend the existing file system without breaking prefix/suffix search. For example, maintain the same file map and ensure search still works by not altering file keys.

5. Discuss Trade-offs and Optimizations

Talk about time/space complexity, potential bottlenecks (e.g., frequent storage checks), and optimizations like caching or lazy deletion. Mention concurrency control if multi-threaded.

Key Points to Mention

  • Use appropriate data structures (hash maps) for O(1) average-time operations.
  • Ensure atomicity of addFile operation to avoid race conditions.
  • Handle edge cases: user not found, file exists, storage cap exceeded, duplicate user.
  • Maintain backward compatibility with existing prefix/suffix search.
  • Consider scalability: sharding users, using distributed storage, etc.
  • Discuss error handling and return values (e.g., false on failure).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.