Software Development Engineer Intern

80+ Software Development Engineer Intern Interview Questions and Answers

Updated 15 Dec 2024

Popular Companies

search-icon

Q1. Say you're dealing with really long integers. They're too long to fit into a regular datatype, so linked lists are used to store them, with each node of the list containing one digit. Now the problem is, given ...

read more
Ans.

Given two linked lists representing long integers, perform addition operation.

  • Traverse both linked lists simultaneously, starting from the head.

  • Perform addition of corresponding digits and keep track of carry.

  • Create a new linked list to store the result.

  • Handle cases where one list is longer than the other.

  • Handle the final carry if any.

Q2. Given a linked list (singly-linked, non-circular), swap the kth node with the kth last node in the list. Note that the length of the list is not known.

Ans.

Swap kth node with kth last node in a singly-linked, non-circular linked list.

  • Traverse the linked list to find its length or use two pointers to find kth and kth last nodes.

  • Swap the nodes and update the pointers accordingly.

  • Handle edge cases such as k being out of bounds or kth and kth last nodes being the same.

  • Consider using recursion to traverse the linked list.

Software Development Engineer Intern Interview Questions and Answers for Freshers

illustration image

Q3. long numbers, add the two numbers and store the result in a third linked list. 2/2

Ans.

Add two long numbers and store the result in a third linked list.

  • Create a linked list to store the result

  • Traverse both input linked lists simultaneously, adding corresponding digits

  • Handle carry over from addition

  • If one linked list is longer than the other, handle remaining digits

  • Return the resulting linked list

Q4. what is the angle between minute and hour hand at 1:15

Ans.

The angle between the minute and hour hand at 1:15 is 7.5 degrees.

  • At 1:15, the minute hand is at 3 and the hour hand is slightly past 1

  • Calculate the angles covered by each hand from 12 o'clock position

  • Subtract the smaller angle from the larger angle to get the angle between the hands

Are these interview questions helpful?

Q5. Given a Binary Search Tree, print the kth last node in inorder traversal of the tree

Ans.

To print the kth last node in inorder traversal of a Binary Search Tree, we can use a modified inorder traversal algorithm.

  • Perform an inorder traversal of the BST, keeping track of the nodes visited in a stack.

  • Once the traversal is complete, pop k elements from the stack to get the kth last node.

  • Print the value of the kth last node.

Q6. What are hamming distance and hamming weights? Write code to calculate hamming distance between 2 numbers.

Ans.

Hamming distance is the number of differing bits between two binary strings. Hamming weight is the number of 1s in a binary string.

  • Hamming distance is used in error detection and correction codes.

  • Hamming weight is also known as population count or popcount.

  • To calculate hamming distance, XOR two numbers and count the number of 1s in the result.

  • Example: Hamming distance between 1010 and 1110 is 1.

  • Example: Hamming weight of 1010 is 2.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. What is the problem statement for the "Subsequence" question from LeetCode, which is categorized as medium to hard level and focuses on arrays?

Ans.

Find the length of the longest increasing subsequence in an array of integers.

  • The problem involves finding the length of the longest increasing subsequence in an array of integers.

  • The subsequence does not have to be contiguous, but the elements must be in increasing order.

  • Dynamic programming can be used to solve this problem efficiently.

  • Example: Input: [10, 9, 2, 5, 3, 7, 101, 18] Output: 4 (The longest increasing subsequence is [2, 3, 7, 101])

Q8. List some sorting algorithms. Why time complexity of merge sort is O(nlogn)

Ans.

Sorting algorithms include bubble sort, insertion sort, selection sort, quick sort, merge sort, etc. Merge sort has O(nlogn) time complexity.

  • Sorting algorithms are used to arrange data in a specific order.

  • Merge sort is a divide and conquer algorithm that divides the input array into two halves, sorts each half, and then merges the sorted halves.

  • The time complexity of merge sort is O(nlogn) because it divides the input array into halves recursively until the base case is reach...read more

