Java
SpringBoot
GIT
Database
APIs & Web
100

What is Java? What are the main features of Java?

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

Java features include object-oriented, platform independence, security, robustness, multithreading, and portability.

100

What is a Spring Boot starter?

A starter is a set of convenient dependency descriptors that you can include in your application to quickly set up a particular technology or functionality.

100

What is a repository in Git?

A repository is a storage location where Git keeps all the files and their revision history.

100

What is a SQL query?

A SQL query is a request to perform a specific action on a database to retrieve, manipulate, update, or manage data stored in that database.

100

What HTTP methods are commonly used in RESTful services?

GET, POST, PUT, DELETE, PATCH.

200

What is the difference between == and .equals() in Java?

What is the output of this code?

String a = "hello";
String b = new String("hello");
System.out.println(a == b);


== compares references, while .equals() compares values 

200

What is the application.properties file?

application.properties is a configuration file used to customize and configure various settings in a Spring Boot application.

200

What does git status do?

Shows the state of the working directory and staging area.

200

What does this query return?

SELECT COUNT(*) FROM users;


The number of rows in the users table.

200

What HTTP status code indicates that a resource has been successfully created?

201.

300

Explain the output:

public class Main {

    static int count = 0;

    

    Main() {

        count++;

    }


    public static void main(String[] args) {

        new Main();

        new Main();

        System.out.println(count);

    }

}

2 because variable count is static which means it is shared among all instances of the class

300

What will be the output when this endpoint is called?

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "Hello World";
    }
}


Request: GET /hello

Hello World

300

What will happen with this command?

git checkout -b my_feature


Creates and switches to a new branch named my_feature.

300

What is an INNER JOIN?

An INNER JOIN returns rows that have matching values in both tables.

300

What is the difference between PUT and PATCH in REST?

PUT is used to update an entire resource, while PATCH is used to make partial updates to a resource.

400

Method overloading vs method overriding

Method overloading is a static or complie-time type of polymorphism and it occurs when multiple methods in the same class have the same name but different parameters.

Method overriding is a dynamic or run-time type of pylymorphism and it occurs when a subclass provides a specific implementation for a method that is already defined in its superclass.

400

What is Dependency Injection in Spring?

Dependency Injection (DI) is a design pattern in Spring where the container injects the dependencies needed by a class at runtime.

400

What does git rebase do?

git rebase rewrites commit history, moves your branch on top of another branchMoves or reapplies commits on top of another base tip.

400

What is a subquery?

A subquery is a query nested inside another query.

400

What is idempotency in the context of RESTful APIs?

Idempotency means that making multiple identical requests should produce the same result as making a single request.

500

Explain Java architecture

The Java architecture includes the three main components:

Java Virtual Machine (JVM): Write Once Run Anywhere.

Java Runtime Environment (JRE): It provides an environment in which Java programs are executed. JRE takes our Java code, integrates it with the required libraries, and then starts the JVM to execute it.

Java Development Kit (JDK): used in the development of Java applications and applets. Java Development Kit holds JRE, a compiler, an interpreter or loader, and several development tools in it.

500

What is Bean in SpringBoot and how to define it?

A Bean is an object managed by the Spring IoC container.

A Bean can be defined using the @Bean annotation in a configuration class or by annotating the class with @Component, @Service, or @Repository.

500

What is the purpose of git cherry-pick?

git cherry-pick allows you to apply a specific commit from one branch to another.

500

What is an index in SQL?

An index is a database object that improves the speed of data retrieval operations.

500

What is CORS, and why might it block a request?

Cross-Origin Resource Sharing; it blocks a request if the origin is not allowed by the server for security reasons.