Software Engineer Trainee

400+ Software Engineer Trainee Interview Questions and Answers

Updated 2 Jul 2025
search-icon

Asked in HSBC Group

6d ago

Q. Palindromic Linked List Problem Statement

Given a singly linked list of integers, determine if it is a palindrome. Return true if it is a palindrome, otherwise return false.

Example:

Input:
1 -> 2 -> 3 -> 2 -> ...read more
Ans.

Check if a given singly linked list of integers is a palindrome or not.

  • Traverse the linked list to find the middle element using slow and fast pointers.

  • Reverse the second half of the linked list.

  • Compare the first half with the reversed second half to determine if it is a palindrome.

  • Example: Input: 1 -> 2 -> 3 -> 2 -> 1 -> NULL, Output: true

Asked in HSBC Group

6d ago

Q. Search in a 2D Matrix

Given a 2D matrix MAT of size M x N, where M and N represent the number of rows and columns respectively. Each row is sorted in non-decreasing order, and the first element of each row is g...read more

Ans.

Implement a function to search for a target integer in a 2D matrix with sorted rows.

  • Iterate through each row of the matrix and perform a binary search on each row to find the target integer.

  • Start the binary search by considering the entire row as a sorted array.

  • If the target is found in any row, return 'TRUE'; otherwise, return 'FALSE'.

Software Engineer Trainee Interview Questions and Answers for Freshers

illustration image

Asked in GlobalLogic

4d ago

Q. Slot Game Problem Statement

You are given a slot machine with four slots, each containing one of the colors Red (R), Yellow (Y), Green (G), or Blue (B). You must guess the colors without prior knowledge. For ea...read more

Ans.

Calculate total score based on guessing colors in a slot machine.

  • Iterate through each slot in the original and guess strings to compare colors.

  • Count perfect hits when color matches in correct slot, and pseudo-hits when color matches in different slot.

  • Calculate total score by adding perfect hits and pseudo-hits.

  • Handle edge cases like invalid input strings or exceeding constraints.

Q. 1. Explain oops and its 4 pillars 2. Explain polymorphism with real life example ( tv or mobile phone) 3. Method overloading and overriding wrt mobile and told me to write class and show the example of both. 4....

read more
Ans.

Answering questions related to software engineering concepts and database management systems.

  • OOPs is a programming paradigm that focuses on objects and their interactions.

  • The four pillars of OOPs are encapsulation, inheritance, polymorphism, and abstraction.

  • Polymorphism allows objects of different types to be treated as objects of a common type.

  • Method overloading is having multiple methods with the same name but different parameters.

  • Method overriding is having a method in a s...read more

Are these interview questions helpful?

Asked in HSBC Group

3d ago

Q. Maximum Level Sum in a Binary Tree

Given a Binary Tree with integer nodes, determine the maximum level sum among all the levels in the tree. The sum for a level is defined as the sum of all node values present ...read more

Ans.

Find the maximum level sum in a binary tree by calculating the sum of nodes at each level.

  • Traverse the binary tree level by level and calculate the sum of nodes at each level.

  • Keep track of the maximum level sum encountered so far.

  • Return the maximum level sum as the final result.

Asked in Samsung

2d ago

Q. Reverse Linked List Problem Statement

Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.

Input:

The first line of input is an integer T, rep...read more
Ans.

Reverse a singly linked list by altering the links between nodes.

  • Iterate through the linked list and reverse the links between nodes.

  • Keep track of the previous, current, and next nodes while reversing the links.

  • Update the head of the linked list to the last node after reversal.

Software Engineer Trainee Jobs

Muthoot Fincorp Ltd logo
Software Engineer Trainee_DotNet/ TVM 0-1 years
Muthoot Fincorp Ltd
4.5
Thiruvananthapuram
Kellton logo
Software Engineer Trainee 0-1 years
Kellton
2.7
Hyderabad / Secunderabad
Academian logo
Trainee Software Engineer 3-8 years
Academian
4.0
Pune

Asked in GlobalLogic

2d ago