Software Development Engineer Intern Jobs

0

Q9. How does an internet webpage work and get the right content to be displayed?

Ans.

An internet webpage works by sending a request to a server, which then processes the request and sends back the necessary content to be displayed.

  • When a user enters a URL in a web browser, the browser sends a request to a server hosting the webpage.

  • The server processes the request, retrieves the necessary files (HTML, CSS, JavaScript, images, etc.), and sends them back to the browser.

  • The browser then renders the content received from the server and displays it to the user.

  • Web...read more

Q10. What data structure do you know? Advantages and disadvantages of singly and doubly linked lists

Ans.

Singly and doubly linked lists are linear data structures used to store and manipulate data.

  • Singly linked lists use less memory than doubly linked lists

  • Doubly linked lists allow for traversal in both directions

  • Singly linked lists are faster for insertion and deletion at the beginning of the list

  • Doubly linked lists are faster for insertion and deletion in the middle of the list

  • Both have O(n) time complexity for searching

Q11. What is the Many-Many Relationship in SQL ? Explain with an example.

Ans.

Many-Many Relationship in SQL is a type of relationship where each record in one table can be related to multiple records in another table.

  • Many-Many Relationship requires a junction table to connect the two tables

  • It is used when multiple records in one table can be related to multiple records in another table

  • Example: A student can enroll in multiple courses and a course can have multiple students enrolled, so a junction table 'Enrollment' will have student_id and course_id co...read more

Q12. what is insertion sort and tell me implementation ?

Ans.

Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time.

  • Iterate through the array starting from the second element.

  • Compare each element with the elements before it and insert it in the correct position.

  • Repeat until all elements are sorted.

  • Example: [5, 2, 4, 6, 1, 3] -> [2, 4, 5, 6, 1, 3] -> [2, 4, 5, 6, 1, 3] -> [1, 2, 4, 5, 6, 3] -> [1, 2, 3, 4, 5, 6]

Q13. what is adressing mode and its types

Ans.

Addressing mode is a technique used in computer architecture to specify how to calculate the effective address of an operand.

  • Addressing mode determines how the CPU accesses data from memory

  • Types of addressing modes include direct, indirect, indexed, and register

  • Examples: direct addressing mode - MOV A, 1000H, indirect addressing mode - MOV A, [BX], indexed addressing mode - MOV A, [BX+SI], register addressing mode - MOV A, BX

Q14. What is the concept of polymorphism in programming?

Q15. What is difference between string and string builder

Ans.

String is immutable while StringBuilder is mutable in Java.

  • String is immutable, meaning once created, it cannot be changed. StringBuilder is mutable, allowing for modifications.

  • String concatenation creates a new string object each time, while StringBuilder allows for efficient string manipulation.

  • StringBuilder is more efficient for concatenating multiple strings in a loop.

  • Example: String str = "Hello"; StringBuilder sb = new StringBuilder("Hello");

  • Example: str += " World"; sb...read more

Q16. What is ai and what are its features

Ans.

AI stands for artificial intelligence, which is the simulation of human intelligence processes by machines.

  • AI involves machines performing tasks that typically require human intelligence, such as visual perception, speech recognition, decision-making, and language translation.

  • AI systems can learn from data, adapt to new inputs, and perform tasks autonomously.

  • Examples of AI include virtual assistants like Siri and Alexa, self-driving cars, and recommendation systems like those...read more

Q17. What pattern have you followed while building modules.

Ans.

I have followed the modular design pattern while building modules.

  • I break down the software into smaller, independent modules that can be easily managed and maintained.

  • I ensure each module has a clear purpose and well-defined interfaces for communication with other modules.

  • I use techniques like encapsulation, abstraction, and separation of concerns to create modular designs.

  • Example: Using the MVC (Model-View-Controller) pattern to separate the presentation, business logic, an...read more

