Newgen Software interview question

1) How many ways a java program can be runs. 2) about API 3) shorting algo