SDE Intern

60+ SDE Intern Interview Questions and Answers

Updated 15 Jul 2025
search-icon
6d ago

Q. Given a string of containing lower case letters and upper case characters. Find the number of occurrences of each character. The question was further modified to include the special characters as well. I was as...

read more
Ans.

Count the occurrences of each character in a given string including special characters.

  • Create test cases for empty string

  • Test for string with only one character

  • Test for string with all characters being the same

  • Test for string with all characters being different

  • Test for string with special characters

Asked in Amazon

5d ago

Q. Find the square root of a number using only 4 basic arithmetic operations (+,-,*,/) without using a power operator and inbuilt libraries. For numbers that are not perfect squares, print the integer part of the...

read more
Ans.

Find square root of a number using basic arithmetic operations without power operator and inbuilt libraries.

  • Use binary search to find the integer part of the square root

  • Use long division method to find the decimal part of the square root

  • Repeat the above steps until desired accuracy is achieved

  • Handle edge cases like negative numbers and numbers less than 1

SDE Intern Interview Questions and Answers for Freshers

illustration image

Asked in Carwale

1d ago

Q. How would you design an e-commerce web application?

Ans.

Designing an e-commerce web app involves user interface, product management, payment processing, and scalability considerations.

  • User Interface: Create a responsive design for easy navigation and product discovery.

  • Product Management: Implement a database to manage product listings, including categories, descriptions, and images.

  • User Authentication: Allow users to create accounts, log in, and manage their profiles.

  • Shopping Cart: Enable users to add products to a cart and manage...read more

5d ago

Q. Remove duplicate characters from a given string, keeping only the first occurrences (i.e., order should not change). For example, if the input is ‘bananas,’ the output will be ‘bans.’

Ans.

Remove duplicate characters from a string while preserving order.

  • Create an empty string to hold the result.

  • Iterate through each character in the input string.

  • If the character is not already in the result string, add it.

  • Return the result string.

Are these interview questions helpful?

Asked in Carwale

3d ago

Q. What is caching, and why is it necessary?

Ans.

Caching is the process of storing frequently accessed data in a temporary storage to improve performance.

  • Caching reduces the need to fetch data from the original source, improving response time.

  • It helps in reducing network traffic and server load.

  • Caching can be done at various levels like browser caching, CDN caching, and server-side caching.

  • Examples of caching include browser caching of website assets, CDN caching of static content, and database query result caching.

1d ago

Q. Given two singly linked lists that intersect to form a Y shape, find the node at the intersection point.

Ans.

Given a Y-linked list, find the node at the intersection point.

  • Traverse both branches of the Y-linked list and compare nodes.

  • Use a hash table to store visited nodes and check for intersection.

  • If one branch is longer, traverse it until it matches the length of the other branch.

SDE Intern Jobs

upstox logo
SDE Intern 0-1 years
upstox
3.6
Mumbai
Binocs logo
SDE Intern 0-3 years
Binocs
4.0
Bangalore / Bengaluru
4d ago

Q. How do you change permissions for a particular file?

Ans.

To change permissions for a file, you can use the chmod command in the terminal.

  • Use the chmod command followed by the permission code and the file name

  • Permission codes include 'u' for user, 'g' for group, and 'o' for others, along with 'r' for read, 'w' for write, and 'x' for execute

  • For example, to give read and write permissions to the user for a file named 'example.txt', you can use 'chmod u+rw example.txt'

2d ago

Q. Explain the logic and code to traverse a binary tree level by level in spiral form.

Ans.

Traverse a binary tree in spiral order, alternating between left-to-right and right-to-left at each level.

  • Use two stacks: one for the current level and one for the next level.

  • Start with the root node in the first stack.

  • While there are nodes in the current stack, pop nodes and add their children to the next stack in the opposite order.

  • Switch stacks after each level to alternate the traversal direction.

  • Example: For a tree with root 1, left child 2, right child 3, the spiral ord...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
2d ago

Q. 1. Describe your projects in depth. 2. Database schema design of Codechef. 3. SQL queries related to that. 4. Questions on CN

Ans.

Answering questions on projects, database schema design of Codechef, SQL queries, and CN.

  • Projects involved developing a web application for managing employee data and a mobile app for tracking expenses.

  • Database schema design of Codechef involved creating tables for users, problems, submissions, and contests.

  • SQL queries related to Codechef included retrieving user details, problem submissions, and contest rankings.

  • Questions on CN covered topics such as network protocols, OSI m...read more

Asked in Techweirdo

3d ago

Q. Describe a situation where you had to list data on a page from an API using React.js.

Ans.

