Software Engineer Trainee
100+ Software Engineer Trainee Interview Questions and Answers for Freshers

Asked in Srichid Technologies

Q. Write a program to print the length of the number of permutations if the given input is "123".
Program to print the length of number of permutations of a given input
Use recursion to generate all permutations
Count the number of permutations and print the length

Asked in Tagit Pte

Q. What are the features of Java 8 that you are familiar with?
Java 8 features include lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow you to write code in a more concise and readable way.
Functional interfaces are interfaces with a single abstract method, used for lambda expressions.
Streams provide a way to work with sequences of elements and perform operations like filter, map, and reduce.
Default methods allow interfaces to have method implementations.
Example: (1) Lambda expression - (a, ...read more

Asked in Nihilent

Q. How can you swap two integers without using a third variable?
Swap 2 integers without using 3rd integer
Use XOR operator
Addition and subtraction can also be used
Bitwise operations can be used

Asked in IVY SOFTWARE DEVELOPMENT SERVICES

Q. Given an array of n-1 numbers where 1<=a[i]<=n, how do you find the missing number from the array?
Given an array of n-1 numbers 1<=a[i]<=n, find the missing number.
Calculate the sum of all numbers from 1 to n using the formula n*(n+1)/2
Calculate the sum of all elements in the array
Subtract the sum of array elements from the sum of all numbers to get the missing number
Asked in DigiBoxx

Q. What are components and state in ReactJS?
Components are reusable UI elements in ReactJs. State is an object that stores data and controls a component's behavior.
Components are like building blocks that can be combined to create complex UIs
State is used to store and manage data within a component
Changes to state trigger a re-render of the component
State should be kept as minimal as possible to avoid performance issues
Example: A button component can have a state that tracks the number of times it has been clicked

Asked in HSBC Group

Private and special IP addresses are reserved ranges of IP addresses used for specific purposes.
Private IP addresses are used within a private network and are not routable on the internet.
Special IP addresses include loopback address (127.0.0.1) and broadcast address (255.255.255.255).
Private IP ranges include 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255.
Software Engineer Trainee Jobs




Asked in Raja Software Labs

Q. How can you determine if a year is a leap year using a single if condition?
To find leap year using single if condition
Check if year is divisible by 4 and not divisible by 100
Or check if year is divisible by 400
If either of the above conditions is true, then it's a leap year

Asked in Raja Software Labs

Q. How do you reverse a string with elements separated by dots?
To reverse a string of a particular order separated by dots, split the string into an array, reverse the array, and join it back into a string.
Split the string using the dot separator
Reverse the resulting array
Join the array back into a string using the dot separator
Share interview questions and help millions of jobseekers 🌟

Asked in DEVtrust

Q. What is the DISTINCT keyword in SQL?
Distinct keyword in SQL is used to retrieve unique values from a column in a table.
Distinct keyword eliminates duplicate rows from the result set
It is often used in conjunction with SELECT statement
Example: SELECT DISTINCT column_name FROM table_name

Asked in Monotype

Q. Describe how you would build a simple web application to store data and display it in a browser.
I would use a combination of HTML, CSS, and JavaScript to create a simple web application that stores and displays data.
Use HTML to create the structure of the web application
Use CSS to style the elements on the page
Use JavaScript to handle user interactions and store/retrieve data
Consider using a backend server (e.g. Node.js) to handle data storage and retrieval
Utilize AJAX to fetch data from the server asynchronously

Asked in Tagit Pte

Q. What are the key Object-Oriented Programming (OOP) concepts in Java?
Key OOP concepts in Java include classes, objects, inheritance, polymorphism, encapsulation, and abstraction.
Classes: Blueprint for creating objects, containing attributes and methods.
Objects: Instances of classes that encapsulate data and behavior.
Inheritance: Allows a class to inherit attributes and methods from another class.
Polymorphism: Ability to present the same interface for different data types.
Encapsulation: Bundling data and methods that operate on the data into a ...read more

Asked in Srijan Technologies

The OSI Reference Model defines 7 layers that represent different functions in networking.
Physical Layer - deals with physical connections and signals (e.g. cables, hubs)
Data Link Layer - manages data transfer between devices on the same network (e.g. Ethernet)
Network Layer - handles routing and forwarding of data packets (e.g. IP)
Transport Layer - ensures reliable data delivery (e.g. TCP)
Session Layer - establishes, maintains, and terminates connections (e.g. SSL)
Presentatio...read more
Asked in DigiBoxx

Q. Explain setTimeout, setImmediate, and process.nextTick.
setTimeout, setImmediate and process.nextTick are Node.js functions used for asynchronous programming.
setTimeout is used to execute a function after a specified amount of time has passed.
setImmediate is used to execute a function immediately after the current event loop iteration.
process.nextTick is used to execute a function at the beginning of the next event loop iteration.
setTimeout and setImmediate are similar, but setImmediate has higher priority in the event loop.
proces...read more

Asked in Locus Elite

Q. Write concise code to add two strings, such as str1="1234" and str2="8765".
Use concatenation operator to add two strings.
Use '+' operator to concatenate two strings.
Example: str1 + str2 will result in '12348765'.

Asked in TCS

Q. What is the difference between method overloading and method overriding?
Method overloading involves multiple methods in the same class with the same name but different parameters. Method overriding involves a subclass providing a specific implementation of a method that is already provided by its superclass.
Method overloading is achieved within the same class by having multiple methods with the same name but different parameters.
Method overriding occurs in a subclass that provides a specific implementation of a method that is already provided by ...read more
Asked in DigiBoxx

Q. What algorithm did you use in your project?
I used the Dijkstra's algorithm for finding the shortest path in my project.
Implemented Dijkstra's algorithm to find the shortest path between nodes in a graph
Used priority queue to optimize the algorithm
Considered edge weights and node distances while calculating the shortest path
Asked in DigiBoxx

Q. What is the life cycle in ReactJS?
ReactJS life cycle refers to the series of methods that are invoked in the process of creating, updating and destroying a component.
ReactJS life cycle consists of three phases: Mounting, Updating and Unmounting.
Mounting phase includes methods like constructor, render, componentDidMount.
Updating phase includes methods like shouldComponentUpdate, render, componentDidUpdate.
Unmounting phase includes method componentWillUnmount.
These methods help in managing the state and props o...read more

Asked in Neebal Technologies

Q. Write code snippets on notepad to, for example, reverse a string.
Reverse a string using array manipulation
Create an array of characters from the input string
Use a loop to iterate through the array in reverse order
Append each character to a new string to form the reversed string

Asked in Float Group

Q. What is dependency injection and how does Spring Boot support it?
Dependency injection is a design pattern that allows for better code modularity and testing by injecting dependencies at runtime.
Promotes loose coupling between classes by injecting dependencies rather than hardcoding them.
Spring Boot uses annotations like @Autowired, @Component, and @Service to manage dependencies.
Example: A service class can be injected into a controller using @Autowired, allowing for easier testing and maintenance.
Supports different types of dependency inj...read more

Asked in Float Group

Q. What is the purpose of the final, finally, and finalize() keywords?
final, finally, and finalize() serve different purposes in Java: controlling variable scope, exception handling, and garbage collection.
final: Used to declare constants or prevent method overriding and inheritance. Example: final int x = 10;
finally: A block that executes after try-catch, regardless of exceptions. Example: try { ... } catch { ... } finally { ... }
finalize(): A method called by the garbage collector before an object is removed. Example: protected void finalize(...read more
Asked in DigiBoxx

Q. What is the purpose of the getDerivedStateFromProps() and getSnapshotBeforeUpdate() lifecycle methods?
getDerivedStateFromProps() updates state based on props changes. getSnapshotBeforeUpdate() captures current state before update.
getDerivedStateFromProps() is called before rendering and updates state based on changes in props.
getSnapshotBeforeUpdate() is called after rendering but before updating the DOM. It captures current state before update.
getDerivedStateFromProps() is a static method and should return an object to update state or null to indicate no update.
getSnapshotBe...read more

Asked in DEVtrust

Q. Write code for merging two sorted arrays.
Code to merge two sorted arrays
Create a new array to store the merged result
Use two pointers to iterate through both arrays and compare elements
Add the smaller element to the new array and move the pointer for that array

Asked in DEVtrust

Q. What are Integrity Constraints?
Integrity constraints are rules that ensure data integrity and consistency in a database.
Integrity constraints are used to enforce business rules or data quality rules in a database.
They can include rules such as unique constraints, foreign key constraints, and check constraints.
Unique constraints ensure that no two rows have the same value in a specified column.
Foreign key constraints enforce referential integrity by ensuring that values in one table match values in another ...read more

Asked in Tagit Pte

Q. What is exception handling in programming?
Exception handling is a mechanism to handle runtime errors in a program to prevent it from crashing.
Exceptions are unexpected events that occur during the execution of a program.
Exception handling allows the programmer to gracefully handle these errors and prevent the program from crashing.
Common exception handling constructs include try, catch, and finally blocks.
Example: try { // code that may throw an exception } catch(Exception e) { // handle the exception }
Example: final...read more

Asked in A To Z

Q. What is inheritance and encapsulation?
Inheritance is a mechanism where a new class is derived from an existing class. Encapsulation is the process of hiding implementation details from the user.
Inheritance allows the new class to inherit properties and methods of the existing class.
Encapsulation helps in achieving data abstraction and security.
Inheritance promotes code reusability while encapsulation promotes data security.
Example of inheritance: class Car extends Vehicle
Example of encapsulation: private variable...read more

Asked in GlobalLogic

Q. Definitions and example code of OOPS Concepts
OOPS Concepts are fundamental principles of Object-Oriented Programming.
Encapsulation - bundling of data and methods that operate on that data
Inheritance - ability of a class to inherit properties and methods from its parent class
Polymorphism - ability of objects to take on multiple forms
Abstraction - hiding of complex implementation details from the user
Example code: class Car { private String make; public void setMake(String make) { this.make = make; } }
Asked in DigiBoxx

Q. Explain Local Storage, Session Storage, and caching in Web development.
Local Storage, Session Storage, and Cache are used to store data in the browser for faster access and better user experience.
Local Storage: stores data with no expiration date and can be accessed across multiple windows and tabs
Session Storage: stores data for a single session and is cleared when the session ends
Cache: stores data temporarily to reduce server load and improve performance
Examples: storing user preferences, caching images and scripts for faster page load

Asked in Novac Technology Solutions

Q. In SQL Server, how can you combine data from two tables with identical columns without using JOIN clauses?
Combine two tables with identical columns in SQL Server without using traditional joins, leveraging UNION or subqueries instead.
Use UNION to combine results from both tables: SELECT * FROM Table1 UNION SELECT * FROM Table2;
UNION ALL can be used if you want to include duplicate rows: SELECT * FROM Table1 UNION ALL SELECT * FROM Table2;
Subqueries can also be utilized: SELECT * FROM (SELECT * FROM Table1) AS T1, (SELECT * FROM Table2) AS T2;
Ensure both tables have the same numbe...read more

Asked in Aseuro Technologies

Q. What is the difference between delete, drop, and truncate?
Delete, drop, and truncate are SQL commands for removing data, but they differ in scope and performance.
DELETE removes specific rows based on a condition. Example: DELETE FROM table WHERE id = 1;
DROP removes an entire table or database. Example: DROP TABLE table_name;
TRUNCATE removes all rows from a table but keeps its structure. Example: TRUNCATE TABLE table_name;
DELETE is slower as it logs each row deletion, while TRUNCATE is faster as it doesn't log individual row deletion...read more

Asked in TCS

Q. Why do we need databases?
Databases are essential for storing, organizing, and retrieving large amounts of data efficiently.
Databases provide a structured way to store and manage data.
They allow for efficient retrieval of data through queries.
Databases can handle large amounts of data and ensure data integrity.
They enable multiple users to access and modify data simultaneously.
Examples include MySQL, Oracle, MongoDB, and SQL Server.
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Software Engineer Trainee Related Skills



Reviews
Interviews
Salaries
Users

