Thoughtworks Interview Question

How does API work, Code Singleton pattern and Synchronous block in JAVA