Carelan
10+ LTIMindtree Interview Questions and Answers
Q1. how will you fetch a value from the application.proprties file in spring boot
To fetch a value from application.properties file in Spring Boot, use @Value annotation or Environment object.
Use @Value annotation to inject values directly into a field
Use Environment object to access properties programmatically
Example: @Value("${my.property}") private String myProperty;
Example: @Autowired private Environment env; String propertyValue = env.getProperty("my.property");
Q2. how will change the data type of a column in sql
You can change the data type of a column in SQL using the ALTER TABLE statement.
Use the ALTER TABLE statement followed by the MODIFY COLUMN clause to change the data type of a column.
Specify the new data type for the column after the MODIFY COLUMN clause.
Make sure to handle any data conversion or potential data loss when changing the data type.
Q3. how the front end communicates with the backend in Spring
Front end communicates with the backend in Spring through HTTP requests using RESTful APIs.
Front end sends HTTP requests to the backend server
Backend server processes the requests and sends back HTTP responses
Communication is typically done using RESTful APIs in Spring MVC
Data is exchanged in JSON format between front end and backend
Q4. how will you pull the pids of the java process
You can pull the pids of Java processes using command line tools like jps or ps.
Use 'jps' command to list Java processes along with their pids.
Use 'ps -ef | grep java' command to list all processes with 'java' in their name and find the pid.
You can also use tools like VisualVM or JConsole to monitor and manage Java processes.
Q5. whah happens when we do mvn clean install
mvn clean install is a Maven command used to clean the project, compile the source code, run tests, and package the application.
Removes target directory to clean project
Compiles the source code
Runs tests
Packages the application
Dependencies are downloaded if needed
Q6. how will you create a Jar/war file
To create a Jar/war file, use the jar command in the terminal or an IDE like Eclipse.
Use the jar command in the terminal to create a Jar file: jar cf jarFileName.jar file1 file2
Use the jar command with 'war' option to create a War file: jar cf warFileName.war file1 file2
In Eclipse, right-click on the project, go to Export > JAR file/WAR file, and follow the prompts
Q7. how will you replace a value in hashmap
Use the put() method to replace a value in a HashMap.
Use the put() method with the key of the value you want to replace
Example: map.put(key, newValue);
Q8. how will you reduce the heap memory
To reduce heap memory usage in Java, you can optimize code, limit object creation, use data structures efficiently, and tune JVM settings.
Optimize code by avoiding unnecessary object creation and using efficient algorithms
Limit object creation by reusing objects, using object pooling, or implementing flyweight design pattern
Use data structures efficiently by choosing the right data structure for the task at hand
Tune JVM settings such as heap size, garbage collection algorithm...read more
Q9. how will you debug the code
I will use logging, debugging tools like breakpoints, and analyzing stack traces to identify and fix issues in the code.
Use logging statements to track the flow of the code and identify any unexpected behavior.
Set breakpoints in the code to pause execution at specific points and inspect variables and data.
Analyze stack traces to understand the sequence of method calls leading to an error.
Use debugging tools like Eclipse Debugger or IntelliJ IDEA Debugger to step through the c...read more
Q10. name few annotations in springboot
Some annotations in Spring Boot are @RestController, @Autowired, @Component, @RequestMapping, @Service.
@RestController - used to define RESTful web services.
@Autowired - used for automatic dependency injection.
@Component - marks a java class as a bean so that the component-scanning mechanism of Spring can pick it up and pull it into the application context.
@RequestMapping - used to map web requests to specific handler classes or methods.
@Service - used to indicate that a clas...read more
Interview Process at LTIMindtree
Reviews
Interviews
Salaries
Users/Month