Q. 1. What is oops concepts 2. Explain inheritance with example and how to prevent inheritance in Java?. 3. What is sealed, final, static keywords in Java 4. Implement Fibonacci, factorials, prime no. 5. Return al...

read more
Ans.

This interview question covers various topics in Java programming, including OOP concepts, inheritance, keywords, and implementing mathematical algorithms.

  • OOP concepts include encapsulation, inheritance, polymorphism, and abstraction.

  • Inheritance allows a class to inherit properties and methods from another class.

  • To prevent inheritance in Java, use the 'final' keyword before the class declaration.

  • Sealed, final, and static are keywords in Java with different functionalities.

  • Imp...read more

2d ago

Q. Can we create two columns with the same name in a relational table?

Ans.

No, we cannot create two columns with the same name in a relational table.

  • Relational databases enforce uniqueness of column names within a table.

  • Having two columns with the same name would lead to ambiguity and confusion.

  • Column names are used to uniquely identify and access data in a table.

  • If two columns have the same name, it would be impossible to distinguish between them.

  • To avoid this, column names must be unique within a table.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Adobe

5d ago

Q. Power Calculation Problem Statement

Given a number x and an exponent n, compute xn. Accept x and n as input from the user, and display the result.

Note:

You can assume that 00 = 1.

Input:
Two integers separated...read more
Ans.

Calculate x raised to the power of n. Handle edge case of 0^0 = 1.

  • Accept x and n as input from user

  • Compute x^n and display the result

  • Handle edge case of 0^0 = 1

  • Ensure x is between 0 and 8, n is between 0 and 9

Asked in TCS

2d ago

Q. If you bought a pen for 50 rupees and then sold it for 60 rupees, what is your percentage of profit or loss?

Ans.

Bought a pen for 50rs and sold it for 60rs. What is the percentage of profit or loss?

  • Profit = Selling Price - Cost Price

  • Profit = 60 - 50 = 10

  • Profit Percentage = (Profit / Cost Price) * 100

  • Profit Percentage = (10 / 50) * 100 = 20%

  • Therefore, the percentage of profit is 20%

Asked in Amazon

2d ago

Q. Inversion Count Problem

Given an integer array ARR of size N with all distinct values, determine the total number of 'Inversions' that exist.

Explanation:

An inversion is a pair of indices (i, j) such that:

  • AR...read more
Ans.

Count the total number of inversions in an integer array.

  • Iterate through the array and for each element, check how many elements to its right are smaller than it.

  • Use a merge sort based approach to efficiently count the inversions.

  • Keep track of the count of inversions while merging the sorted subarrays.

  • Example: For input [2, 4, 1, 3, 5], there are 3 inversions: (2, 1), (4, 1), and (4, 3).

Asked in Amazon

5d ago

Q. Palindrome Linked List Problem Statement

You are provided with a singly linked list of integers. Your task is to determine whether the given singly linked list is a palindrome. Return true if it is a palindrome...read more

Ans.

Check if a given singly linked list is a palindrome or not.

  • Traverse the linked list to find the middle element using slow and fast pointers.

  • Reverse the second half of the linked list.

  • Compare the first half with the reversed second half to determine if it's a palindrome.

Asked in Tech Vedika

5d ago

Q. Left Rotations of an Array

Given an array of size N and Q queries, each query requires left rotating the original array by a specified number of elements. Return the modified array for each query.

Input:

The fi...read more
Ans.

Rotate an array left by a specified number of elements for each query.

  • Parse input: read number of test cases, array size, queries, and array elements

  • For each query, left rotate the array by the specified number of elements

  • Return the modified array for each query

4d ago

Q. 1. What is OOPS concept? 2. What is difference between ARRAYS, STACKS,LINKED LISTS? 3. What are linear and non linear data structures? 4. They can ask you to code on some questions also.

Ans.

Answers to common interview questions for Software Engineer Trainee position.

  • OOPS concept is a programming paradigm that focuses on objects and their interactions.

  • Arrays are a collection of elements of the same data type, while stacks and linked lists are dynamic data structures.

  • Linear data structures have a sequential order, while non-linear data structures do not.

  • Be prepared to code on some questions, practice coding problems beforehand.

