Sde1
100+ Sde1 Interview Questions and Answers

Asked in Park Plus

Q. What are the advantages of a doubly linked list over a singly linked list?
Doubly linked list allows traversal in both directions, while singly linked list only allows traversal in one direction.
Doubly linked list allows for efficient deletion of nodes compared to singly linked list.
Doubly linked list can be traversed in both forward and backward directions.
Doubly linked list can be used to implement a stack or queue.
Singly linked list requires less memory than doubly linked list.
Doubly linked list is more complex to implement than singly linked lis...read more

Asked in Amazon

Q. Implement an LRU cache with production-level code.
Implementation of LRU cache using a doubly linked list and a hash map.
LRU (Least Recently Used) cache is a data structure that stores a fixed number of items and evicts the least recently used item when the cache is full.
To implement LRU cache, we can use a doubly linked list to maintain the order of items based on their usage frequency.
We can also use a hash map to store the key-value pairs for quick access and retrieval.
When a new item is accessed, it is moved to the front ...read more

Asked in RaRa Delivery

Q. What is the fastest sorting algorithm?
The fastest sorting algorithm is QuickSort.
QuickSort has an average time complexity of O(n log n).
It is a divide and conquer algorithm that recursively partitions the array.
It is widely used in practice and has many variations such as randomized QuickSort.
Other fast sorting algorithms include MergeSort and HeapSort.
Asked in Dark Horse Digital Solutions

Q. 1.What is Rdbms? 2.What is polymorphism and inheritance? 3.What is trigger? 4.Difference between span tag and div tag?
RDBMS is a relational database management system. Polymorphism and inheritance are OOP concepts. Triggers are database objects. Span and div tags are HTML elements.
RDBMS stands for Relational Database Management System, used to store and manage data in a structured format.
Polymorphism allows objects to be treated as instances of their parent class. Inheritance allows a class to inherit properties and behaviors from another class.
Triggers are database objects that are automati...read more

Asked in Park Plus

Q. 4. Explain the internal working of the above question.
The question is unclear and requires clarification.
The question is not specific about what 'above question' it is referring to.
The term 'internal working' is also vague and needs to be defined.
Without more information, it is impossible to provide a meaningful answer.

Asked in Ola Cabs

Q. Write a React JS parent and child component and demonstrate how passing props work.
Example of React parent and child components with props
Create a parent component with state and pass it as props to child component
Access the props in child component using 'props' keyword
Update the parent state from child component using a callback function passed as prop
Example: Parent component -
Example: Child component -
Sde1 Jobs




Asked in OnMobile Global

Q. What are the differences between heap and stack memory, and how is memory cleanup handled in each?
Heap and stack are two different memory regions in a computer's memory. Heap is used for dynamic memory allocation, while stack is used for static memory allocation.
Heap is used for dynamic memory allocation, while stack is used for static memory allocation.
Heap memory is allocated at runtime and can be accessed randomly, while stack memory is allocated at compile time and accessed in a last-in-first-out manner.
Memory clean up in heap is done manually by the programmer using ...read more

Asked in Aloha Technology

Q. Write a factorial program and explain it and define class syantax
Factorial program using class syntax explained with examples.
Factorial is the product of all positive integers up to a given number.
Class syntax is used to define a blueprint for creating objects.
Example: class Factorial { def fact(n): return 1 if n == 0 else n * fact(n-1) }
Example: f = Factorial(); print(f.fact(5)) # Output: 120
Share interview questions and help millions of jobseekers 🌟

Asked in Amazon

Q. What is NP-hardness?
NP hardness refers to the difficulty of solving a problem in non-deterministic polynomial time.
NP-hard problems are some of the most difficult problems in computer science.
They cannot be solved in polynomial time by any known algorithm.
Examples include the traveling salesman problem and the knapsack problem.

Asked in Microsoft Corporation

Q. Given two words, how would you determine the similarity between them?
The question asks to determine the similarity between two words.
Use a similarity metric like Levenshtein distance or cosine similarity
Normalize the words by converting them to lowercase and removing punctuation
Consider using a pre-trained word embedding model for semantic similarity
Implement a function that calculates the similarity score between two words

Asked in Park Plus

Q. 3. Applications of Graph Data Structure
Graph data structure is used in various applications such as social networks, routing algorithms, and recommendation systems.
Social networks use graphs to represent users and their connections.
Routing algorithms use graphs to find the shortest path between two points.
Recommendation systems use graphs to analyze user behavior and suggest relevant items.
Graphs are also used in computer networks, image processing, and machine learning.
Examples include Dijkstra's algorithm, PageR...read more

Asked in Amazon

Q. B trees , B+ trees with examples
B trees and B+ trees are data structures used for efficient storage and retrieval of data in databases.
B trees are balanced trees with a variable number of child nodes per parent node. They are commonly used in databases to store large amounts of data.
B+ trees are a variant of B trees where all data is stored in the leaf nodes, and the internal nodes only contain keys. They are commonly used in databases for indexing.
B+ trees are more efficient than B trees for range queries ...read more

Asked in Capillary Technologies

Q. How do you compute requests per second in an application?
To compute requests per second in an application
Identify the number of requests received by the application in a given time frame
Divide the number of requests by the time frame to get requests per second
Use load testing tools like JMeter to simulate traffic and measure requests per second
Optimize application performance to handle high traffic and increase requests per second
Asked in Sureify Labs Technology

Q. Given an array of integers, find the product of all the elements except the element at each index. Solve it in linear time.
Find the product of all elements in the array except that element in linear time.
Initialize a result array with the same length as the input array
Calculate the product of all elements to the left of each element and store it in the result array
Calculate the product of all elements to the right of each element and multiply it with the corresponding element in the result array
Return the result array

Asked in Jio Platforms

Q. Given a string, find the first repeating character. For example, if the string is 'abcbca', the answer is 'a'.
Given a string, find the first repeating character.
Use a hash table to keep track of characters and their frequency.
Iterate through the string and check if the character is already in the hash table.
Return the first character with a frequency greater than 1.

Asked in Jio Platforms

Q. SQL qn: standard qn, find the 2nd highest salary Find the nth highest salary from table employee
SQL query to find nth highest salary from employee table
Use ORDER BY and LIMIT clauses
For 2nd highest salary use LIMIT 1,1
For nth highest salary use LIMIT n-1,1

Asked in Junglee Games

Q. What are different types of streams
Streams are a sequence of data elements made available over time. There are different types of streams.
Byte Streams
Character Streams
Buffered Streams
Data Streams
Object Streams
Print Streams
File Streams
Network Streams

Asked in RaRa Delivery

Q. What are the differences between Arrays and ArrayLists in Java?
Arrays are fixed in size while ArrayLists can dynamically grow or shrink.
Arrays are of fixed size while ArrayLists can be resized dynamically.
Arrays can hold primitive data types while ArrayLists can only hold objects.
Arrays are faster than ArrayLists for accessing elements.
ArrayLists have built-in methods for adding, removing, and sorting elements.
Example: int[] arr = new int[5]; ArrayList<String> list = new ArrayList<>();

Asked in Altair Engineering

Q. What is polymorphism and how does it work?
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as if they were the same type.
Polymorphism is achieved through method overriding and method overloading.
Method overriding is when a subclass provides a specific implementation of a method that is already provided by its parent class.
Method overloading is when a class has two or more methods with the same name but different parameters.
Polymorphism allows for mor...read more

Asked in Cashfree Payments

Q. Given a sequence of buildings, find the number of buildings to the left and right that can be viewed from the top of each building.
Given a sequence of buildings, find the number of buildings visible to the left and right from the top of each building.
Traverse the sequence of buildings from left to right and maintain a stack of visible buildings.
For each building, pop all the buildings from the stack that are shorter than the current building and count them as visible to the left.
Push the current building onto the stack and count the number of buildings in the stack as visible to the right.
Repeat the proc...read more

Asked in Ola Cabs

Q. Explain currying in JavaScript. Provide an example, such as sum(1)(2)() or sum(2)(4)(), where the function returns the sum of the numbers.
Currying is a technique of transforming a function that takes multiple arguments into a sequence of functions that each take a single argument.
Currying is achieved by returning a function that takes the next argument until all arguments are received.
In JavaScript, currying is often used for partial application of functions.
The sum function in the example takes one argument and returns a function that takes the next argument until all arguments are received.
The final function ...read more

Asked in Altair Engineering

Q. What are shallow and deep copies?
Shallow copy creates a new object with the same reference as the original, while deep copy creates a new object with a new reference.
Shallow copy only copies the reference to the original object, so changes made to the copy will affect the original object.
Deep copy creates a new object with a new reference, so changes made to the copy will not affect the original object.
In Python, shallow copy can be made using the copy() method, while deep copy can be made using the deepcopy...read more

Asked in RaRa Delivery

Q. OOPS: 1. Polymorphism with example 2. Overloading vs overriding
Polymorphism is the ability of an object to take on many forms. Overloading is having multiple methods with the same name but different parameters. Overriding is having a method in a subclass with the same name and parameters as a method in the superclass.
Polymorphism allows objects to be treated as if they are of different types. For example, a parent class reference can be used to refer to a child class object.
Overloading is used to provide different implementations of a me...read more

Asked in Qualcomm

Q. You are given a linked list where each node contains an additional random pointer, which could point to any node in the list or null. Construct a deep copy of the list.
Clone a linked list with a random pointer.
Create a new node for each node in the original list
Store the mapping of original node to new node in a hash table
Set the random pointer of each new node based on the mapping
Traverse the original list and the new list simultaneously to set the next pointers

Asked in Amazon

Q. 1. Find the contiguous sub array with max sum 2. Find the median of an array sorting is involved
Interview question on finding max sum contiguous subarray and median of array with sorting involved.
For finding max sum contiguous subarray, use Kadane's algorithm which has O(n) time complexity.
For finding median of array, sort the array and then find the middle element or average of middle two elements.
If the array is too large to sort, use quickselect algorithm to find the kth smallest element in O(n) time.
Asked in Amdocd

Q. You have a seesaw. There are 9 people on an island. One weighs slightly heavier or lighter than the rest. Find that person in the minimum number of comparisons.
Use 2 weighings to identify the different person on the seesaw among 9 people on an island.
Divide the 9 people into 3 groups of 3 each.
Weigh any 2 groups against each other.
If the 2 groups weigh the same, the different person is in the third group.
If one of the groups weighs less or more, the different person is in that group.
Divide the group with the different person into 3 individuals.
Weigh any 2 individuals against each other.
If they weigh the same, the different person is...read more

Asked in Plivo

Q. Given an array of 0s, 1s, and 2s, sort the array in O(n) time.
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.
The first pointer should point to the first occurrence of 1, and the second pointer should point to the first occurrence of 2.
Example: [0, 1, 2, 0, 1, 2] -> [0, 0, 1, 1, 2, 2]

Asked in Park Plus

Q. 1. Difference between RDBMS and NoSQL
RDBMS is a structured database that uses SQL while NoSQL is a non-relational database that doesn't use SQL.
RDBMS stores data in tables with predefined schema while NoSQL stores data in documents, key-value pairs, or graphs.
RDBMS is good for complex queries and transactions while NoSQL is good for scalability and handling unstructured data.
Examples of RDBMS include MySQL, Oracle, and SQL Server while examples of NoSQL include MongoDB, Cassandra, and Redis.

Asked in Kinaxis

Q. Given an array of integers, find the maximum product of any two numbers in the array.
Find the maximum product of 2 numbers from a given array.
Sort the array and multiply the last two elements for positive numbers.
If there are negative numbers, multiply the two smallest negative numbers with the largest positive number.
Handle edge cases like array length less than 2 or all negative numbers.

Asked in CoinSwitch

Q. Implement a typeform-like application with optimal state management.
Implementing a Typeform-like form with optimal state management in React.
Use React's useState for local state management of form inputs.
Utilize useReducer for complex state logic, especially with multiple fields.
Implement controlled components to manage form input values.
Consider using libraries like Formik or React Hook Form for better form handling.
Use context API or Redux for global state management if needed.
Interview Experiences of Popular Companies





Top Interview Questions for Sde1 Related Skills

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


Reviews
Interviews
Salaries
Users