Using React.js to fetch and display data from an API involves state management and lifecycle methods.

  • Use the useEffect hook to fetch data when the component mounts.

  • Utilize the useState hook to manage the fetched data.

  • Handle loading and error states to improve user experience.

  • Example: Fetching user data from an API and displaying it in a list.

  • Consider using async/await for cleaner asynchronous code.

Asked in ServiceNow

3d ago

Q. What is a load balancer?

Ans.

A load balancer distributes network traffic across multiple servers to ensure reliability and optimize resource use.

  • Improves application availability by distributing requests to multiple servers.

  • Can be hardware-based (like F5) or software-based (like Nginx).

  • Helps in scaling applications by adding more servers as demand increases.

  • Supports various algorithms like Round Robin, Least Connections, and IP Hash.

  • Example: A website using a load balancer can handle more users by spread...read more

Asked in Amazon

1d ago

Q. Given a sorted linked list, how can you remove duplicates from it?

Ans.

Remove duplicates from a sorted linked list

  • Use two pointers - one to iterate through the list and another to keep track of unique elements

  • Compare current node with next node, if they are equal, skip the next node

  • Repeat until end of list is reached

Asked in Techweirdo

4d ago

Q. How does DOM manipulation work in React.js?

Ans.

React.js uses a virtual DOM to optimize updates and improve performance during DOM manipulation.

  • React creates a virtual DOM, a lightweight copy of the actual DOM.

  • When state changes, React updates the virtual DOM first, not the real DOM.

  • React uses a diffing algorithm to compare the virtual DOM with the real DOM.

  • Only the changed elements are updated in the real DOM, minimizing performance costs.

  • Example: If a list item is added, React updates only that item instead of re-renderi...read more

5d ago