Q18. array with elements that represent buildings and their heights, find buildings that have a lakeside view

Ans.

Iterate through the array and find buildings with a view of the lake based on their heights.

  • Iterate through the array of buildings

  • Compare the height of each building with the buildings on its right to determine if it has a lakeside view

  • Keep track of buildings with a lakeside view

Q19. 1. find loop in the linked list 2. print spiral matrix

Ans.

To find a loop in a linked list and print a spiral matrix

  • To find a loop in a linked list, we can use Floyd's Tortoise and Hare algorithm which uses two pointers moving at different speeds to detect a cycle

  • To print a spiral matrix, we can use a combination of four loops to traverse the matrix in a spiral order, updating the boundaries after each traversal

Q20. write a program for Trapping Rain Water . what is time complexity of the program

Ans.

The program calculates the amount of rainwater that can be trapped between buildings given an array of heights.

  • Use two pointers to iterate from left and right towards the middle

  • Keep track of the maximum height on the left and right for each pointer

  • Calculate the trapped water at each index based on the minimum of the maximum heights on left and right

  • Sum up the trapped water at each index to get the total trapped water

Q21. write a program to find out Diameter of Tree what is time complexity of the program

Ans.

Program to find diameter of a tree and its time complexity

  • Use Depth First Search (DFS) to find the longest path in the tree

  • Calculate the diameter by summing the heights of the left and right subtrees for each node

  • Time complexity is O(n) where n is the number of nodes in the tree

Q22. find floor square root of number n, without using sort() function. 1<=n<=10^12

Ans.

Implement a function to find the floor square root of a given number without using sort() function.

  • Use binary search to find the square root of the number.

  • Start with a low value of 0 and high value of n.

  • Check the middle value and adjust the range accordingly.

  • Repeat until you find the floor square root.

Q23. Convert the numbers in words to actual integers. Like"Twenty three thousand and four" to 23004

Ans.

Convert numbers in words to integers, like 'Twenty three thousand and four' to 23004.

  • Split the input string into individual words

  • Create a dictionary mapping words to their numerical values

  • Iterate through the words and construct the integer value based on the dictionary

  • Handle special cases like 'hundred', 'thousand', etc.

Q24. Worst ever your mental health will going to be destroyed fully

Ans.

The question seems to be asking about a scenario where mental health is severely impacted.

  • It is important to seek help from mental health professionals if you feel like your mental health is deteriorating.

  • Taking breaks, practicing self-care, and seeking support from friends and family can help in maintaining mental well-being.

  • Examples of situations that could lead to severe impact on mental health include prolonged stress, traumatic events, or untreated mental health conditio...read more

Q25. DSA 1 . Common Intersection Point Of Two Linked Lists

Ans.

Find the common intersection point of two linked lists.

  • Traverse both linked lists to find their lengths.

  • Align the longer linked list's head to match the length of the shorter linked list.

  • Traverse both lists in parallel until a common node is found.

Q26. what is tcp osi difference

Ans.

TCP is a transport layer protocol while OSI is a reference model for network communication.

  • TCP is a protocol responsible for establishing and maintaining a connection between two devices.

  • OSI is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven abstraction layers.

  • TCP operates at the transport layer (Layer 4) of the OSI model.

  • OSI model includes layers like physical, data link, network, transport, session, presentation, ...read more

Q27. Combinatorics, find pivot in rotated sorted array, count sort

Ans.

The question involves finding the pivot in a rotated sorted array using combinatorics and count sort.

  • To find the pivot in a rotated sorted array, we can use a modified binary search algorithm.

  • First, we compare the middle element with the first element to determine if the pivot is in the left or right half.

  • Then, we continue dividing the array in half and adjusting the search range based on the pivot's location.

  • Count sort is a sorting algorithm that works well when the range of...read more

Q28. Do you know React or Angular?

Ans.

