Pergunta de entrevista da empresa Fawry

What is the difference between abstract classes and interfaces in Java, and when would you use each one in a real project? How do you build and secure a REST API using Spring Boot, and what is the role of annotations like @RestController, @Service, and @Repository? How would you optimize a slow SQL query in a production system, and what techniques (such as indexing or caching) would you use to improve performance?