Anthropic software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
set(file: str, data: bytes) -> None to store a file.get(file: str) -> Optional[bytes] to retrieve file data by name.filter(criteria: Callable[[str], bool]) -> List[str] to return a list of files matching certain conditions.backup(destination: str) -> None to backup all files to a specified location.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.set('document.txt', b'This is a document.') set('image.png', b'Image data here.') get('document.txt') returns b'This is a document.' filter(lambda x: x.endswith('.png')) returns ['image.png'] 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: backup('/backup/location') restore('/backup/location') Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free