
LTIMindtree

LTIMindtree Engineer Trainee Interview Questions and Answers for Freshers
Q1. What is the interface in Java? Provide an example, how you use it?
Interface in Java defines a set of methods that a class must implement.
Interface in Java is a blueprint of a class. It only contains method signatures without the body.
Classes can implement multiple interfaces but can only extend one class.
Example: interface Animal { void eat(); } class Dog implements Animal { public void eat() { System.out.println("Dog is eating"); }}
Q2. What is the class in Java? Explain with an example.
In Java, a class is a blueprint for creating objects. It defines the properties and behaviors of objects.
A class in Java is a template for creating objects, which encapsulates data for the object and methods to manipulate that data.
Classes are defined using the 'class' keyword followed by the class name.
Example: class Car { private String color; public void setColor(String c) { color = c; } }
Q3. Write SQL commands to create a student table with ID and name, columns, and the data and designing order of ID
Creating a student table in SQL with ID and name columns and setting the order of ID
Use CREATE TABLE command to create the student table
Specify ID and name columns with their data types
Set the ID column as the primary key to enforce uniqueness and order
Q4. Write a java proram to check if a given string is a palindrome
A Java program to check if a given string is a palindrome.
Create a function that takes a string as input.
Use two pointers, one starting from the beginning and one from the end, to compare characters.
If all characters match, the string is a palindrome.
Example: 'racecar' is a palindrome, 'hello' is not.
Q5. Write a code in Java, explain the concept of a class, using example of a fruit class
Explanation of a class in Java using a fruit class example
A class in Java is a blueprint for creating objects. It defines the properties and behaviors of objects.
In the case of a fruit class, properties could include name, color, and taste, while behaviors could include methods like ripen() and rot().
Example: class Fruit { String name; String color; String taste; void ripen() { //code to ripen fruit } void rot() { //code to rot fruit }}
Q6. What are ddl and dml commands in SQL
DDL (Data Definition Language) commands are used to define the structure of a database, while DML (Data Manipulation Language) commands are used to manipulate data within the database.
DDL commands include CREATE, ALTER, DROP, TRUNCATE, etc.
DML commands include INSERT, UPDATE, DELETE, SELECT, etc.
DDL commands are used to create or modify the structure of database objects like tables, indexes, etc.
DML commands are used to manipulate data stored in the database tables.
Example of...read more
More about working at LTIMindtree




Top HR Questions asked in LTIMindtree Engineer Trainee for Freshers
Interview Process at LTIMindtree Engineer Trainee for Freshers

Top Engineer Trainee Interview Questions from Similar Companies






Reviews
Interviews
Salaries
Users/Month

