Software Engineer (Fresher / SDE-1) Interview Questions & Answers
40 questions for Software Engineer (Fresher / SDE-1) interviews — 23 easy, 17 medium.
About the Software Engineer (Fresher / SDE-1) role
Freshers join product and service companies as software engineers or SDE-1 after clearing online coding tests and technical interviews focused on DSA. They build features, fix bugs and write tests under the guidance of senior engineers. Strong problem solving with arrays, strings, hashing, trees and basic graphs, explained clearly with complexity analysis, is the main hiring signal, along with one or two good projects.
What is a binary search tree and what is its time complexity?
Show answer
What are prefix sums and what problems do they solve?
Show answer
Check whether a string is a palindrome, ignoring case and non-alphanumeric characters.
Show answer
A teammate's BST validation only checks that each node is greater than its left child and smaller than its right child. Why is that wrong?
Show answer
What is the Dutch National Flag algorithm?
Show answer
What are lower bound and upper bound, and what common bugs appear in binary search?
Show answer
What are inorder, preorder, postorder and level order traversals?
Show answer
How does Floyd's cycle detection algorithm work and why is it correct?
Show answer
Solve two sum: return the indices of two numbers that add up to the target.
Show answer
What is Kadane's algorithm?
Show answer
What is the difference between a subarray, a subsequence and a substring?
Show answer
What is the difference between Big-O, Big-Omega and Big-Theta?
Show answer
What is the difference between full, complete and perfect binary trees?
Show answer
What is the diameter of a binary tree and how do you compute it efficiently?
Show answer
What are the trade-offs between recursion and iteration?
Show answer
Write an iterative inorder traversal of a binary tree.
Show answer
In activity selection, why do we sort by end time rather than start time or duration?
Show answer
What is the two pointer technique and when is it used?
Show answer
How do you approach a coding problem you have never seen before in an interview?
Show answer
What is space complexity and how is auxiliary space different?
Show answer
What is the difference between a static array and a dynamic array?
Show answer
What is time complexity and what does Big-O notation mean?
Show answer
Implement Kadane's algorithm for the maximum subarray sum.
Show answer
A problem has n up to 100000. Which time complexities are acceptable for a 1-second limit?
Show answer
Solve house robber: maximise money robbed from houses in a row without robbing two adjacent houses.
Show answer
Describe a time you got stuck during a coding interview or contest. How did you recover?
Show answer
What is recursion and why is a base case essential?
Show answer
Merge K sorted linked lists using a min-heap.
Show answer
Why is naive recursive Fibonacci exponential, and how do you fix it?
Show answer
Describe a team project where one member was not contributing. What did you do?
Show answer
Write recursive Fibonacci and then optimise it with memoisation.
Show answer
Where do you see yourself in five years?
Show answer
List common complexity classes from fastest to slowest with examples.
Show answer
Find the maximum depth of a binary tree.
Show answer
Implement fast exponentiation to compute x to the power n in O(log n).
Show answer
An array of size 100000 must answer 100000 queries asking for the sum between two indices. What approach would you use?
Show answer
Solve the Tower of Hanoi problem recursively.
Show answer
How do you find the lowest common ancestor in a BST versus in a general binary tree?
Show answer
Strings are immutable in Java and Python. How does that affect algorithm complexity?
Show answer
Frequently asked questions
What does a Software Engineer (Fresher / SDE-1) do?
Freshers join product and service companies as software engineers or SDE-1 after clearing online coding tests and technical interviews focused on DSA. They build features, fix bugs and write tests under the guidance of senior engineers. Strong problem solving with arrays, strings, hashing, trees and basic graphs, explained clearly with complexity analysis, is the main hiring signal, along with one or two good projects.
Which skills are tested in a Software Engineer (Fresher / SDE-1) interview?
Expect questions on Problem solving, Complexity analysis, Clean coding, Hashing and arrays, Tree traversals. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a Software Engineer (Fresher / SDE-1) interview?
Revise Arrays, Strings and Hashing, Trees and Binary Search Trees, Complexity Analysis and Recursion first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.