Asked in Amazon

5d ago

Q. Pair Sum Problem Statement

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.

Note:

Each pa...read more

Ans.

Given an array and a target sum, find pairs of elements that add up to the target sum.

  • Iterate through the array and for each element, check if the complement (target sum - current element) exists in a hash set.

  • If the complement exists, add the pair to the result list.

  • Sort the result list based on the first element of each pair, and then the second element if the first elements are equal.

Asked in Cognizant

4d ago

Q. Your name is repeated multiple times in a database. How would you reduce or remove this redundancy?

Ans.

To remove redundancy in a database with repeated names, use normalization techniques.

  • Identify the primary key of the table and ensure it is unique

  • Create separate tables for related data to avoid repeating information

  • Use foreign keys to link related tables

  • Consider using indexing to improve performance

  • Update existing data to conform to the new structure

3d ago

Q. N Queens Problem

Given an integer N, find all possible placements of N queens on an N x N chessboard such that no two queens threaten each other.

Explanation:

A queen can attack another queen if they are in the...read more

Ans.

The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard where no two queens threaten each other.

  • Understand the constraints of the problem: N represents the size of the chessboard and the number of queens, and queens can attack each other if they are in the same row, column, or diagonal.

  • Implement a backtracking algorithm to explore all possible configurations of queen placements without conflicts.

  • Ensure that each valid configuration is ...read more

Asked in Google

3d ago

Q. What is Java? Features of Java? Ans-java is a high level programing language and it is platform independent. Java is a collection of objects It was developed by sun Microsystem.There are lot of application,webs...

read more
Ans.

Java is a high-level, object-oriented programming language that is platform-independent and widely used for developing applications, websites, and games.

  • Developed by Sun Microsystems

  • Collection of objects

  • High performance and multi-threaded

  • Used for developing Android apps, enterprise applications, and web applications

2d ago

Q. Two complement of a number 1001 what is data structures?, types of data structures ? what is maching learning name diff methods used in machine learning basic Java concepts from OOPs as per my interview experie...

read more
Ans.

The question covers topics like two's complement, data structures, machine learning, and OOPs concepts in Java.

  • Two's complement of a number 1001 is -0111.

  • Data structures are ways of organizing and storing data in a computer so that it can be accessed and used efficiently. Examples include arrays, linked lists, stacks, queues, trees, and graphs.

  • Machine learning is a subset of artificial intelligence that involves training algorithms to make predictions or decisions based on da...read more

Q. There is a 5L measuring jar and a 3L measuring jar, a bucket full of water, and an empty bucket. How can you measure 7L using the measuring jars?

Ans.

Use a 5L and a 3L jar to measure exactly 7L of water from a bucket.

  • Fill the 5L jar completely from the bucket.

  • Pour water from the 5L jar into the 3L jar until the 3L jar is full.

  • This leaves you with 2L of water in the 5L jar.

  • Empty the 3L jar back into the bucket.

  • Pour the remaining 2L from the 5L jar into the 3L jar.

  • Fill the 5L jar again from the bucket.

  • Now pour water from the 5L jar into the 3L jar until the 3L jar is full.

  • You will have exactly 7L in the bucket.

1d ago
Q. How is an abstract class different from an interface?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have method implementations, while interface cannot.

  • A class can implement multiple interfaces, but can only inherit from one abstract class.

  • Interfaces are used to define contracts for classes to implement, while abstract classes are used to provide a common base for subclasses.

  • Example: Abstract class 'Shape' with abstract method 'calculateArea' and...read more

Asked in Cognizant

1d ago

Q. What process is used to convert a datatype into another?

Ans.

Typecasting is used to convert one datatype into another.

  • Typecasting is the process of converting a value from one datatype to another.

  • It can be done implicitly or explicitly.

  • Implicit typecasting is done automatically by the compiler.

  • Explicit typecasting is done manually by the programmer using casting operators.

  • Examples of typecasting include converting an integer to a float, a string to an integer, etc.

Asked in DEVtrust

2d ago

