Software Development Engineer
300+ Software Development Engineer Interview Questions and Answers
Q101. DB queries on finding the second largest element
Query to find the second largest element in a database table
Use ORDER BY and LIMIT to select the second largest element
For MySQL: SELECT column FROM table ORDER BY column DESC LIMIT 1,1
For Oracle: SELECT column FROM (SELECT column FROM table ORDER BY column DESC) WHERE ROWNUM <= 2 MINUS SELECT column FROM (SELECT column FROM table ORDER BY column DESC) WHERE ROWNUM <= 1
Q102. features of java 8 Like lambda expression,functional interface, foreach
Java 8 introduced lambda expressions, functional interfaces, and forEach method.
Lambda expressions allow functional programming in Java.
Functional interfaces are interfaces with only one abstract method.
forEach method is used to iterate over collections in a concise way.
Stream API is also introduced in Java 8 for processing collections.
Optional class is introduced to handle null values.
Default and static methods are also introduced in interfaces.
Q103. 1. DFS based question Find number of rotten tomatoes.
DFS based question to find number of rotten tomatoes in an array of strings.
Implement DFS to traverse the array of strings
Check each element for rotten tomatoes
Keep track of the count of rotten tomatoes
Q104. find the longest length of consecutive number from array whose sum is lesser or equal to target
Find the longest consecutive numbers in an array whose sum is less than or equal to a target.
Iterate through the array and keep track of the current sum and length of consecutive numbers.
Update the longest length whenever the current sum is less than or equal to the target.
Reset the current sum and length when the sum exceeds the target.
Q105. What state management library do you have used?
I have used Redux for state management in my previous projects.
Redux is a predictable state container for JavaScript apps.
It helps in managing the state of the application in a single immutable state tree.
Actions are dispatched to update the state and components can subscribe to changes.
Selectors can be used to efficiently extract data from the state tree.
Middleware can be added to handle asynchronous actions.
Example: Redux is commonly used with React applications.
Q106. What are the four pillars OOPS?
The four pillars of OOPS are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding implementation details and showing only necessary information.
Encapsulation: Binding data and functions together and restricting access to them.
Inheritance: Creating new classes from existing ones, inheriting properties and methods.
Polymorphism: Ability of objects to take on multiple forms and perform different actions based on context.
Share interview questions and help millions of jobseekers 🌟
Q107. What is the difference between C and C++?
C is a procedural programming language while C++ is an object-oriented programming language.
C is a procedural programming language, while C++ supports both procedural and object-oriented programming paradigms.
C does not support classes and objects, while C++ does.
C does not have built-in support for exception handling, while C++ does.
C does not have namespaces, while C++ does.
C does not have function overloading, while C++ does.
Q108. Swap 2 numbers without using 3rd variable
Swap 2 numbers without using 3rd variable
Use addition and subtraction
Use multiplication and division
Use bitwise XOR operation
Software Development Engineer Jobs
Q109. what is extension of web service file ?
The extension of a web service file is typically .wsdl or .asmx.
The .wsdl extension stands for Web Services Description Language.
The .asmx extension is used for ASP.NET web services.
The extension may vary depending on the technology used to create the web service.
Other common extensions include .svc for Windows Communication Foundation (WCF) services.
Q110. in an integer array find the next greatest number for all and display in O(N)
Find the next greatest number for each integer in an array in O(N) time complexity.
Iterate through the array from right to left
Use a stack to keep track of potential next greatest numbers
Pop elements from the stack that are less than the current element and update their next greatest number to the current element
Push the current element onto the stack
Repeat until all elements have a next greatest number
Q111. Design a lift system. OOPs concept
Design a lift system using OOPs concepts.
Create a Lift class with methods like moveUp(), moveDown(), openDoor(), closeDoor()
Create a Floor class with methods like requestLift()
Use inheritance to create different types of lifts like passenger lift, cargo lift, etc.
Use encapsulation to hide the internal workings of the lift system from the outside world.
Use polymorphism to allow different types of lifts to respond differently to the same method calls.
Q112. What are the types of traversals in trees?
Types of traversals in trees include inorder, preorder, postorder, and level order traversal.
Inorder traversal: Visit left subtree, root, right subtree (L-R-N)
Preorder traversal: Visit root, left subtree, right subtree (N-L-R)
Postorder traversal: Visit left subtree, right subtree, root (L-R-N)
Level order traversal: Visit nodes level by level from left to right
Q113. What the equivalent in python for switch cases in SQL
In Python, the equivalent of switch cases in SQL is achieved using dictionaries.
Use dictionaries to map keys to corresponding functions or values
Use a default value or function if no key matches
Example: # Define a dictionary mapping keys to functions switch = { 'case1': function1, 'case2': function2, 'default': default_function } # Use the dictionary to execute the corresponding function result = switch.get(key, switch['default'])()
Q114. What is the method for sorting a two-dimensional array?
Sorting a two-dimensional array involves organizing its rows or columns based on specific criteria.
1. Choose a sorting criterion: Decide whether to sort by rows or columns.
2. Use a sorting algorithm: Common algorithms include QuickSort, MergeSort, or built-in functions.
3. Example: Sorting rows based on the first element: [['banana', 'apple'], ['cherry', 'date']] becomes [['banana', 'apple'], ['cherry', 'date']].
4. For sorting columns, transpose the array, sort, and transpose ...read more
Q115. 3) Find depth of binary tree through recursion and iteration
Find depth of binary tree through recursion and iteration
Recursively traverse left and right subtrees and return the maximum depth
Iteratively traverse the tree using a stack or queue and keep track of the depth
Depth of an empty tree is 0
Depth of a tree with only one node is 1
Q116. How you will create Global temp table ?
To create a global temp table, use ## before the table name.
Use ## before the table name to create a global temp table.
Global temp tables are accessible to all sessions and are destroyed when the last session using it is closed.
Example: CREATE TABLE ##myTable (id INT, name VARCHAR(50))
Q117. What is singleton class. What is the Best way to develop singleton class.
A singleton class is a class that allows only one instance of itself to be created.
The best way to develop a singleton class is to use a private constructor to prevent direct instantiation.
The class should provide a static method that returns the instance of the class.
The instance should be lazily initialized to improve performance.
Thread safety should be considered when implementing a singleton class.
Example: public class Singleton { private static Singleton instance; privat...read more
Q118. How priority queue works and its implementation using min heap
Priority queue is a data structure that stores elements based on their priority, allowing for efficient retrieval of the highest priority element.
Priority queue can be implemented using a min heap, where the root node always contains the minimum element.
Insertion: Add the new element to the end of the heap and then heapify up to maintain the min heap property.
Deletion: Remove the root node (minimum element), move the last element to the root, and then heapify down to maintain...read more
Q119. Launch Mode of Activity in Android
Launch mode determines how a new instance of an activity is created and added to the task stack.
Standard: Creates a new instance of the activity each time it is launched.
SingleTop: If an instance of the activity already exists at the top of the stack, it will be reused.
SingleTask: If an instance of the activity already exists in the stack, it will be brought to the front and cleared of any activities above it.
SingleInstance: The activity will be launched in a new task and no ...read more
Q120. What are the components of angular js
AngularJS has several components including directives, controllers, services, filters, and templates.
Directives - extend HTML with new attributes and elements
Controllers - handle user input and manipulate data
Services - provide functionality across the app
Filters - format data for display
Templates - define the user interface
Q121. Write a program to check given string is palindrome or not for example MOM in java
Program to check if a given string is a palindrome in Java.
Create a function that takes a string as input.
Reverse the input string and compare it with the original string.
If they are the same, the string is a palindrome.
Example: 'MOM' is a palindrome.
Q122. Write a program to check given string is palindrome or not using recursion in java
A program to check if a given string is a palindrome using recursion in Java.
Create a recursive function that compares characters at the beginning and end of the string.
Base case: if the string is empty or has only one character, it is a palindrome.
Recursive case: compare the first and last characters, then call the function with the substring excluding those characters.
Example: Input 'racecar' should return true as it is a palindrome.
Q123. Write second highest number in a given table using sql
Use SQL query to find the second highest number in a given table
Use the MAX() function to find the highest number in the table
Use the WHERE clause to exclude the highest number from the result set
Use the MAX() function again on the filtered result set to find the second highest number
Q124. Find the number of pairs with difference equal to given value k
Count pairs in an array with a given difference
Sort the array to easily find pairs
Use two pointers approach to find pairs with difference equal to k
Keep track of unique pairs to avoid duplicates
Q125. Linkedlist insertion & deletion in Go
Linkedlist insertion & deletion in Go
In Go, linked lists can be implemented using structs and pointers.
Insertion involves creating a new node and updating the pointers of adjacent nodes.
Deletion involves updating the pointers of adjacent nodes to bypass the node being deleted.
Go's garbage collector automatically frees memory of unused nodes.
Q126. need to find the nearest K integers in a Binary search Tree
Find the nearest K integers in a Binary Search Tree
Perform an in-order traversal of the BST to get a sorted list of integers
Use a priority queue to keep track of the K nearest integers
Compare the absolute difference between the target integer and each node value to determine the nearest integers
Q127. Do you know writing Unit test case?
Yes, I am familiar with writing unit test cases to ensure code quality and functionality.
I have experience writing unit test cases using testing frameworks like JUnit, NUnit, or pytest.
I understand the importance of writing testable code and creating comprehensive test suites.
I can write test cases to cover different scenarios, including edge cases and boundary conditions.
I know how to use mocking frameworks like Mockito to isolate dependencies and test components in isolatio...read more
Q128. What is singleton class, write a usecase through code
Singleton class is a class that can only have one instance created throughout the application.
Singleton class restricts the instantiation of a class to one object.
It is often used for logging, caching, thread pools, database connections, etc.
Example: Java implementation of Singleton class -
public class Singleton { private static Singleton instance; private Singleton() {} public static Singleton getInstance() { if(instance == null) { instance = new Singleton(); } return instan...read more
Q129. What are React Lifecycle methods ?
React Lifecycle methods are special methods that are invoked at different stages of a component's life cycle.
Mounting: constructor, render, componentDidMount
Updating: render, componentDidUpdate
Unmounting: componentWillUnmount
Error Handling: componentDidCatch
Other methods: shouldComponentUpdate, getDerivedStateFromProps, getSnapshotBeforeUpdate
Q130. Simple graph BFS-No of times it takes oranges to decay in a grid
Using BFS to find the minimum number of steps for oranges to decay in a grid
Implement BFS algorithm to traverse the grid and decay the oranges
Keep track of the number of steps taken to decay all oranges
Return the minimum number of steps required to decay all oranges
Q131. Design a board game with different cell types and roll the dice to move on from cell to cell
Design a board game with different cell types and roll the dice to move on from cell to cell
Create a board with various types of cells such as start, finish, bonus, penalty, teleport, etc.
Players roll a dice to determine how many cells they move forward
Each cell type has a different effect on the player's progress or score
Q132. Fibonacci series with and without recursion
Answering Fibonacci series with and without recursion
Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones
Recursion method involves calling the function within itself
Non-recursive method involves using a loop to calculate the series
Recursive method is slower and can cause stack overflow for large inputs
Non-recursive method is faster and more efficient for large inputs
Q133. What are env and session variables What is tag and status
Env and session variables are used to store data temporarily in a program.
Env variables are system-wide variables that store information about the environment in which a program is running.
Session variables are used to store data specific to a user's session on a website or application.
Tags are labels or keywords used to categorize or organize data.
Status refers to the current state or condition of a system or process.
Q134. what is diff between jvm, jre, jdk
JVM is the Java Virtual Machine that executes Java bytecode. JRE is the Java Runtime Environment that includes JVM and libraries. JDK is the Java Development Kit that includes JRE and development tools.
JVM is the virtual machine that runs Java bytecode and provides a runtime environment for Java programs.
JRE includes JVM along with libraries and other components necessary to run Java applications.
JDK is a development kit that includes JRE and development tools such as compile...read more
Q135. What's the difference between a VM and a Docker?
VM is a full virtualized environment, while Docker is a lightweight containerization technology.
VMs run a full operating system, while Docker containers share the host OS kernel.
VMs are slower to start up compared to Docker containers.
Docker containers are more lightweight and efficient in resource usage.
VMs provide isolation at the hardware level, while Docker provides isolation at the application level.
VMs are typically used for running multiple applications with different ...read more
Q136. Explain difference between class and functional components.
Class components are ES6 classes while functional components are functions.
Class components have state and lifecycle methods while functional components don't.
Functional components are simpler and easier to read and test.
Functional components are preferred for simple UI components while class components are used for complex UI components.
Functional components don't have 'this' keyword while class components do.
Functional components are faster than class components.
Q137. Explain what is oops concepts?
OOPs concepts are programming concepts that focus on objects and their interactions.
OOPs stands for Object-Oriented Programming.
It involves the use of classes, objects, inheritance, polymorphism, and encapsulation.
Classes are templates for creating objects, while objects are instances of classes.
Inheritance allows for the creation of new classes based on existing ones.
Polymorphism allows for the use of a single interface to represent different types of objects.
Encapsulation i...read more
Q138. Implementation of Inorder Traversal of a Binary Tree
Inorder traversal of a binary tree involves visiting the left subtree, then the root, and finally the right subtree.
Start at the root node
Recursively traverse the left subtree
Visit the current node
Recursively traverse the right subtree
Repeat until all nodes are visited
Q139. Detect Cycle in a graph. Remove edge from the graph to make it acyclic
Use Depth First Search (DFS) to detect cycle in a graph. Remove an edge from the cycle to make it acyclic.
Implement Depth First Search (DFS) to detect cycles in the graph
If a back edge is found during DFS traversal, it indicates a cycle in the graph
Remove an edge from the cycle to make the graph acyclic
Q140. What is custom diractives in Angular
Custom directives in Angular allow you to create reusable components with custom behavior.
Custom directives are used to extend the functionality of HTML elements in Angular.
They can be used to create reusable components with custom behavior.
Directives are markers on a DOM element that tell Angular to attach a specified behavior to that DOM element or even transform the DOM element and its children.
Examples include creating a custom tooltip directive or a directive for lazy lo...read more
Q141. find if the given year is a leap year or not.
Check if a given year is a leap year or not.
A leap year is divisible by 4, but not by 100 unless it is also divisible by 400
For example, 2000 is a leap year because it is divisible by 400, while 1900 is not because it is divisible by 100 but not by 400
Q142. To code a peer to peer system for sending the payment
To code a peer to peer system for sending payments, you would need to design a secure and efficient network protocol.
Design a protocol for communication between peers
Implement encryption for secure transactions
Include error handling and validation mechanisms
Consider scalability and performance optimizations
Test the system thoroughly to ensure reliability
Q143. What is Data Integrity?
Data Integrity refers to the accuracy and consistency of data throughout its lifecycle.
Ensuring data is not corrupted or modified without authorization
Maintaining data accuracy and consistency through proper storage and retrieval
Preventing data loss or unauthorized access
Examples: checksums, encryption, access controls
Q144. Design a REST API for UserManagement system
Design a REST API for UserManagement system
Use HTTP methods like GET, POST, PUT, DELETE for CRUD operations
Use authentication and authorization for secure access
Use pagination for large datasets
Use query parameters for filtering, sorting, and searching
Use response codes to indicate success or failure
Use versioning to manage changes in API
Example endpoints: /users, /users/{id}, /users/{id}/roles
Q145. What is complexity and their types
Complexity refers to the level of difficulty in solving a problem. There are two types: time complexity and space complexity.
Time complexity refers to the amount of time required to solve a problem, and is usually measured in terms of the number of operations performed by an algorithm.
Space complexity refers to the amount of memory required to solve a problem, and is usually measured in terms of the amount of memory used by an algorithm.
Complexity can be classified into diffe...read more
Q146. What is data structures?
Data structures are ways of organizing and storing data in a computer so that it can be accessed and used efficiently.
Data structures are used to manage and manipulate data.
They can be implemented using arrays, linked lists, trees, graphs, and more.
Examples include stacks, queues, hash tables, and binary search trees.
Q147. What is normalisation?
Normalisation is the process of organizing data in a database to reduce redundancy and improve data integrity.
It involves breaking down a table into smaller tables and defining relationships between them.
Normalization helps to eliminate data inconsistencies and anomalies.
There are different levels of normalization, with each level having stricter rules for data organization.
Examples of normalization include converting repeating groups into separate tables and creating a junct...read more
Q148. Create a Login Form using React JS.
Create a Login Form using React JS.
Create a form component with input fields for email and password
Use state to store user input
Add validation to ensure email and password meet requirements
Handle form submission with a function that sends data to a server or API
Q149. height of the binary tree, factorial code in python
Calculate the height of a binary tree and implement factorial code in Python.
To calculate the height of a binary tree, you can use a recursive approach where you find the height of the left and right subtrees and return the maximum height plus one.
For factorial code in Python, you can use a recursive function that multiplies the current number with the factorial of the previous number until reaching 1.
Example for calculating the height of a binary tree: def height(node): if n...read more
Q150. Diff btw statics and constant variable?.
Statics are class-level variables while constant variables are read-only variables.
Static variables are shared among all instances of a class while constant variables are not.
Static variables can be modified while constant variables cannot.
Static variables are initialized only once while constant variables are initialized at declaration.
Examples of static variables are counters, caches, and configuration settings.
Examples of constant variables are pi, e, and the speed of ligh...read more
Interview Questions of Similar Designations
Top Interview Questions for Software Development Engineer 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