Q. Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. The LCA is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (...

read more
Ans.

Find the lowest common ancestor (LCA) of two nodes in a binary search tree (BST) efficiently.

  • In a BST, for any node, left children are smaller and right children are larger.

  • To find LCA of nodes p and q, start from the root.

  • If both p and q are smaller than the root, LCA lies in the left subtree.

  • If both p and q are larger than the root, LCA lies in the right subtree.

  • If one is on the left and the other is on the right, the root is the LCA.

  • Example: For nodes 2 and 8 in a BST, if ...read more

1d ago

Q. You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum a...

read more
Ans.

Addition of two linked lists and return the result as a linked list.

  • Traverse both linked lists simultaneously

  • Add corresponding nodes and carry over the sum

  • Create a new linked list with the sum

Asked in Springworks

2d ago

Q. Projects and tech stack used

Ans.

I have worked on various projects using different tech stacks including Java, Python, and JavaScript.

  • Developed a web application using Java Spring Boot framework

  • Created a data analysis tool using Python libraries such as Pandas and NumPy

  • Built a real-time chat application using JavaScript and Node.js

  • Implemented machine learning algorithms using Python's scikit-learn library

  • Worked on a mobile application using React Native framework

Asked in INDMoney

2d ago

Q. Write an SQL query for a bus transport system that handles passenger pick-up and drop-off.

Ans.

SQL query to manage pick and drop of passengers in a transport system

  • Create a table for passengers with columns like passenger_id, name, pick_up_location, drop_off_location, etc.

  • Create a table for transport vehicles with columns like vehicle_id, driver_name, capacity, etc.

  • Use JOIN to link the two tables based on pick_up_location and drop_off_location.

  • Consider adding a table for routes and scheduling for better organization.

  • Example: SELECT * FROM passengers p JOIN vehicles v O...read more

3d ago

Q. What are the key concepts in React, such as Props, State, and Hooks?

Ans.

React key concepts include Props, State, and Hooks, essential for building dynamic user interfaces.

  • Props: Short for properties, used to pass data from parent to child components. Example: <ChildComponent name='John' />.

  • State: A component's internal data storage that can change over time. Example: const [count, setCount] = useState(0);.

  • Hooks: Functions that let you use state and other React features in functional components. Example: useEffect(() => { /* side effects */ }, [])...read more

Asked in Amazon

5d ago

Q. Given a timestamp, find the next permutation of the digits in the timestamp.

Ans.

Find the next permutation of a given timestamp in HH:MM AM/PM format.

  • Convert the timestamp to a 24-hour format for easier manipulation.

  • Identify the rightmost pair where the earlier digit is smaller than the later one.

  • Swap this digit with the smallest larger digit to its right.

  • Reverse the digits to the right of the swapped position to get the next permutation.

  • Example: For '11:55 PM', the next permutation is '12:00 AM'.

Asked in Techweirdo

3d ago

Q. What is multithreading in Javascript?

Ans.

Multithreading is not natively supported in JavaScript, but can be achieved through Web Workers.

  • JavaScript is a single-threaded language, meaning it can only execute one task at a time.

  • Web Workers allow for multithreading in JavaScript by running scripts in the background.

  • Web Workers can communicate with the main thread using message passing.

  • Examples of tasks that can benefit from multithreading include heavy computations and long-running processes.

Asked in Meta

4d ago

Q. Why Meta? What do you know about Meta in AI space?

Ans.

Meta is a leading company in AI space with a focus on developing innovative technologies and solutions.

  • Meta (formerly Facebook) is known for its advanced AI research and development.

  • Meta uses AI for various applications such as content moderation, personalized recommendations, and virtual assistants.

  • Meta's AI technologies power products like facial recognition, language translation, and image recognition.

2d ago

Q. Given an array containing numbers from 1 to n, with one number missing, find the missing number.

Ans.

Find the missing number in an array containing numbers from 1 to n.

  • Iterate through the array and calculate the sum of all numbers from 1 to n.

  • Calculate the sum of all numbers in the given array.

  • Subtract the sum of array from the sum of all numbers to find the missing number.

Asked in Techweirdo

4d ago

Q. What are some basic concepts of the Node.js event loop?

Ans.

The Node.js event loop manages asynchronous operations, allowing non-blocking execution of code in a single-threaded environment.

  • The event loop is a core part of Node.js that handles asynchronous callbacks.

  • It operates in phases: timers, I/O callbacks, idle, poll, check, and close callbacks.

  • Example: setTimeout() schedules a callback to run after a specified delay.

  • I/O operations (like reading files) are offloaded to the system, allowing the event loop to continue processing oth...read more

Asked in Amazon

2d ago

Q. Given a binary tree, find all leaf nodes and print the path from the root to each leaf node.

Ans.

Find leaf nodes in a binary tree and print path to each leaf node.

  • Traverse the binary tree using depth-first search (DFS)

  • When reaching a leaf node, store the path from root to that leaf node

  • Repeat the process for all leaf nodes in the tree

Asked in INDMoney

6d ago

Q. Create functions to insert, delete, and print elements in a linked list.

Ans.

Function to insert, delete, and print a linked list

  • Create a Node class with data and next pointer

  • Implement insert function to add a new node at the end of the linked list

  • Implement delete function to remove a node by value

  • Implement print function to display all elements in the linked list

Asked in Amazon

5d ago

Q. Given a binary tree, return the leftmost node at the deepest level.

Ans.

Find the deepest left node in a binary tree.

  • Traverse the tree recursively and keep track of the depth and whether the current node is a left node.

  • If the current node is a leaf node and its depth is greater than the deepest left node found so far, update the deepest left node.

  • Return the deepest left node found.

  • Example: For the binary tree with root node 1, left child 2, and left child of 2 being 4, the deepest left node is 4.

  • Example: For the binary tree with root node 1, left ...read more

Asked in TurboHire

4d ago

Q. How do you optimize written code and estimate time complexity?

Ans.

Optimizing code and estimating time complexity

  • Identify bottlenecks in the code and optimize them

  • Use efficient data structures and algorithms

  • Analyze the code to determine its time complexity

  • Consider worst-case, best-case, and average-case scenarios

  • Use Big O notation to express the time complexity

Asked in GoComet

5d ago

Q. Given a sorted matrix (sorted row-wise and column-wise), how would you search for an element in it?

Ans.

Use binary search to efficiently search for an element in a sorted matrix.

  • Start from the top right corner of the matrix

  • If the target is greater than the current element, move down

  • If the target is less than the current element, move left

  • Repeat until the target is found or all elements are checked

Asked in SNS iHub

6d ago

Q. What is virtual DOM?

Ans.

Virtual DOM is a lightweight copy of the actual DOM used for efficient updates.

  • Virtual DOM is a concept used in modern web development frameworks like React.

  • It is a lightweight copy of the actual DOM that is used to track changes and update the actual DOM efficiently.

  • When a change is made to the virtual DOM, it is compared with the previous version to identify the minimum number of changes required to update the actual DOM.

  • This approach reduces the number of updates required ...read more

4d ago

Q. What is the difference between one-way and two-way data binding?

Ans.

Single way binding updates the view when the model changes, while two way binding updates both the view and the model.

  • Single way binding updates the view when the model changes, but not vice versa.

  • Two way binding updates both the view and the model when either changes.

  • Single way binding is commonly used in frameworks like AngularJS, while two way binding is used in frameworks like Vue.js.

1
2
3
Next

Interview Experiences of Popular Companies

Amazon Logo
4.0
 • 5.4k Interviews
Samsung Logo
3.9
 • 577 Interviews
Bluestock ™ Logo
4.5
 • 243 Interviews
Myntra Logo
3.9
 • 229 Interviews
View all

Top Interview Questions for SDE Intern Related Skills

Interview Tips & Stories
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
SDE Intern 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