Filter interviews by
Given a binary tree of integers, convert it to a sum tree where each node is replaced by the sum of the values of its left and right subtrees. Set leaf nodes to zero.
...Convert a binary tree to a sum tree by replacing each node with the sum of its left and right subtrees.
Traverse the tree in postorder fashion.
For each node, calculate the sum of its left and right subtrees and update the node value.
Set leaf nodes to zero.
Return the level order traversal of the modified tree.
Given an integer array/list arr
and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.
The first line co...
Count the total number of unique pairs in an array whose elements sum up to a given value.
Use a hashmap to store the frequency of each element in the array.
Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.
Increment the count of pairs if the complement exists in the hashmap.
Divide the count by 2 to avoid counting duplicates like (arr[i], arr[j]) and (arr[j], arr...
C++ supports polymorphism through virtual functions and inheritance.
C++ supports polymorphism through virtual functions and inheritance
Virtual functions allow a function to be overridden in a derived class
Base class pointers can point to derived class objects, allowing for dynamic binding
Example: class Animal { virtual void speak() { cout << 'Animal speaks'; } }; class Dog : public Animal { void speak() { co...
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Implement a stack using two queues to store integer values with specified operations.
Create a stack class with two queue data members.
Implement push(data) by enqueuing the data into one of the queues.
Implement pop() by dequeuing all elements from one queue to another until the last element is reached and return it.
Implement top() by dequeuing all elements from one queue to another until the last element is reached...
Count the number of leaf nodes present in a given binary tree. A binary tree is a data structure where each node has at most two children, known as the left child and the ...
Count the number of leaf nodes in a binary tree.
Traverse the binary tree and count nodes with both children as NULL.
Use recursion to traverse the tree efficiently.
Handle base cases where the node is NULL or a leaf node.
Keep track of the count of leaf nodes as you traverse the tree.
Given a binary matrix of size N * M
where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only ...
Find the shortest path in a binary matrix from a source cell to a destination cell consisting only of 1s.
Use Breadth First Search (BFS) algorithm to find the shortest path.
Initialize a queue with the source cell and keep track of visited cells.
Explore all 4 directions from each cell and update the path length accordingly.
Return the shortest path length or -1 if no valid path exists.
Ninja needs help in a battle against the string man. Given two strings, 'S' and 'T', the task is to find the number of substrings in 'S' that differ from some sub...
The task is to find the number of substrings in 'S' that differ from some substrings of 'T' by exactly one character.
Iterate through all substrings of 'S' and 'T' and compare them character by character to find the ones that differ by exactly one character.
Use nested loops to generate all possible substrings of 'S' and 'T'.
Count the number of substrings that differ by exactly one character and return the total cou...
Mutex is used for exclusive access to a resource by only one thread at a time, while semaphore can allow multiple threads to access a resource simultaneously.
Mutex is binary semaphore with ownership, used for mutual exclusion.
Mutex is typically used to protect critical sections of code.
Semaphore is a signaling mechanism, used for synchronization between multiple threads.
Semaphore can have a count greater than 1, a...
Determine the minimum time required to travel from a starting point to a destination point in a two-dimensional coordinate system, considering both direct movement and the ...
Find the minimum time to travel from a starting point to a destination point using direct movement and wormholes.
Calculate the time taken for direct movement from source to destination.
Consider using each wormhole to see if it reduces the total travel time.
Choose the path with the minimum total time to reach the destination.
You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determin...
Detect cycles in an undirected graph.
Use Depth First Search (DFS) to detect cycles in the graph.
Maintain a visited array to keep track of visited vertices.
If a visited vertex is encountered again during DFS, a cycle exists.
Check for cycles in each connected component of the graph.
Example: For input N=3, Edges=[[1, 2], [2, 3], [1, 3]], output is Yes.
I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.
Calculate the sum of elements in an array that are closest to a given target value.
Iterate through the array and calculate the absolute difference between each element and the target value.
Keep track of the element with the smallest difference and update the sum accordingly.
Return the sum of elements closest to the target value.
I appeared for an interview in May 2025, where I was asked the following questions.
This question involves processing an array containing only 1's and 2's, focusing on their arrangement or counting.
Count the number of 1's and 2's in the array. Example: [1, 2, 1] -> 2 ones, 1 two.
Sort the array to group all 1's followed by 2's. Example: [2, 1, 1] -> [1, 1, 2].
Find the maximum or minimum value in the array. Example: In [1, 2, 1], max is 2, min is 1.
Check if the array is balanced (equal number of 1...
Find the maximum sum of a contiguous subarray in an integer array using Kadane's algorithm.
Use Kadane's algorithm for an efficient O(n) solution.
Initialize two variables: maxSum and currentSum.
Iterate through the array, updating currentSum and maxSum.
Example: For nums = [-2,1,-3,4,-1,2,1,-5,4], maxSum = 6 (subarray [4,-1,2,1]).
If currentSum drops below 0, reset it to 0.
Basic DSA Question on Recursion , DFS, BFS
Insert a node in a N-array tree
Traverse the tree to find the parent node where the new node will be inserted
Add the new node as a child of the parent node
Update the parent node's child array to include the new node
I applied via Referral and was interviewed in May 2024. There was 1 interview round.
The coding from DSA topics
I applied via Campus Placement
1. Online test in campus (1 question, 3hrs - 2018)/
2. Group discussion
3. In person campus interview
I applied via Campus Placement and was interviewed in Nov 2023. There were 3 interview rounds.
3 hr test 1 question
I applied via Naukri.com and was interviewed before Oct 2023. There were 2 interview rounds.
Two leetcode problems
I am a passionate software developer with experience in Java, Python, and web development.
Graduated with a degree in Computer Science
Worked on multiple projects using Java and Python
Familiar with web development technologies like HTML, CSS, and JavaScript
Strong problem-solving skills and ability to work in a team
In 5 years, I see myself as a senior software developer leading a team on innovative projects.
Continuing to enhance my technical skills and knowledge through ongoing learning and certifications
Taking on more leadership responsibilities and mentoring junior developers
Contributing to the success and growth of the company through my expertise and dedication
I applied via Referral and was interviewed in Mar 2023. There were 3 interview rounds.
The aptitude test is about your basic knowledge in software developing.
JAVA is a versatile programming language used for developing various software applications.
JAVA is platform-independent and can run on any operating system
It is object-oriented and supports multithreading
JAVA is widely used for developing web applications, mobile applications, and enterprise software
It provides a vast library of pre-built classes and APIs for developers to use
JAVA is also used for developing games, sci...
I appeared for an interview before Apr 2024, where I was asked the following questions.
Design a ticket booking system for events, movies, and shows with user-friendly features and efficient backend management.
User Registration: Allow users to create accounts for personalized experiences.
Event Listings: Display available events with details like date, time, and venue.
Seat Selection: Provide an interactive seating chart for users to choose their seats.
Payment Gateway: Integrate secure payment options for t...
Convert a linked list to a number by interpreting each node's value as a digit, handling edge cases like empty lists.
Node Representation: Each node in the linked list contains a digit (0-9) and a reference to the next node.
Constructing the Number: Traverse the linked list, multiplying the current number by 10 and adding the node's value.
Example: For a linked list 2 -> 4 -> 3, the number is 243 (2*100 + 4*10 + 3).
...
I appeared for an interview in Apr 2022.
Round duration - 90 Minutes
Round difficulty - Easy
It was conducted on the cubes platform. We were given 2 coding questions to solve in 90 minutes.
I solved both the problems within 25 min and checked for different test cases manually for more than 15 mins. There were only two test cases were visible and the rest are hidden. Even After submission, they didn’t show us whether all test cases pass not. So, before submission doesn’t forget to check for corner cases manually. One needs to pass all test cases as low as time possible.
Given a string S
which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequenc...
Given a number represented as a string, find the smallest number greater than the original with the same set of digits.
Sort the digits in non-increasing order to find the next greater number.
Swap the last two digits to get the smallest greater number.
If no greater number exists, return -1.
Given two arbitrary binary trees consisting of 'N' and 'M' number of nodes respectively, your task is to check whether the two trees are mirror images of each other or not.
Check if two binary trees are mirror images of each other.
Compare the left subtree of the first tree with the right subtree of the second tree.
Compare the right subtree of the first tree with the left subtree of the second tree.
Check if the roots of both trees are the same.
Tip 1 : Practice questions on leetcode
Tip 2 : Understand the best solutions in depth and algorithm used
Tip 3 : Ask clarifying questions to the interviewer and break the problem to smaller sub parts
Tip 1 : Highlight your most impactful work on the resume
Tip 2 : Keep it easy to understand
Top trending discussions
Some of the top questions asked at the Samsung Software Developer interview -
The duration of Samsung Software Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 12 interview experiences
Difficulty level
Duration
based on 34 reviews
Rating in categories
Sales Executive
1.1k
salaries
| ₹1 L/yr - ₹7 L/yr |
Assistant Manager
1k
salaries
| ₹5.5 L/yr - ₹20 L/yr |
Software Engineer
954
salaries
| ₹6.9 L/yr - ₹24 L/yr |
Manager
523
salaries
| ₹10 L/yr - ₹33 L/yr |
Area Sales Manager
513
salaries
| ₹7 L/yr - ₹27 L/yr |
Apple
vivo
OPPO
Dell