PracHub
QuestionsPremiumLearningGuidesCheatsheetNEW
|Home/Coding & Algorithms/Anthropic

Implement a Parallel Image Processor

Last updated: Apr 19, 2026

Quick Overview

This question evaluates understanding of parallel and process-based concurrency, batch image-processing pipelines, transform correctness, and per-job fault isolation within the Coding & Algorithms domain.

  • medium
  • Anthropic
  • Coding & Algorithms
  • Software Engineer

Implement a Parallel Image Processor

Company: Anthropic

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are building a batch image-processing utility. Implement a function that receives a list of jobs. Each job contains: - `input_path`: the source image file - `output_path`: where to write the processed image - `operations`: an ordered list of image transformations Support these operations: 1. `grayscale` — convert the image to grayscale. 2. `scale(f)` — multiply both width and height by a positive scaling factor `f`. 3. `resize(w, h)` — resize the image to exactly `w x h` pixels. For each job, load the image, apply the operations in order, and save the final result to `output_path`. Follow-up: 1. First, implement a correct solution for a small number of images. 2. Then improve the implementation for a very large batch. Assume image transformations are CPU-intensive and that jobs are independent. Use process-based parallelism to increase throughput, while still returning one result record per input job and handling per-file failures without stopping the entire batch. Explain any important design choices, such as worker-count selection, memory considerations, and how you would preserve correctness while improving performance.

Quick Answer: This question evaluates understanding of parallel and process-based concurrency, batch image-processing pipelines, transform correctness, and per-job fault isolation within the Coding & Algorithms domain.

Related Interview Questions

  • Convert Samples into Event Intervals - Anthropic (medium)
  • Convert State Stream to Events - Anthropic (medium)
  • Build a concurrent web crawler - Anthropic (medium)
  • Implement a Batch Image Processor - Anthropic (medium)
  • Implement a crash-resilient LRU cache - Anthropic
Anthropic logo
Anthropic
Apr 3, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
28
0
Coding Console
Loading...

You are building a batch image-processing utility.

Implement a function that receives a list of jobs. Each job contains:

  • input_path : the source image file
  • output_path : where to write the processed image
  • operations : an ordered list of image transformations

Support these operations:

  1. grayscale — convert the image to grayscale.
  2. scale(f) — multiply both width and height by a positive scaling factor f .
  3. resize(w, h) — resize the image to exactly w x h pixels.

For each job, load the image, apply the operations in order, and save the final result to output_path.

Follow-up:

  1. First, implement a correct solution for a small number of images.
  2. Then improve the implementation for a very large batch. Assume image transformations are CPU-intensive and that jobs are independent. Use process-based parallelism to increase throughput, while still returning one result record per input job and handling per-file failures without stopping the entire batch.

Explain any important design choices, such as worker-count selection, memory considerations, and how you would preserve correctness while improving performance.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Anthropic•More Software Engineer•Anthropic Software Engineer•Anthropic 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.