UI means User Interface is a type of testing that generally tests the graphical interface means to test how an application is looking, how it is feasible for end-users, Images, buttons, videos, font displayed on UI screen are working as expected.
While API means the program interface that permits communication between two different programs. Its main focus is on the business layer of an application.

BY Best Interview Question ON 18 Dec 2021