Implement valid 1D convolution with bias
Company: IBM
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Take-home Project
Implement a 'valid' 1D convolution (no padding, stride =
1) over a numeric input array using a given kernel and scalar bias. Do not reverse the kernel (use cross-correlation semantics). Return an output array of length n − k + 1 where output[i] = sum_{j=0}^{k-1} input[i + j] * kernel[j] + bias. Handle floating-point values, and discuss time and space complexity.
Quick Answer: This question evaluates implementation skills in numerical array processing, understanding of discrete convolution versus cross-correlation semantics, and handling of floating-point arithmetic within the Coding & Algorithms domain.