Arkeus interview question

Derive and code a Sobel filter from first principles?