Yes, I am proficient in React and have experience working with Angular as well.

  • Proficient in React for building user interfaces

  • Experience working with Angular for front-end development

  • Familiar with component-based architecture in both React and Angular

Q29. What are ten essential GitHub commands?

Q30. find first missing positive integer with O(N)

Ans.

Find the first missing positive integer in an array with O(N) time complexity.

  • Iterate through the array and place each element in its correct position (e.g. place 1 in index 0, 2 in index 1, etc.).

  • After rearranging the array, iterate through it again to find the first missing positive integer.

  • Return the missing positive integer found.

Q31. Find the starting point of linked list

Ans.

Traverse the linked list to find the starting point by using Floyd's Tortoise and Hare algorithm

  • Use two pointers, slow and fast, to traverse the linked list

  • Move slow pointer by one step and fast pointer by two steps

  • When they meet, reset one pointer to the head and move both pointers by one step until they meet again

Q32. What Improvement is required in the app

Ans.

The app needs to improve its user interface for better user experience.

  • Enhance navigation by simplifying menu options

  • Improve loading times for faster access to content

  • Implement a more intuitive search feature

  • Enhance visual design for a more modern look

Q33. Reverse nodes in k groups, sum of right leaf nodes

Ans.

The question involves reversing nodes in groups of k and finding the sum of right leaf nodes.

  • Implement a function to reverse nodes in groups of k

  • Traverse the reversed linked list and find the sum of right leaf nodes

  • Handle edge cases like when the number of nodes is not a multiple of k

Q34. Sum of right leaf nodes, swap nodes in k groups

Ans.

The question involves finding the sum of right leaf nodes and swapping nodes in groups of k.

  • The sum of right leaf nodes can be found by traversing the tree and checking if a node is a right leaf node.

  • Swapping nodes in groups of k can be done by iterating through the linked list and swapping the nodes in each group.

  • Examples: For the sum of right leaf nodes, consider a binary tree with nodes 1, 2, 3, 4, 5. The sum would be 5. For swapping nodes in groups of k, consider a linked...read more

Q35. LC: to delete the nth node in a linked list.

Ans.

Delete the nth node in a linked list.

  • Traverse the linked list to find the nth node and keep track of the previous node.

  • Update the previous node's next pointer to skip the nth node.

  • Free the memory allocated to the nth node.

Q36. reverse linkedlist in 3 steps

Ans.

Iterate through the linked list and reverse the pointers in 3 steps

  • Iterate through the linked list and keep track of the previous, current, and next nodes

  • Update the pointers to reverse the direction of the nodes

  • Repeat the process until the end of the linked list is reached

Q37. FIND SECOND LAREST ELEMENT IN AN ARRAY IN ONE LOOP

Ans.

Find the second largest element in an array using only one loop.

  • Initialize two variables to keep track of the largest and second largest elements.

  • Iterate through the array and update the variables accordingly.

  • Return the second largest element at the end.

Q38. output of javascript code, c++ code and mySql

Ans.

The question is asking for the output of JavaScript code, C++ code, and MySQL.

  • JavaScript code outputs can be displayed in the browser console or on a webpage.

  • C++ code outputs can be printed to the console using cout statements.

  • MySQL outputs can be retrieved using SQL queries and displayed in a table format.

Q39. find the length of linked list

Ans.

Traverse the linked list and count the number of nodes

  • Initialize a counter variable to 0

  • Traverse the linked list while incrementing the counter for each node

  • Return the final count as the length of the linked list

Q40. What is cloud computing

Ans.

Cloud computing is the delivery of computing services over the internet.

  • Cloud computing allows users to access and use computing resources on-demand, such as storage, processing power, and software applications.

  • It eliminates the need for users to own and manage physical infrastructure, as the resources are provided by a third-party provider.

  • Examples of cloud computing services include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.

Frequently asked in, ,

Q41. Code Insertion sort and time complexity