Q. Develop a fully functional "To Do List" application with a modern design, including header and footer, and implement functionalities like 'Add', 'Edit', 'Delete', and 'View List' within 30 minutes during the li...

read more
Ans.

Develop a 'To Do List' application with modern design and functionality like 'Add', 'Edit', 'Delete', and 'View List' within ½ hour.

  • Use HTML, CSS, and JavaScript for front-end development

  • Implement CRUD operations for tasks (Create, Read, Update, Delete)

  • Design a user-friendly interface with header and footer

  • Utilize localStorage or backend server for data storage

Asked in Cognizant

2d ago

Q. What do you mean by call by value and call by reference in functions?

Ans.

Call by value and reference are two ways of passing arguments to functions.

  • Call by value passes a copy of the argument's value to the function.

  • Call by reference passes a reference to the argument's memory location to the function.

  • Functions that use call by value cannot modify the original value of the argument.

  • Functions that use call by reference can modify the original value of the argument.

  • In some programming languages, call by reference is achieved using pointers.

  • Example: ...read more

3d ago

Q. 2. Which programming language you are good in? 3. What are the pillars of OOP? Explain in deep. 4. SQL queries. 5. Easy level coding.

Ans.

Answering questions related to programming languages, OOP, SQL queries, and easy level coding.

  • I am proficient in Java and Python.

  • The four pillars of OOP are encapsulation, inheritance, abstraction, and polymorphism.

  • SQL queries involve selecting, inserting, updating, and deleting data from a database.

  • I am comfortable with easy level coding challenges such as implementing basic algorithms or solving simple problems.

Asked in TCS

6d ago

Q. what is mean by stress and strain and what are its units?

Ans.

Stress is the force applied to an object, while strain is the deformation caused by that force.

  • Stress is measured in units of force per unit area, such as pounds per square inch (psi) or newtons per square meter (N/m²).

  • Strain is a dimensionless quantity, typically expressed as a percentage or decimal, and is calculated as the change in length or shape divided by the original length or shape.

  • Stress and strain are related by a material's modulus of elasticity, which describes h...read more

Asked in TCS

2d ago

Q. How do you print a statement in Python?

Ans.

To print a statement in Python, use the print() function.

  • Use the print() function followed by the statement you want to print.

  • Enclose the statement in quotes if it is a string.

  • You can also print variables or expressions by separating them with commas.

  • To print multiple statements on the same line, use the end parameter.

4d ago

Q. Which programming language are you comfortable with?

Ans.

I am comfortable with Java and Python.

  • Proficient in Java and Python programming languages

  • Experience in developing web applications using Java frameworks like Spring and Hibernate

  • Familiar with Python libraries like NumPy and Pandas for data analysis

  • Comfortable with object-oriented programming concepts and design patterns

Asked in Wipro

1d ago

Q. What is a database?

Ans.

A database is a structured collection of data that is organized and stored for easy access, retrieval, and management.

  • A database is used to store and manage large amounts of data.

  • It provides a way to organize and structure data for efficient storage and retrieval.

  • Databases can be relational, object-oriented, or hierarchical, depending on the data model used.

  • Examples of databases include MySQL, Oracle, MongoDB, and SQLite.

Asked in GlobalLogic

2d ago

Q. 1.What is primary foreign key 2. Explain ACID properties 3. Return 3 rd maximum salary 4. One SQL query on join 5. IN In SQL 6. Let var const in JS 7. what is proto in JS 8. Explain closure in JS

Ans.

Answers to interview questions for Software Engineer Trainee

  • Primary foreign key is a column in a table that is used to link to the primary key of another table

  • ACID properties are Atomicity, Consistency, Isolation, and Durability which ensure database transactions are reliable

  • To return 3rd maximum salary, use the LIMIT and OFFSET clauses in SQL

  • SQL join is used to combine data from two or more tables based on a related column

  • IN in SQL is used to specify multiple values in a WHE...read more

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
LTIMindtree Logo
3.7
 • 3k Interviews
GlobalLogic Logo
3.6
 • 628 Interviews
HSBC Group Logo
3.9
 • 511 Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Software Engineer Trainee Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits