SDE (Software Development Engineer)

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

Updated 4 Jul 2025
search-icon

Asked in Carwale

3d ago

Q. Given a string consisting of lowercase alphabets, write a function that returns 'yes' if the string contains all lowercase letters at least once. The solution should have O(N) time complexity and use no extra s...

read more
Ans.

Function to check if a string has all lowercase letters appearing at least once without extra space in O(N) time.

  • Create a boolean array of size 26 to keep track of the occurrence of each letter.

  • Iterate through the string and mark the corresponding index in the array as true.

  • Check if all the elements in the array are true and return yes if so.

  • Alternatively, use a bit vector to keep track of the occurrence of each letter.

1d ago

Q. How would you design a text editor like notepad, focusing on the insert, delete, and search functionalities? What data structures would you use to efficiently implement these features, assuming other functional...

read more
Ans.

Designing a text editor requires efficient data structures for insert, delete, and search operations.

  • Use a linked list to represent lines of text, allowing efficient insertions and deletions.

  • For searching, maintain an index or use a hash map to quickly locate specific words or phrases.

  • Consider using a gap buffer for efficient insertions and deletions within a single line of text.

  • Implement a trie for efficient prefix searching, which can enhance search functionality.

SDE (Software Development Engineer) Interview Questions and Answers for Freshers

illustration image

Asked in Carwale

6d ago

Q. Given a balance and 100 coins, where one coin is heavier than the others, what is the minimum number of weighings required to find the heavier coin?

Ans.

Find minimum number of weighings required to find the heavier coin out of 100 coins with a balance.

  • Divide the coins into 3 groups of 33 each and weigh 2 groups against each other.

  • If one group is heavier, divide it into 3 groups of 11 each and weigh 2 groups against each other.

  • Repeat the process until the heavier coin is found.

  • Minimum number of weighings required is 4.

2d ago

Q. Given a binary search tree, print the path which has the sum equal to k and has minimum hops. That is, if there are multiple paths with the sum equal to k then print the path with the minimum number of nodes.

Ans.

Given a binary search tree, print the path with sum k and minimum hops.

  • Traverse the tree using DFS and keep track of the current path and its sum.

  • If the current sum equals k, compare the current path with the minimum path found so far.

  • If the current sum is greater than k, backtrack to the previous node and continue traversal.

  • If the current sum is less than k, continue traversal.

  • Return the minimum path found.

  • Time complexity: O(nlogn) for balanced tree, O(n^2) for skewed tree.

Are these interview questions helpful?

Asked in Housing.com

3d ago

Q. Given a 1024x1024 map with flats at locations (x, y) and a visibility index, display each flat with a 32x32 square on the map.

Ans.

Given a map with flats and their location and visibility index, show every flat with a square of 32x32.

  • Create a 1024x1024 map with flats and their visibility index

  • Loop through each flat and draw a 32x32 square around it

  • Display the map with all the flats highlighted

Asked in Carwale

4d ago

Q. Given a singly linked list, delete all nodes which have a greater value on right side.

Ans.

Delete nodes in linkedlist with greater value on right side

  • Traverse the linked list from right to left

  • Compare each node with the maximum value seen so far

  • If the current node has a greater value, delete it

  • Update the maximum value seen so far

SDE (Software Development Engineer) Jobs

Teamware Solutions ( A division of Quantum Leap Co     nsulting Private LTD). logo
MySQL 2-5 years
Teamware Solutions ( A division of Quantum Leap Co nsulting Private LTD).
0.0
₹ 6 L/yr - ₹ 43 L/yr
(AmbitionBox estimate)
India
Teamware Solutions ( A division of Quantum Leap Consulting Private LTD). logo
MySQL 2-5 years
Teamware Solutions ( A division of Quantum Leap Consulting Private LTD).
0.0
₹ 6 L/yr - ₹ 24 L/yr
(AmbitionBox estimate)
Chennai
Teamware Solutions ( A division of Quantum Leap Consulting Private LTD). logo
MySQL 2-5 years
Teamware Solutions ( A division of Quantum Leap Consulting Private LTD).
0.0
₹ 3 L/yr - ₹ 53 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru

Asked in Carwale

6d ago

Q. Explain priority scheduling (preemptive , non-preemptive). Explain a case when a low priority process will preempt a high priority process

Ans.

Priority scheduling is a scheduling algorithm where processes are assigned priorities and executed based on their priority level.

  • Preemptive priority scheduling allows a higher priority process to interrupt a lower priority process that is currently running.

  • Non-preemptive priority scheduling allows a higher priority process to wait until the lower priority process finishes executing.

  • A low priority process can preempt a high priority process if the high priority process is wait...read more

Asked in Carwale

3d ago

Q. Using the numbers 8, 8, 3, and 3, and the operations +, =, /, *, and parentheses, can you make 24?

