Software Engineer Trainee
300+ Software Engineer Trainee Interview Questions and Answers
Popular Companies
Q51. What are Closures, Promises in JS?
Closures are functions that have access to variables from their outer scope. Promises are objects used for asynchronous programming in JavaScript.
Closures are created when a function is defined inside another function and the inner function has access to the outer function's variables.
Closures allow for data encapsulation and private variables in JavaScript.
Promises are used to handle asynchronous operations and provide a way to handle success or failure of those operations.
P...read more
Q52. What is difference between abstraction and interface
Abstraction is a concept of hiding implementation details while interface is a blueprint of a class.
Abstraction is achieved through abstract classes and methods
Interface is a contract that defines the behavior of a class
Abstraction focuses on hiding complexity while interface focuses on providing a common standard
Abstraction can have implementation details while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
Static polymorphism refers to the mechanism where the method to be called is determined at compile time.
Method overloading is an example of static polymorphism where the method to be called is resolved at compile time based on the method signature.
Compile-time polymorphism is another term for static polymorphism.
Static polymorphism is achieved through function overloading and operator overloading.
Q54. Write a program to print the length of 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
Q55. What is the difference between 3NF and BCNF?
3NF eliminates transitive dependencies while BCNF eliminates partial dependencies.
3NF stands for Third Normal Form and BCNF stands for Boyce-Codd Normal Form.
3NF eliminates transitive dependencies by breaking down tables into smaller ones.
BCNF eliminates partial dependencies by ensuring that every determinant is a candidate key.
3NF is a subset of BCNF.
Example: In a table with columns A, B, and C, where A determines B and B determines C, 3NF would require splitting the table i...read more
Q56. Swap 2 integers without using 3rd integer
Swap 2 integers without using 3rd integer
Use XOR operator
Addition and subtraction can also be used
Bitwise operations can be used
Share interview questions and help millions of jobseekers 🌟
Q57. 5. Explain Exception Handling 6. Write code to remove duplicate elements from String.
Exception handling is a mechanism to handle runtime errors and prevent program crashes.
Exceptions are thrown when an error occurs during program execution.
Try-catch blocks are used to handle exceptions and provide alternative code paths.
Finally blocks are used to execute code regardless of whether an exception was thrown or not.
Custom exceptions can be created to handle specific errors.
Examples of exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and IO...read more
Q58. given the reference of a node delete the node from the linkedlist
Delete a node from a linked list given its reference
Set the previous node's next pointer to the current node's next pointer
Free the memory allocated to the current node
Software Engineer Trainee Jobs
Q59. what is immutability in string? java oops concepts.
Immutability in strings means that once a string object is created, its value cannot be changed.
String objects in Java are immutable, meaning their values cannot be modified after creation.
Any operation that appears to modify a string actually creates a new string object.
This helps in ensuring data integrity and thread safety.
Example: String str = "Hello"; str.concat(" World"); // This does not change the value of str, it creates a new string with the concatenated value.
Q60. Which version of Java and Spring framework have you worked in ?
I have worked with Java 8 and Spring Boot 2.4.2.
I have experience in developing RESTful APIs using Spring Boot 2.4.2.
I have worked with Spring Data JPA for database operations.
I have used Spring Security for authentication and authorization.
I have also worked with Java 8 features such as streams and lambdas.
Q61. Different between turncate and delete command
Truncate removes all data from a table while delete removes specific rows.
Truncate is faster than delete as it doesn't log individual row deletions
Truncate resets the identity of the table while delete doesn't
Truncate cannot be rolled back while delete can be
Truncate doesn't fire triggers while delete does
Q62. SQL queries for inner join and SQL commands in depth ?
SQL inner join combines rows from two or more tables based on a related column between them.
Inner join retrieves rows from both tables that have matching values in the specified column
Syntax: SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name
Example: SELECT Orders.OrderID, Customers.CustomerName FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID
Q63. 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
Q64. > Given an array of n-1 numbers 1<=a[i]<=n. We need to find the number that was missing 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
Q65. String reverse and finding index of a given character in string.
The question asks for reversing a string and finding the index of a given character in the string.
To reverse a string, you can iterate through the characters of the string and append them in reverse order to a new string or use built-in string reversal functions.
To find the index of a given character in a string, you can use the indexOf() function or iterate through the characters and compare each character with the given character.
Q66. 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
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.
Q68. What is inheritence? What is exception handling?
Inheritance is a mechanism in object-oriented programming where a class is derived from another class.
It allows for code reuse and promotes code organization.
The derived class inherits all the properties and methods of the base class.
The derived class can also override or add new properties and methods.
Example: A class 'Car' can inherit from a class 'Vehicle' and add its own properties like 'number of doors'.
Q69. State management in Functional Based Component in React JS
State management in functional components involves using hooks such as useState and useEffect.
useState hook is used to manage state in functional components
useEffect hook is used to handle side effects and update state
React Context API can be used for global state management
Redux can also be used for state management in functional components
Q70. What is recursion Diff b/w java and c++ What is oops Primary key and foreign key
Recursion, Java vs C++, OOPs, Primary and Foreign Keys
Recursion is a process where a function calls itself until a base condition is met
Java and C++ are both object-oriented programming languages, but Java is platform-independent while C++ is not
OOPs is a programming paradigm that uses objects to represent real-world entities and their interactions
Primary key is a unique identifier for a record in a database table, while foreign key is a reference to a primary key in another ...read more
Q71. What are Singleton Class, Abstract Class and Spring MVC architecture ?
Singleton, Abstract and Spring MVC are important concepts in software engineering.
Singleton class is a class that can only have one instance at a time.
Abstract class is a class that cannot be instantiated and is used as a base class for other classes.
Spring MVC is a framework for building web applications in Java.
Spring MVC follows the Model-View-Controller architecture pattern.
Singleton and Abstract classes are used for design patterns while Spring MVC is a web application f...read more
Q72. 1. Oops concept 2. Difference between keyword and identifier 3 What is avl tree 4. Fibonacci series code 5. Method over loading and overriding 6. Sql joins 7. Multiple inheritance 8. Mini projects 10. internshi...
read moreThis interview question covers various topics including OOPs concepts, keywords vs identifiers, AVL trees, Fibonacci series, method overloading and overriding, SQL joins, multiple inheritance, mini projects, and internships.
OOPs concepts refer to the principles of object-oriented programming such as encapsulation, inheritance, and polymorphism.
Keywords are reserved words in a programming language that have a specific meaning and cannot be used as identifiers.
Identifiers are n...read more
Q73. How to find the reverse of a string of a particular order seperated 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
Q74. Tell about JDBC,JVM, JDK, JRE, Servlets etc. only a bit as i am not from java background.
JDBC, JVM, JDK, JRE, and Servlets are key components in Java development.
JDBC (Java Database Connectivity) is used to connect Java applications to databases.
JVM (Java Virtual Machine) is the runtime environment for Java programs.
JDK (Java Development Kit) is a software development kit for developing Java applications.
JRE (Java Runtime Environment) is required to run Java applications on a computer.
Servlets are Java classes that extend the capabilities of servers to generate d...read more
Q75. Which languages i am familar with?
I am familiar with Java, Python, and C++.
Proficient in Java with experience in developing web applications using Spring framework
Comfortable with Python for data analysis and scripting
Familiar with C++ for competitive programming and algorithm development
Q76. what are the datatypes in C++?
C++ has various datatypes including int, float, char, bool, double, and more.
int - used for storing whole numbers
float - used for storing decimal numbers
char - used for storing single characters
bool - used for storing true or false values
double - used for storing double-precision floating-point numbers
Q77. Wrote a code to retrieve file in C
Code to retrieve a file in C
Use the fopen() function to open the file
Use the fread() function to read the contents of the file
Use the fclose() function to close the file
Q78. 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
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
Q80. How to find the year is leap or not using 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
Q81. ways to write CSS, difference b/w visibility hidden & display none property, psuedo class & elements, types of selectors, box model, flexbox & grid
CSS basics including selectors, properties, and layout techniques.
Visibility hidden hides an element but still takes up space, while display none removes it completely.
Pseudo classes and elements allow for styling based on element state or position in the document.
Selectors include element, class, ID, attribute, and descendant selectors.
Box model refers to the layout of elements with content, padding, border, and margin.
Flexbox and grid are layout techniques for creating resp...read more
Q82. What is 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
Q83. 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'.
Q84. Built a simple web application to store the data and show it to the 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
Q85. Can we have multiple catch block for only 1 try block
Yes, multiple catch blocks can be used for a single try block in Java.
Multiple catch blocks can be used to handle different types of exceptions that may occur within the try block.
The catch blocks are evaluated in order, so the first catch block that matches the exception type will be executed.
Each catch block can handle a different type of exception or the same type of exception with different handling logic.
Q86. 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
Q87. What is the difference between primary key and foreign key?
Primary key uniquely identifies a record in a table, while foreign key refers to a field in another table.
Primary key is used to enforce data integrity and ensure uniqueness of records.
Foreign key is used to establish a relationship between two tables.
A table can have only one primary key, but multiple foreign keys.
Primary key cannot have null values, while foreign key can have null values.
Example: In a database of students and courses, the student ID can be the primary key i...read more
Q88. Can you write the implementation of linklist
Implementation of a linked list
Define a Node class with data and next pointer
Create a LinkedList class with head pointer
Implement methods to add, delete, and traverse nodes
Handle edge cases like empty list or deleting head node
Q89. How NodeJS and ReactJS works on machine level.
NodeJS is a server-side JavaScript runtime while ReactJS is a client-side JavaScript library.
NodeJS runs on the server and executes JavaScript code outside of a web browser.
ReactJS is a library for building user interfaces and runs on the client-side in a web browser.
NodeJS uses an event-driven, non-blocking I/O model to handle requests efficiently.
ReactJS uses a virtual DOM to efficiently update the UI based on changes in data.
NodeJS and ReactJS can be used together to build...read more
Q90. Able to relocate according to project requirements
Yes, I am willing to relocate for project requirements.
I am open to relocating for the duration of the project
I understand that project requirements may require me to move to a different location
I am willing to adapt to new environments and work with different teams
Q91. What Algorithm you used 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
Q92. What is 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
Q93. What is primary key and application of primary key
Primary key is a unique identifier for a record in a database table.
Primary key ensures data integrity by preventing duplicate records.
It is used to establish relationships between tables in a database.
Primary key can be a single column or a combination of columns.
Examples of primary key include social security number, email address, etc.
Q94. In-depth structure of the project and its database design?
The project is a web-based inventory management system with a relational database design.
The project utilizes a MySQL database to store information about products, suppliers, and inventory levels.
Tables in the database include products, suppliers, orders, and users.
Relationships between tables are established using foreign keys.
The database design follows normalization principles to reduce redundancy and improve data integrity.
Q95. 1. Implement Fibonacci using dynamic programming 2. Strength and weakness
Implement Fibonacci using dynamic programming and discuss strengths and weaknesses.
Dynamic programming uses memoization to store previously calculated values
Fibonacci sequence is a classic example of dynamic programming
Strengths: efficient, reduces redundant calculations, improves performance
Weaknesses: requires additional memory, may not be suitable for small problems
Example: fib(n) = fib(n-1) + fib(n-2), with base cases fib(0) = 0 and fib(1) = 1
Q96. code snippets on note pad. eg reverse 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
Q97. What is the difference between method overloading and overwriting?
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
Q98. What is an Enum? implementation of an Enum
An Enum is a data type that consists of a set of named values.
Enums are used to define a set of constants that can be used throughout the code.
Each value in an Enum is assigned an integer value by default, starting from 0.
Enums can also be assigned specific integer values or even string values.
Enums can be used in switch statements to handle different cases.
Example: enum Color { RED, GREEN, BLUE };
Example: enum Status { SUCCESS = 200, ERROR = 400 };
Q99. Difference between DBMS and RDBMS?
DBMS is a software system that manages databases, while RDBMS is a type of DBMS that manages relational databases.
DBMS stands for Database Management System, which is a software system that manages databases.
RDBMS stands for Relational Database Management System, which is a type of DBMS that manages relational databases.
DBMS can handle various types of databases, including non-relational databases.
RDBMS organizes data into tables with rows and columns, and enforces relationsh...read more
Q100. what is prime numbers definition?
Prime numbers are positive integers greater than 1 that are only divisible by 1 and themselves.
Prime numbers have only two factors: 1 and the number itself.
Examples of prime numbers include 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97.
Prime numbers are important in cryptography and number theory.
Interview Questions of Similar Designations
Top Interview Questions for Software Engineer Trainee Related Skills
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month