Truist Interview Question

Write an API logic to a question that they give