Anthropic logo

Anthropic Software Engineer System Design Questions

17 practice questions for Anthropic Software Engineer interviews

Anthropic software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
1
System Design
system design Hard Verified Question #1

1. System Design - Inference API


Category: Queue-based system design problem
You need to design a high-concurrency inference API system. This system must handle many requests happening at the same time. You are given an API...
Input: Number(s)
Output: Computed result
system design Medium api design #1

1. Design FileStorageSystem — an object-oriented representation of a file storage system


Background: Anthropic requires a scalable file storage system to efficiently manage user files in a way that supports key operations like storing, retrieving, filtering, backing up, and restoring files. This is crucial for data management across various applications.
Requirements:
1. Implement set(file: str, data: bytes) -> None to store a file.
2. Implement get(file: str) -> Optional[bytes] to retrieve file data by name.
3. Implement filter(criteria: Callable[[str], bool]) -> List[str] to return a list of files matching certain conditions.
4. Implement backup(destination: str) -> None to backup all files to a specified location.
5. Implement restore(source: str) -> None to restore files from a backup location.
Class API:
  • set(file: str, data: bytes) -> None: Stores the file file with the content data in bytes.

  • get(file: str) -> Optional[bytes]: Returns the content of the file if it exists, otherwise returns None.

  • filter(criteria: Callable[[str], bool]) -> List[str]: Returns a list of file names that match the given criteria.

  • backup(destination: str) -> None: Backs up the current files to the specified destination.

  • restore(source: str) -> None: Restores files from a backup source.


Example 1:
Input:
  • set('document.txt', b'This is a document.')

  • set('image.png', b'Image data here.')

Output:
  • get('document.txt') returns b'This is a document.'

  • filter(lambda x: x.endswith('.png')) returns ['image.png']

Explanation: The method set is used to store files and get retrieves the content of a specific file. The filter method uses a lambda function to find files with the .png extension.
Example 2:
Input:
  • backup('/backup/location')

  • restore('/backup/location')

Output: No direct output, but files are backed up and restored as needed.
Constraints:
  • Maximum number of files: 1000

  • File name length: up to 255 characters.

  • Data size: up to 1MB per file.


Related Anthropic Software Engineer interview prep

Start practicing Anthropic questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free