Software Engineer Intern
100+ Software Engineer Intern Interview Questions and Answers
You are given two arbitrary binary trees consisting of N and M number of nodes respectively, your task is to check whether the two trees are mirror of each other or not.
Two trees a...read more
You have been given a sorted array/list ARR consisting of ‘N’ elements. You are also given an integer ‘K’.
Now the array is rotated at some pivot point unknown to you. For example,...read more
Software Engineer Intern Interview Questions and Answers for Freshers
You have been given 'N' ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to conn...read more
The problem is to connect N ropes of different lengths into one rope with minimum cost.
Sort the array of rope lengths in ascending order.
Initialize a variable to keep track of the total cost.
While there are more than one rope remaining, take the two shortest ropes and connect them.
Add the cost of connecting the two ropes to the total cost.
Replace the two shortest ropes with the connected rope.
Repeat the above steps until only one rope remains.
Return the total cost.
You are given a matrix 'MATRIX' of dimension 'N' x 'M'. Your task is to make all the elements of row 'i' and column 'j' equal to 0 if any element in the ith row or jth column of the matrix is 0.
Note...read more
The task is to modify a given matrix such that if any element in a row or column is 0, then make all elements in that row and column 0.
Iterate through the matrix and keep track of rows and columns that contain 0s
After the first iteration, iterate through the tracked rows and columns and set all elements to 0
Handle the case where the first row or column contains 0 separately
To solve with O(1) space complexity, use the first row and first column of the matrix to track the rows ...read more
You are given an array containing N non-negative integers. Your task is to partition this array into two subsets such that the...read more
You are given two strings, ‘A’ and ‘B’ each of length ‘N’. Your task is to print 1 if ‘A’ is similar to ‘B’.
Note :
String ‘A’ is said to be similar to string ‘B’ if and only if 1. ‘A’ is equal t...read more
The task is to determine if two strings are similar based on the given conditions.
Check if the strings are equal, if yes, return 1
Divide both strings into two parts and check if any combination satisfies the similarity condition
If none of the conditions hold true, return 0
Share interview questions and help millions of jobseekers 🌟
Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.
Example :
Merge Sort Algorithm - Merge sort is a Div...read more
You have been given a sentence ‘S’ in the form of a string and a word ‘W’, you need to find whether the word is present in the given sentence or not. The word must...read more
Software Engineer Intern Jobs
Ninja is a genius in mathematics. He got an interview call from MIT. During the interview, the professor asked Ninja a challenging question.
Given two integers 'N1' and 'N2', the professor ...read more
Given a linked list, whose nodes represent the coordinates of the cartesian plane. Find the minimum and the maximum slope of simultaneous points of coordinates.
Linked List : P1(X1, Y1) -> P2( X2, Y2)...read more
Ninja is given an integer ‘N’. Ninja wants to find whether the binary representation of integer ‘N’ is palindrome or not.
A palindrome is a sequence of characters that reads the same backward as...read more
Q12. Given a binary tree, find the maximum sum from root to leaf. The condition is that only the parent or the child can be included in the sum i.e. no two level adjacent nodes will be included in the sum
The maximum sum from root to leaf in a binary tree, where only parent or child can be included in the sum.
Use a recursive approach to traverse the binary tree.
At each node, calculate the maximum sum from its left and right child.
Compare the sums and return the maximum sum plus the value of the current node.
Repeat this process until reaching a leaf node.
Track the maximum sum encountered during the traversal.
Q13. What is Software Development Cycle??What are the phase in software development??
Software Development Cycle is a process of designing, creating, testing, and deploying software.
The phases of Software Development Cycle are Planning, Analysis, Design, Implementation, Testing, Deployment, and Maintenance.
Planning involves defining the project scope, goals, and requirements.
Analysis involves gathering and analyzing user requirements.
Design involves creating a detailed design of the software.
Implementation involves writing code and integrating different compon...read more
Q14. Best sorting algorithm and why and explain the logic
The best sorting algorithm is QuickSort due to its average case time complexity of O(nlogn) and low memory usage.
QuickSort is a divide and conquer algorithm that recursively partitions the array into smaller subarrays and sorts them.
It has an average case time complexity of O(nlogn) and a worst case time complexity of O(n^2).
QuickSort has low memory usage as it sorts the array in place, without requiring additional memory.
It is widely used in practice due to its efficiency an...read more
What is waterfall model? What are its phases?
Q16. What is waterfall model?? What are the phases in waterfall model??
Waterfall model is a linear sequential approach to software development.
Phases: Requirements gathering, Design, Implementation, Testing, Deployment, Maintenance
Each phase must be completed before moving to the next
No going back to previous phases
Documentation is important
Less flexible than Agile model
What is SDLC? What are its phases?
What is scrum methodology?
Q19. Find the output of the given psuedo code and other technical MCQs
Psuedo code output and technical MCQs for Software Engineer Intern position
Provide examples for technical MCQs
Psuedo code output needs to be calculated
Assess candidate's technical knowledge
Q20. Write a Program to print all Prime Numbers up to the number provided as input. (Prime Sieve Algorithm)
Program to print all Prime Numbers up to the input number using Prime Sieve Algorithm.
Create a boolean array of size n+1 and initialize all values as true.
Loop through the array starting from 2 and mark all multiples of each prime number as false.
Print all the numbers that are still marked as true in the array.
Q21. Minimum weight to reach bottom right corner in matrix starting from top left. You can move only down and right.
Minimum weight to reach bottom right corner in matrix starting from top left. You can move only down and right.
Use dynamic programming to solve the problem efficiently
Create a 2D array to store the minimum weight to reach each cell
The minimum weight to reach a cell is the minimum of the weight to reach the cell above and the cell to the left plus the weight of the current cell
The minimum weight to reach the bottom right corner is the value in the last cell of the 2D array
Q22. 2. What are the 4 pillars of object oriented programming explain in detail.
The 4 pillars of object oriented programming are encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Inheritance: Creating new classes based on existing classes, allowing for code reuse.
Polymorphism: The ability for objects of different classes to respond to the same message.
Abstraction: Hiding the complex implementation details and only showing the necessary features.
Q23. Find nearest index of character in string for each index.
Find the nearest index of a character in a string for each index.
Create an array of strings to store the results.
Loop through each character in the string.
For each character, loop through the rest of the string to find the nearest index of the same character.
Store the result in the array.
Q24. Self introduction,What is Test Cases,What is Bug,What is Regression Testing.
Test cases are scenarios designed to test software functionality. Bugs are defects in software. Regression testing is retesting after changes.
Test cases are written to ensure that software meets requirements and functions as expected.
Bugs are defects or errors in software that cause it to behave unexpectedly or not as intended.
Regression testing is the process of retesting software after changes have been made to ensure that existing functionality has not been affected.
Regres...read more
Query to find Nth highest Salary
Q26. Explain 4 pillars of OOPs (Abstraction, Encapsulation, Inheritance and polymorphism)
OOPs pillars are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hides complex implementation details and only shows necessary features. Example: Car dashboard displaying speed without showing internal engine details.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: Class in Java encapsulates data members and member functions.
Inheritance: Allows a new class to inherit properties and behavior of an existing cl...read more
Q27. Explain the time complexity of different sorting algorithms.
Sorting algorithms have different time complexities based on their implementation and efficiency.
Bubble Sort: O(n^2) - compares adjacent elements and swaps them if they are in the wrong order.
Merge Sort: O(n log n) - divides the array into two halves, sorts them, and then merges them.
Quick Sort: O(n log n) - picks a pivot element and partitions the array around the pivot.
Heap Sort: O(n log n) - builds a max heap and repeatedly extracts the maximum element.
Insertion Sort: O(n^...read more
Q28. Remove first and last repeating number from the list without using and space complexity. For ex. 1, 5, 7, 7, 8, 9, 9, 10, 7, 7, 7, 2, 2,3 Should return 1,5,7,8,9,9,10,7,7,7,2,3.
Remove first and last repeating number from the list without using any space complexity.
Iterate through the list and keep track of the first and last occurrences of each number.
Remove the first and last occurrences of the repeating numbers from the list.
Return the modified list.
Q29. What is segmentation fault and write the code to show this
A segmentation fault occurs when a program tries to access a memory location that it is not allowed to access.
Segmentation faults commonly occur due to accessing an uninitialized pointer or accessing an array out of bounds.
Here is an example code that causes a segmentation fault: int main() { int* ptr; *ptr = 10; return 0; }
Q30. 1.In the java multiple inheritance possible 2.reverse string line word by word,
1. Java supports multiple inheritance. 2. Reverse a string word by word.
1. Java supports multiple inheritance through interfaces. A class can implement multiple interfaces.
2. Split the string into words using split() method. Reverse the array of words and join them using join() method.
Q31. Check if a pair exists with given sum in given array.
Check if a pair exists with given sum in given array.
Iterate through the array and for each element, check if the difference between the given sum and the current element exists in the array.
Use a hash table to store the elements of the array and their indices for faster lookup.
If the sum is even, check for pairs of equal values that add up to half the sum.
If the array is sorted, use two pointers to traverse the array from both ends towards the middle.
Q32. - Programming concepts of Dynamic Programming.
Dynamic Programming is a programming concept that solves complex problems by breaking them down into smaller overlapping subproblems.
Dynamic Programming is based on the principle of optimal substructure and overlapping subproblems.
It uses memoization or tabulation techniques to store and reuse solutions to subproblems.
Dynamic Programming is often used to optimize time and space complexity in algorithms.
Examples of problems that can be solved using Dynamic Programming include ...read more
Q33. What is a project outside of Computer Science you have worked on?
I have worked on a project outside of Computer Science related to environmental conservation.
Developed a mobile application to track and monitor endangered species in local wildlife reserves.
Collaborated with a team of biologists and conservationists to gather data and design the app's features.
Implemented features like GPS tracking, photo recognition, and data visualization to aid in species identification and conservation efforts.
Q34. Find the missing number from an array which contains numbers from 1 to n-1
Find the missing number from an array containing numbers from 1 to n-1.
Calculate the sum of all numbers from 1 to n-1 using the formula n*(n-1)/2.
Calculate the sum of all numbers in the array.
Subtract the sum of array from the sum of all numbers to get the missing number.
Q35. How to get left view right view top view of binary tree
To get left view, right view, and top view of a binary tree, perform level order traversal and keep track of the first node encountered at each level.
Perform level order traversal of the binary tree
Keep track of the first node encountered at each level for left view
Keep track of the last node encountered at each level for right view
For top view, use a map to store horizontal distance and node pairs
Q36. Write a code to find the next pallindrome?(i.e. if a user inputs 1234, the immediate next pallindrome will be 1331 )
Code to find the next palindrome number after a given input.
Convert the input number to a string to easily manipulate individual digits.
Increment the input number by 1 and check if it is a palindrome.
If not a palindrome, continue incrementing until a palindrome is found.
Q37. How do you understand how a trained neural networks works ?
Understanding how a trained neural network works involves grasping the concept of layers, weights, biases, and activation functions.
Neural networks consist of layers of interconnected nodes that process input data.
Weights and biases are adjusted during training to minimize error and improve accuracy.
Activation functions introduce non-linearity to the network, allowing it to learn complex patterns.
Understanding backpropagation helps in grasping how neural networks learn from d...read more
Q38. Balanced parenthesis and have to do all permutation of it and store it in vector and return this vector
Generate all permutations of balanced parentheses and store them in a vector.
Use backtracking to generate all possible combinations of parentheses
Check for balanced parentheses using a stack
Store each valid combination in a vector
Return the vector of permutations
Q39. Write a star program in any programming language you know? How many for loops required for it?
A star program can be written using nested for loops in any programming language.
Use two nested for loops to print the rows and columns of the star pattern.
The number of rows and columns can be determined by the user input or a constant value.
The star pattern can be created using asterisks or any other character.
The number of for loops required depends on the complexity of the star pattern.
For a simple star pattern, only one for loop may be required.
Q40. two candles which were of random size, and what is the time to burn one candle completely
The time to burn one candle completely depends on the size of the candles and the rate at which they burn.
The time to burn one candle completely is directly proportional to the size of the candle.
The rate at which a candle burns can vary based on factors like the material of the candle, the wick, and the environment.
For example, a larger candle may take longer to burn completely compared to a smaller candle, even if they are both made of the same material.
Q41. How is Reliability ensured in Networks?
Reliability in networks is ensured through redundancy, fault tolerance, monitoring, and regular maintenance.
Redundancy: Having backup components or paths to prevent single points of failure.
Fault tolerance: Systems are designed to continue functioning even if a component fails.
Monitoring: Constantly checking network performance and addressing issues proactively.
Regular maintenance: Updating software, replacing hardware, and optimizing configurations to prevent failures.
Exampl...read more
Q42. What is difference between mongodb and SQL
MongoDB is a NoSQL database while SQL is a relational database management system.
MongoDB is schema-less, allowing for flexible data models.
SQL databases use structured query language for defining and manipulating data.
MongoDB is horizontally scalable, while SQL databases are vertically scalable.
SQL databases are better suited for complex queries and joins.
MongoDB is commonly used for big data and real-time applications.
SQL databases are ACID compliant, ensuring data integrity...read more
Q43. What are cubes. How are they different from Databases
Cubes are multidimensional data structures used for analysis and reporting. They differ from databases in their structure and purpose.
Cubes store data in a multidimensional format, allowing for efficient analysis and reporting.
They are designed to handle large volumes of data and provide fast query performance.
Cubes use dimensions, measures, and hierarchies to organize and analyze data.
Unlike databases, cubes are optimized for analytical processing rather than transactional p...read more
Q44. Real life example of stack and queue
Stack and queue are data structures used to store and retrieve data in a specific order.
Stack: undo/redo functionality in text editors, back button in web browsers
Queue: printing jobs in a printer, waiting list for a ride at an amusement park
Q45. What are the advantages and disadvantages of multi vendor architecture?
Multi vendor architecture offers flexibility but also introduces complexity and potential vendor lock-in.
Advantages: flexibility to choose best-of-breed solutions, competition drives innovation, reduces dependence on a single vendor
Disadvantages: increased complexity, potential for integration issues, vendor lock-in risk, increased management overhead
Example: using multiple cloud providers for redundancy and cost optimization
Example: using multiple software vendors for differ...read more
Explain the OOPS concepts.
Q47. What is scrum methodology?
Scrum is an agile methodology used for software development and project management.
It involves iterative and incremental development.
A team works on a project in sprints, typically 2-4 weeks long.
The team has daily stand-up meetings to discuss progress and plan for the day.
The product owner prioritizes the backlog of work.
At the end of each sprint, a review and retrospective are held to evaluate progress and plan for the next sprint.
Q48. How to increase the speed of React apps ,?
Optimize performance by using code splitting, lazy loading, memoization, and minimizing re-renders.
Use code splitting to load only necessary code for each route or component.
Implement lazy loading to load components only when needed.
Utilize memoization to cache expensive calculations or API calls.
Minimize re-renders by using PureComponent or memo for functional components.
Q49. Write a SQL query to move table from one Schema to other
A SQL query to move a table from one schema to another.
Use the ALTER TABLE statement to rename the table and move it to the new schema.
Specify the new schema name in the ALTER TABLE statement.
Ensure that the user executing the query has the necessary privileges to perform the operation.
Q50. What do you think makes our program unique?
The program offers hands-on experience with cutting-edge technologies and provides mentorship from industry experts.
Access to cutting-edge technologies
Mentorship from industry experts
Hands-on experience with real-world projects
Interview Questions of Similar Designations
Top Interview Questions for Software Engineer Intern 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