PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/IBM

Design multithreaded 1D convolution strategies

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competency in parallel programming, CPU performance optimization, cache locality, load balancing, and synchronization for multithreaded numerical algorithms.

  • hard
  • IBM
  • System Design
  • Software Engineer

Design multithreaded 1D convolution strategies

Company: IBM

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Take-home Project

Optimize the valid 1D convolution for CPU hardware using multithreading. Describe and implement (code or pseudocode) how to partition work, assign threads, and combine results for each case: (a) input length = 1,000,000; kernel length = 3, (b) input length = 1,000,000; kernel length = 1,000,000, (c) maximum available threads = 100. Address load balancing, cache locality, avoiding false sharing, synchronization/merging of outputs, and how to choose chunk sizes and the number of threads.

Quick Answer: This question evaluates competency in parallel programming, CPU performance optimization, cache locality, load balancing, and synchronization for multithreaded numerical algorithms.

Related Interview Questions

  • Design multithreaded CPU convolution - IBM (hard)
IBM logo
IBM
Aug 14, 2025, 12:00 AM
Software Engineer
Take-home Project
System Design
3
0

Optimize CPU Multithreaded 1D "Valid" Convolution

Context

You are given a 1D input array x of length N and a kernel h of length K. The "valid" convolution produces an output array y of length L_out = N − K + 1, where:

  • y[i] = sum_{j=0}^{K-1} x[i + j] * h[K − 1 − j]
  • Index i ranges from 0 to L_out − 1.

Assume a typical CPU with a shared last-level cache, private L1/L2 per core, 64-byte cache lines, and support for multiple threads.

Task

Optimize the valid 1D convolution for CPU hardware using multithreading. For each case, describe and implement (code or pseudocode) how to:

  • Partition work,
  • Assign threads,
  • Combine results,
  • Address load balancing, cache locality, and avoiding false sharing,
  • Synchronize/merge outputs,
  • Choose chunk sizes and the number of threads.

Consider these cases:

  1. N = 1,000,000; K = 3,
  2. N = 1,000,000; K = 1,000,000,
  3. Maximum available threads = 100.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More IBM•More Software Engineer•IBM Software Engineer•IBM System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,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.