Ans.

Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time.

  • Iterate through the array starting from the second element

  • Compare each element with the elements before it and insert it in the correct position

  • Time complexity is O(n^2) in the worst case scenario

Q42. Remove nose from back of LinkedIn list

Ans.

Use a sorting algorithm to move the nose to the front of the LinkedIn list.

  • Implement a sorting algorithm that moves the nose to the front of the list.

  • Identify the nose in the list and swap it with the first element.

  • Update the LinkedIn list with the nose at the front.

Q43. System design on my done projects.

Ans.

Designed a system for a project involving real-time data processing and analysis.

  • Utilized microservices architecture for scalability and flexibility

  • Implemented message queues for asynchronous communication between components

  • Used a combination of relational and NoSQL databases for different data storage needs

Q44. Why string is immutable

Ans.

String is immutable in order to ensure data integrity and security.

  • Immutable strings prevent accidental modification of data.

  • Immutable strings allow for safe sharing of data between different parts of a program.

  • Immutable strings help in thread safety by avoiding concurrent modification issues.

  • Example: String str = "hello"; str.concat(" world"); // This does not modify the original string, but creates a new one

Frequently asked in,

Q45. implement depth first search in tree

Ans.

Depth first search in tree is implemented using recursion to explore each branch fully before moving to the next.

  • Start at the root node and recursively visit each child node before moving to the next sibling node.

  • Use a stack to keep track of nodes to visit, pushing children onto the stack before siblings.

  • Base case is when the current node is null or a leaf node, then backtrack to the parent node.

Q46. Gave a problem about pairing a triplets

Ans.

Pairing triplets problem involves finding all unique triplets that sum up to a target value.

  • Use three nested loops to iterate through all possible combinations of triplets.

  • Sort the array first to easily skip duplicates and optimize the search.

  • Use two-pointer technique to find the remaining element for each triplet sum.

Q47. What is encapsulation in OOP?

Ans.

Encapsulation is the concept of bundling data and methods together within a class, hiding internal details from the outside world.

  • Encapsulation helps in achieving data abstraction and data hiding.

  • It allows for better control over the access to the internal state of an object.

  • By encapsulating data, we can protect it from being modified by external code.

  • Encapsulation promotes code reusability and maintainability.

  • Example: A class with private variables and public methods to acce...read more

Q48. what are foreign keys

Ans.

Foreign keys are columns in a database table that reference the primary key of another table, establishing a relationship between the two tables.

  • Foreign keys ensure referential integrity in a database by enforcing relationships between tables.

  • They help maintain data consistency by preventing actions that would violate the relationships between tables.

  • For example, in a database with tables for 'orders' and 'customers', the 'customer_id' column in the 'orders' table would be a ...read more

Q49. Print boundary nodes of a tree

Ans.

Print the boundary nodes of a tree.

  • Boundary nodes are the leftmost and rightmost nodes of each level of the tree and the leaf nodes that are not part of the subtree.

  • Traverse the tree in a clockwise direction and print the nodes as you encounter them.

  • Use recursion to traverse the tree and keep track of the level and whether the node is a left or right boundary node.

Q50. First element having multiple count

Ans.

Use a hashmap to store the count of each element in the array and then iterate through the array to find the first element with multiple occurrences.

  • Create a hashmap to store the count of each element in the array.

  • Iterate through the array and update the count in the hashmap.

  • Once the count of an element reaches 2, return that element as the first element with multiple occurrences.

1
2
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions for Software Development Engineer Intern Related Skills

Interview experiences of popular companies

3.7
 • 10k Interviews
3.9
 • 7.8k Interviews
4.1
 • 4.9k Interviews
4.1
 • 2.3k Interviews
4.4
 • 811 Interviews
3.3
 • 222 Interviews
3.6
 • 145 Interviews
3.9
 • 78 Interviews
3.3
 • 50 Interviews
View all

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 Development Engineer Intern Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter