SDE (Software Development Engineer)

100+ SDE (Software Development Engineer) Interview Questions and Answers

Updated 2 Dec 2023

Q51. What is Ingress? What is Prometheus ?What is Grafana?

Ans.

Ingress is a Kubernetes resource that manages external access to services. Prometheus is a monitoring system and Grafana is a visualization tool.

  • Ingress is used to route external traffic to the appropriate Kubernetes service

  • Prometheus is used to collect and store metrics from various sources

  • Grafana is used to visualize the collected metrics in a user-friendly way

  • Ingress can be configured to use different load balancing algorithms

  • Prometheus has a powerful query language for an...read more

Q52. How to check wheather a string is palindrome or not?

Ans.

To check if a string is palindrome or not.

  • Compare the first and last characters of the string and continue towards the middle until all characters have been compared.

  • If all characters match, the string is a palindrome.

  • If any characters do not match, the string is not a palindrome.

Q53. How to find length , freq of each char and list of unique characters of a string

Ans.

To find length, frequency of each character and list of unique characters of a string.

  • Iterate through the string and count the frequency of each character using a hash table.

  • Create a list of unique characters by iterating through the hash table.

  • Calculate the length of the string using the built-in length function.

  • Return the frequency, length and list of unique characters as an array of strings.

Q54. what is 2+2-4*6 in numerical format

Ans.

The answer is -22

  • Perform multiplication first

  • Then perform addition and subtraction from left to right

Are these interview questions helpful?

Q55. Which statement about a binary heap is false?

Ans.

Answering which statement about a binary heap is false.

  • A binary heap is a complete binary tree where the parent node is always greater or smaller than its children.

  • A binary heap can be represented as an array.

  • A binary heap can be used to implement priority queues.

  • A binary heap can only be a max heap and not a min heap.

Q56. explain with an example about Lexical Scoping

Ans.

Lexical scoping is a way of defining variable scope based on where they are declared in the code.

  • Variables declared inside a function have local scope and are not accessible outside the function.

  • Variables declared outside a function have global scope and can be accessed from anywhere in the code.

  • Nested functions can access variables declared in their parent function.

  • Example: function outer() { let x = 10; function inner() { console.log(x); } inner(); } outer(); // Output: 10

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q57. Check if given tree is BST or not?

Ans.

Check if given tree is BST or not

  • A binary tree is a BST if the value of each node is greater than all the values in its left subtree and less than all the values in its right subtree

  • Perform an in-order traversal of the tree and check if the values are in ascending order

  • Alternatively, for each node, check if its value is within the range defined by its left and right subtrees

Q58. Fnd if a binary tree is bst or not

Ans.

Check if a binary tree is a binary search tree or not.

  • Traverse the tree in-order and check if the elements are in sorted order.

  • Check if the left child is less than the parent and the right child is greater than the parent.

  • Use recursion to check if all the subtrees are BSTs.

  • Maintain a range for each node and check if the node value is within that range.

SDE (Software Development Engineer) Jobs

0

Q59. Maximum continous sum in an array of integers

Ans.

Find the maximum continuous sum in an array of integers.

  • Use Kadane's algorithm to find the maximum subarray sum in linear time complexity.

  • Initialize two variables, one for current maximum sum and another for overall maximum sum.

  • Iterate through the array and update the variables accordingly.

  • Example: For array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the maximum continuous sum is 6 (from index 3 to 6).

Q60. 2. Are you aware of high and low level design principles

Ans.

Yes, high and low level design principles are important in software development.

  • High level design principles focus on overall architecture and system organization.

  • Low level design principles focus on implementation details and code structure.

  • Examples of high level design principles include SOLID, DRY, and KISS.

  • Examples of low level design principles include naming conventions, code commenting, and code formatting.

  • Both high and low level design principles are important for cre...read more

Q61. Given an array of 0s,1s and 2s sort the array - O(n)

Ans.

Sort an array of 0s, 1s, and 2s in O(n) time complexity.

  • Use three pointers to keep track of the positions of 0s, 1s, and 2s.

  • Traverse the array and swap elements to their respective positions.

  • Time complexity is O(n) and space complexity is O(1).

Q62. What are virtual functions?

Ans.

Virtual functions are functions in a base class that can be overridden by derived classes to provide different implementations.

  • Virtual functions are declared in a base class and can be overridden in derived classes.

  • They allow polymorphism, where a pointer to a base class can invoke different derived class implementations.

  • Virtual functions are resolved at runtime based on the actual object type.

  • They are used to achieve runtime polymorphism and dynamic binding.

Q63. Explain SDLC(Software Development Life Cycle)?

Ans.

SDLC is a process followed by software development teams to design, develop and test high-quality software.

  • SDLC consists of several phases including planning, analysis, design, development, testing, deployment, and maintenance.

  • Each phase has its own set of deliverables and objectives.

  • SDLC models include Waterfall, Agile, and DevOps.

  • SDLC helps ensure that software is developed efficiently, on time, and within budget.

  • SDLC also helps ensure that software meets the needs of stake...read more

Q64. write a program to find all the sibling node of the BST

Ans.

Program to find all sibling nodes of a BST

  • Traverse the BST and keep track of parent node

  • If a node has the same parent as another node, they are siblings

  • Recursively check left and right subtrees

  • Use a queue or stack to implement level order traversal

Q65. 1 problem related to DSA, find the missing no. in an array

Ans.

Find the missing number in an array using DSA.

  • Use XOR operation to find the missing number.

  • Calculate XOR of all elements and XOR of 1 to n+1.

  • Subtract the two XORs to get the missing number.

Q66. A variant of Longest Increasing Subsequence

Ans.

Find the length of longest increasing subsequence in an array.

  • Use dynamic programming to solve the problem efficiently.

  • Maintain an array to store the length of longest increasing subsequence ending at each index.

  • Traverse the array and update the array for each index.

  • Return the maximum value in the array as the length of longest increasing subsequence.

Q67. Maximum of every window of size K in an array

Ans.

Find maximum of every window of size K in an array

  • Iterate through the array and maintain a deque of indices of elements in the current window

  • Remove indices from the front of the deque if they are outside the current window

  • Remove indices from the back of the deque if their corresponding elements are smaller than the current element

  • The front of the deque will always contain the index of the maximum element in the current window

Q68. What is abstract class?

Ans.

An abstract class is a class that cannot be instantiated and is meant to be subclassed.

  • An abstract class can have both abstract and non-abstract methods.

  • It can provide a common interface for its subclasses.

  • Subclasses of an abstract class must implement all the abstract methods.

  • Abstract classes can have constructors.

  • An abstract class cannot be instantiated directly, but its subclasses can be.

Frequently asked in, ,

Q69. How is kubernetes cluster is exposed to internet ?

Ans.

Kubernetes cluster can be exposed to the internet using various methods.

  • One way is to use a LoadBalancer service type to expose the cluster to the internet.

  • Another way is to use an Ingress controller to route traffic from the internet to the cluster.

  • A third way is to use a NodePort service type to expose the cluster to the internet.

  • It is important to secure the cluster by using authentication and authorization mechanisms.

  • Tools like cert-manager can be used to manage SSL certi...read more

Q70. Write code for reversing the linked list

Ans.

Code for reversing a linked list

  • Create a new empty linked list

  • Traverse the original linked list and insert each node at the beginning of the new list

  • Return the new list

Q71. Write a code to find smaller prime number than input

Ans.

Code to find smaller prime number than input

  • Start from input-1 and check if it's prime

  • If yes, return it

  • If not, continue checking smaller numbers until a prime is found

  • If no prime is found, return -1

Q72. Create a linked list from scratch and then delete a given node. Then print the linked list.

Ans.

Create and delete a node in a linked list and print the updated list.

  • Create a Node class with data and next pointer attributes

  • Create a LinkedList class with head attribute and methods to add, delete and print nodes

  • To delete a node, traverse the list and update the next pointer of the previous node to skip the node to be deleted

  • Print the list by traversing and printing the data of each node

Q73. Find the kth smallest value in an unsorted array

Ans.

Find the kth smallest value in an unsorted array

  • Sort the array and return the kth element

  • Use quickselect algorithm to find the kth smallest element in O(n) time

  • Build a min heap of size k and traverse the array to find the kth smallest element

Q74. What do you understand the term CRUD to mean

Ans.

CRUD stands for Create, Read, Update, and Delete. It refers to the basic operations performed on data in a database.

  • CRUD is a fundamental concept in database management.

  • Create refers to adding new data to the database.

  • Read refers to retrieving data from the database.

  • Update refers to modifying existing data in the database.

  • Delete refers to removing data from the database.

  • CRUD is used in many software applications, including web and mobile apps.

Q75. Binary Search in a semi infinite array

Ans.

Implement binary search in a semi-infinite array.

  • Start with the first element and keep doubling the index until the target element is less than the current element.

  • Perform binary search on the subarray from the last doubled index to the current index.

  • If the target element is not found, repeat the process by doubling the last index and searching again.

  • Handle edge cases where the target element is at the first index or not present in the array.

Q76. What is mutex? Explain your project.

Ans.

Mutex is a synchronization mechanism used to prevent multiple threads from accessing shared resources simultaneously.

  • Mutex stands for mutual exclusion.

  • It is used to protect critical sections of code where multiple threads may try to access shared resources.

  • Mutex allows only one thread to access the shared resource at a time.

  • If another thread tries to access the resource while it is locked by a mutex, it will be blocked until the mutex is released.

  • Mutex can be used in conjunct...read more

Q77. Swap 2 numbers without using a third variable

Ans.

Swap 2 numbers without using a third variable

  • Use the XOR operation to swap the numbers

  • Assign the first number to the second number using XOR

  • Assign the second number to the first number using XOR

Q78. Merge intervals, find second largest salary in sql

Ans.

Merge intervals and find second largest salary in SQL

  • For merging intervals, sort them by start time and then iterate through the intervals to merge overlapping ones

  • For finding second largest salary, use the SQL query: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees)

Q79. what is your eduction qualification

Ans.

I have a Bachelor's degree in Computer Science.

  • Bachelor's degree in Computer Science

  • Completed courses in programming languages, algorithms, data structures, and software engineering

  • Participated in various coding competitions and hackathons

Q80. Explain Prims and Kruskal’s algorithms

Ans.

Prims and Kruskal's algorithms are used to find the minimum spanning tree in a graph.

  • Prims algorithm starts with a single vertex and adds the minimum weight edge to the tree until all vertices are included.

  • Kruskal's algorithm starts with all vertices as separate trees and merges them by adding the minimum weight edge until all vertices are included.

  • Both algorithms have a time complexity of O(E log V) where E is the number of edges and V is the number of vertices.

  • Prims algorit...read more

Q81. 1. Check if the linked list is circular or linear?

Ans.

To check if a linked list is circular or linear, we need to traverse the list and check if it loops back to a previous node.

  • Traverse the linked list using two pointers, one moving one node at a time and the other moving two nodes at a time.

  • If the faster pointer catches up to the slower pointer, then the list is circular.

  • If the faster pointer reaches the end of the list without catching up to the slower pointer, then the list is linear.

Q82. What are array methods in Javascript

Ans.

Array methods in Javascript are built-in functions that can be used to manipulate arrays.

  • Some common array methods are push(), pop(), shift(), unshift(), slice(), splice(), concat(), join(), indexOf(), and forEach().

  • push() adds one or more elements to the end of an array.

  • pop() removes the last element from an array.

  • shift() removes the first element from an array.

  • unshift() adds one or more elements to the beginning of an array.

  • slice() returns a new array with a portion of the ...read more

Q83. find unique character from a string and optimize it

Ans.

Find unique character from a string and optimize it

  • Use a hash table to store the frequency of each character in the string

  • Iterate through the hash table to find the character with frequency 1

  • If there are multiple characters with frequency 1, return the first one

  • Optimization: Stop iterating through the hash table once a character with frequency 1 is found

Q84. 3. what is a segmentation fault?

Ans.

Segmentation fault is a type of error caused by accessing memory that “does not belong to you.”

  • It occurs when a program tries to access a memory location that it is not allowed to access.

  • It is often caused by programming errors such as accessing an array beyond its bounds.

  • It can also be caused by hardware problems such as faulty RAM or overheating.

  • Segmentation faults can be difficult to debug because they often occur in low-level code.

  • Examples of segmentation fault errors inc...read more

Q85. find 2nd max num from the array

Ans.

Find the second maximum number from an array of strings.

  • Convert the array of strings to an array of integers.

  • Sort the array in descending order.

  • Return the second element of the sorted array.

Q86. Multiple of big integers and find complexity

Ans.

Question about finding complexity of multiplying big integers.

  • Big integers require more memory and processing power than regular integers.

  • Multiplying two n-digit integers takes O(n^2) time using the standard algorithm.

  • There are faster algorithms like Karatsuba and FFT which have lower complexity.

  • The complexity of multiplying two n-digit integers using Karatsuba algorithm is O(n^log2(3)).

  • The complexity of multiplying two n-digit integers using FFT algorithm is O(n*log(n)).

Q87. What is a database and explain it

Ans.

A database is a collection of organized data that can be easily accessed, managed, and updated.

  • A database stores data in tables with rows and columns

  • It allows for efficient data retrieval and manipulation

  • Examples include MySQL, Oracle, and MongoDB

Q88. How sort function works in cpp

Ans.

Sort function in C++ sorts elements in an array in ascending or descending order.

  • The sort function is part of the library in C++.

  • It takes two iterators as arguments, representing the beginning and end of the array to be sorted.

  • By default, it sorts the array in ascending order, but a custom comparison function can be provided to sort in descending order.

  • The time complexity of the sort function is O(n log n).

Q89. What is Smart Pointer?

Ans.

Smart Pointer is a class that provides automatic memory management for dynamically allocated objects.

  • Smart pointers are used to prevent memory leaks in C++.

  • They automatically delete the object they point to when it is no longer needed.

  • There are two types of smart pointers: unique_ptr and shared_ptr.

  • unique_ptr is used when there is only one owner of the object.

  • shared_ptr is used when there are multiple owners of the object.

Q90. Explain linked list reversal ways, explain rabbit mq

Ans.

Explanation of linked list reversal and RabbitMQ

  • Linked list reversal can be done iteratively or recursively

  • Iterative reversal involves changing the pointers of each node to point to the previous node

  • Recursive reversal involves calling the function recursively on the next node and changing its pointer to the current node

  • RabbitMQ is a message broker that allows for asynchronous communication between applications

  • It uses a publish-subscribe model where producers publish messages ...read more

Q91. 2 stacks with optinal approach

Ans.

Implementing 2 stacks with optional approach

  • Two stacks can be implemented in a single array by dividing it into two halves

  • Optional approach can be implemented by using a third parameter to indicate which stack to use

  • Push and pop operations can be performed on both stacks independently

Q92. Difference between Spring MVC and Spring Boot

Ans.

Spring MVC is a framework for building web applications, while Spring Boot is an opinionated framework for building standalone applications.

  • Spring MVC requires more configuration and setup compared to Spring Boot

  • Spring Boot provides a pre-configured environment with sensible defaults

  • Spring Boot includes an embedded server, making it easier to deploy standalone applications

  • Spring MVC is more suitable for building traditional web applications, while Spring Boot is better for mi...read more

Q93. Find a number from a linked list (singly)

Ans.

To find a number from a singly linked list.

  • Traverse the linked list and compare each node's value with the target number.

  • If the target number is found, return the node.

  • If the end of the linked list is reached without finding the target number, return null.

Q94. Array question find 1st repeated element in o(n).

Ans.

Find the first repeated element in an array of strings in O(n) time complexity.

  • Create a hash table to store the frequency of each element.

  • Traverse the array and check if the element is already present in the hash table.

  • If it is present, return the element as the first repeated element.

  • If no element is repeated, return null or -1.

  • Example: ['apple', 'banana', 'orange', 'apple'] => 'apple'

Q95. Design the algorithm with less time complexity

Ans.

Design an algorithm with less time complexity.

  • Use efficient data structures like hash tables, binary trees, etc.

  • Avoid nested loops and recursion if possible.

  • Try to optimize the code by reducing redundant operations.

  • Use dynamic programming to solve complex problems.

  • Consider parallel processing for large datasets.

  • Use built-in functions and libraries instead of writing custom code.

  • Profile the code to identify bottlenecks and optimize accordingly.

Q96. how you will build amazon?

Ans.

Building Amazon requires a multi-faceted approach involving technology, logistics, and customer-centricity.

  • Develop a robust e-commerce platform with a user-friendly interface

  • Establish a vast network of warehouses and distribution centers for efficient delivery

  • Invest in cutting-edge technology such as AI and machine learning for personalized recommendations

  • Prioritize customer satisfaction through excellent customer service and easy returns

  • Partner with third-party sellers to ex...read more

Q97. Convert expression to post-fix

Ans.

Convert an expression to post-fix notation.

  • Start with an empty stack.

  • Scan the expression from left to right.

  • If the scanned character is an operand, output it.

  • If the scanned character is an operator, pop two operands from stack, output them in post-fix notation and push the result back.

  • Repeat until the end of expression.

Q98. Best possible days to buy and sell stocks

Ans.

The best days to buy and sell stocks depend on market trends and individual stock performance.

  • Monitor market trends and stock performance

  • Consider buying during market dips and selling during market highs

  • Research historical data and patterns

  • Consult with financial advisors

  • Be mindful of taxes and fees

Q99. WHAT IS ETHERENT,SWITCH,HUB?

Ans.

Ethernet is a networking technology used for LANs. Switches and hubs are devices used to connect multiple devices to a network.

  • Ethernet is a protocol used for communication between devices on a network.

  • A switch is a networking device that connects devices on a network and directs data to its intended recipient.

  • A hub is a networking device that connects devices on a network and broadcasts data to all connected devices.

  • Switches are faster and more efficient than hubs.

  • Ethernet c...read more

Q100. What is a Load Balancer?

Ans.

A Load Balancer distributes incoming network traffic across multiple servers to improve performance and availability.

  • It helps to avoid overloading a single server

  • It improves responsiveness and availability of applications

  • It can be hardware or software-based

  • Examples include Amazon ELB, F5 BIG-IP, and NGINX

  • It can also perform health checks on servers and route traffic accordingly

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

Interview experiences of popular companies

3.7
 • 10k Interviews
3.7
 • 7.3k Interviews
4.1
 • 4.9k Interviews
4.0
 • 1.3k Interviews
4.4
 • 811 Interviews
4.1
 • 721 Interviews
4.1
 • 561 Interviews
4.3
 • 487 Interviews
3.9
 • 390 Interviews
3.4
 • 39 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

SDE (Software Development Engineer) 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