Ans.

Make 24 using 8, 8, 3, 3 using + = / * ( )

  • Use multiplication to get 8*3=24

  • Add the remaining 8 to get 32

  • Divide by the remaining 3 to get 10.67

  • Subtract the other 3 to get 7.67

  • Multiply by the remaining 3 to get 23.01

  • Add the remaining 8 to get 31.01

  • Divide by the remaining 8 to get 3.88

  • Add the other 3 to get 6.88

  • Multiply by the remaining 3 to get 20.64

  • Add the other 8 to get 28.64

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Carwale

2d ago

Q. What is runtime polymorphism and compile time polymorphism? What are the differences between them?

Ans.

Runtime polymorphism is when the method to be executed is determined at runtime, while compile-time polymorphism is determined at compile-time.

  • Runtime polymorphism is achieved through method overriding.

  • Compile-time polymorphism is achieved through method overloading.

  • Runtime polymorphism is also known as dynamic polymorphism.

  • Compile-time polymorphism is also known as static polymorphism.

  • Runtime polymorphism is associated with inheritance.

  • Compile-time polymorphism is associated...read more

Asked in Jio

5d ago

Q. Given a sorted array, print all the elements that are not present in the array and state the time and space complexity of the algorithm.

Ans.

Print all elements not present in a sorted array with time and space complexity.

  • Iterate through array and print missing elements

  • Use binary search for faster search

  • Time complexity: O(n log n)

  • Space complexity: O(1)

Asked in Carwale

2d ago

Q. Given an array of size 98 containing natural numbers from 1 to 100, with two numbers missing, how would you find the missing numbers?

Ans.

Given an array of size 98 with natural numbers from 1-100 but 2 numbers are missing, find them.

  • Calculate the sum of all numbers from 1-100 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 sum of missing numbers

  • Find the missing numbers by iterating through the array and checking which numbers are not present

Asked in Carwale

2d ago

Q. Develop a tic-tac-toe game in C++ using object-oriented programming principles.

Ans.

Develop tic-tac-toe game using OOPS concepts in CPP.

  • Create a class for the game board

  • Create a class for the players

  • Create a class for the game logic

  • Use inheritance and polymorphism for game objects

  • Implement functions for checking win/lose/draw conditions

Asked in Carwale

2d ago

Q. Given a singly linked list, delete all nodes which have a greater value on the right side.

Ans.

Delete nodes in a linked list which have greater value on right side

  • Traverse the linked list and compare each node with its right side node

  • If the current node's value is less than its right side node, delete the current node

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

Asked in Carwale

1d ago

Q. Implement a max() function that returns the maximum of all elements in the stack with optimized time and space complexity.

Ans.

Implement max() function to find the maximum element in a stack with optimized time and space complexity.

  • Use an additional stack to keep track of the maximum element at each step.

  • When pushing an element onto the stack, compare it with the top element of the maximum stack and push the larger one.

  • When popping an element from the stack, also pop the top element from the maximum stack if they are equal.

  • The top element of the maximum stack will always be the maximum element in the...read more

Asked in Jio

5d ago

Q. Given a sorted array arr, and integers start and end, find all the elements within the range [start, end] that are missing from the array.

Ans.

Find missing elements in a sorted array within a given range.

  • Loop through the array and check if each element is within the given range.

  • If an element is outside the range, add all the missing elements within the range to a list.

  • Return the list of missing elements.

Asked in Carwale

6d ago

Q. What is inheritance? What are diffence types of inheritance?

Ans.

Inheritance is a mechanism in object-oriented programming where a class inherits properties and behaviors from another class.

  • Inheritance allows code reuse and promotes code organization.

  • There are different types of inheritance: single inheritance, multiple inheritance, multilevel inheritance, hierarchical inheritance, and hybrid inheritance.

  • Single inheritance involves a class inheriting from a single base class.

  • Multiple inheritance involves a class inheriting from multiple ba...read more

Q. 1. Sort characters in a string based on its frequency?

Ans.

Sort characters in a string based on its frequency.

  • Create a dictionary to store character frequency

  • Sort the dictionary based on frequency

  • Reconstruct the string using the sorted dictionary

Asked in Carwale

4d ago

Q. Calculate the sum of only the even numbers in the Fibonacci series.

Ans.

The sum of even numbers in the Fibonacci series is calculated.

  • Generate the Fibonacci series up to a given limit

  • Iterate through the series and check if each number is even

  • If the number is even, add it to the sum

  • Return the sum of the even numbers

Asked in Jio

2d ago

Q. Write a program to print all the elements not present in an unsorted array and analyze the time and space complexity of the algorithm.

Ans.

Print all elements not present in an unsorted array and give time and space complexity.

  • Iterate through array and use a hashset to keep track of seen elements.

  • Print elements not in hashset.

  • Time complexity: O(n), Space complexity: O(n)

