Publicis Sapient Interview Question

Asked to write an API.