Tesla Interview Question

Write algorithm for signal processing.