Truist interview question

Write an API logic to a question that they give