Asked in RadiSys

3d ago

Q. In a file that has been opened, how do you move the cursor 5 characters ahead of the current position?

Ans.

To move the cursor 5 characters ahead of current position in an opened file.

  • Use fseek() function to move the cursor to the desired position.

  • Pass the current position and offset to fseek() function.

  • Use SEEK_CUR as the reference point for the offset.

Q. What is Agile methodology and what are its advantages over the waterfall model?

Ans.

Agile is an iterative approach to software development that emphasizes flexibility and customer satisfaction.

  • Agile involves breaking down projects into smaller, more manageable chunks called sprints.

  • It prioritizes collaboration between developers, customers, and stakeholders.

  • It allows for changes and adjustments to be made throughout the development process.

  • It promotes continuous delivery and improvement.

  • Advantages over waterfall model include faster time to market, increased...read more

Asked in Walmart

6d ago

Q. Why can't we use arrow functions in constructors?

Ans.

Arrow functions do not have their own 'this' value, which is required in constructors.

  • Arrow functions do not have a 'this' binding, so 'this' will refer to the parent scope.

  • Constructors require 'this' to refer to the newly created object.

  • Using arrow functions in constructors can lead to unexpected behavior and errors.

Asked in Housing.com

5d ago

Q. Given names of some places in a locality with longitude and latitude, how would you mark the boundary of the locality?

Ans.

Identify the boundary of a locality using geographical coordinates from place names.

  • Use the given longitude and latitude to plot points on a map.

  • Apply algorithms like Convex Hull to determine the outer boundary.

  • Example: For points A(1,2), B(2,3), C(3,1), the boundary can be formed.

  • Consider using libraries like Geopy or Shapely in Python for calculations.

  • Visualize the boundary using tools like Matplotlib or GIS software.

Asked in Carwale

2d ago

Q. Write a function to find all permutations of a given string. The order of permutations does not need to be lexicographic.

Ans.

Find all permutations of a given string.

  • Use recursion to swap each character with every other character in the string.

  • Repeat the process for each substring.

  • Add the permutation to an array.

Asked in Amazon

5d ago

Q. Write a program to calculate the sum of nodes at each level of a tree.

Ans.

Program to calculate sum of level order tree

  • Traverse the tree level by level using BFS

  • Add the values of each level and return the sum

  • Use a queue to store the nodes at each level

  • Handle edge cases like empty tree or null root

4d ago

Q. Given two linked lists, each representing a number, create a linked list that represents their sum.

Ans.

Create a linked list that contains the sum of two given linked lists representing numbers.

  • Traverse both linked lists simultaneously and add the corresponding nodes' values. If the sum is greater than 9, carry over the 1 to the next node.

  • If one linked list is longer than the other, add the remaining nodes to the sum.

  • Create a new linked list with the sum in reverse order.

Asked in Jio

2d ago

Q. Find the equilibrium index where the sum of all the values before the equilibrium index is equal to the sum of all the values after the equilibrium index.

Ans.

Find the equilibrium index where the sum of all values before it is equal to the sum of all values after it.

  • Iterate through the array and calculate the total sum.

  • Then iterate again and keep track of the left sum and right sum.

  • If they are equal at any index, return that index as the equilibrium index.

Asked in Freo

6d ago

Q. Describe how you would design a chess game, including the backend API and project structure in an IDE.

Ans.

Design a chess game with backend API and project in IDE.

  • Create a chess board with 64 squares and pieces

  • Implement game logic for moves and captures

  • Develop a RESTful API for game actions and data storage

  • Use a database to store game state and player information

  • Build a user interface for playing the game

  • Test thoroughly to ensure functionality and security

Asked in Carwale

1d ago

Q. Optimize the above solution to less than O(n). Think outside the box.

Ans.

Explore unconventional methods to achieve sub-linear time complexity for the given problem.

  • Use hashing to store previously computed results, allowing O(1) lookups.

  • Implement a divide-and-conquer strategy to reduce problem size recursively.

  • Consider using a probabilistic approach, like Bloom filters, for approximate results.

  • Utilize parallel processing to handle multiple data segments simultaneously.

Asked in McAfee

6d ago

Q. What is an initializer list in C++? Provide an example.

Ans.

Initializer list is a syntax in C++ to initialize objects with a list of values.

  • Initializer list is enclosed in curly braces {}.

  • It can be used to initialize arrays, structs, and classes.

  • Example: int arr[] = {1, 2, 3};

  • Example: struct Point { int x, y; } p = {1, 2};

  • Example: class Person { public: string name; int age; } p = {"John", 30};

1
2
3
4
5
6
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Amazon Logo
4.0
 • 5.4k Interviews
Google Logo
4.4
 • 896 Interviews
Oracle Logo
3.7
 • 894 Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits