Sde1
20+ Sde1 Interview Questions and Answers for Freshers
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 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

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 Infinity Learn

Q. Solve one Data Structures and Algorithms (DSA) problem in any programming language.
Implement a function to find the maximum sum of a contiguous subarray using Kadane's algorithm.
Kadane's algorithm runs in O(n) time complexity.
Initialize two variables: max_current and max_global.
Iterate through the array, updating max_current as the maximum of the current element or the sum of max_current and the current element.
If max_current exceeds max_global, update max_global.
Return max_global as the result.
Example: For array [-2,1,-3,4,-1,2,1,-5,4], the maximum sum is ...read more

Asked in Cogoport

Q. Explain a dynamic programming (DP) problem you have solved.
Dynamic Programming (DP) is a method for solving complex problems by breaking them down into simpler subproblems.
DP is used when a problem can be divided into overlapping subproblems.
Example: Fibonacci sequence can be solved using DP to avoid redundant calculations.
DP typically involves two approaches: top-down (memoization) and bottom-up (tabulation).
Example: Knapsack problem can be solved using both approaches to find the maximum value.
DP is often applied in optimization pr...read more
Sde1 Jobs




Asked in Amazon

Q. Given an array, find the next greater element (NGE) for every element. The Next greater Element for an element x is the first greater element on the right side of x in the array. Elements for which no greater e...
read moreUsing a stack to find the next greater element in an array of strings.
Iterate through the array from right to left.
Push elements onto the stack and compare with the top element to find the next greater element.
Pop elements from the stack until a greater element is found or stack is empty.

Asked in Uber

Q. If bullying occurs, will you participate in bullying someone?
No, I believe in standing up against bullying and supporting those who are being bullied.
I do not support bullying in any form and believe in treating others with respect and kindness.
I would try to intervene and help the person being bullied, either by talking to the bully or seeking help from a teacher or supervisor.
I believe in creating a positive and inclusive environment where everyone feels safe and respected.
Share interview questions and help millions of jobseekers 🌟

Asked in Uber

Q. Why are you applying for an SDE 1 position and not an SDE 2 position?
SDE 1 is an entry-level position where candidates gain foundational skills before advancing to SDE 2.
SDE 1 focuses on learning and building foundational skills in software development.
SDE 2 requires more experience and expertise in software development.
Advancing from SDE 1 to SDE 2 is a common career progression in tech companies.
SDE 1 roles often involve working on smaller projects or components of larger projects.
SDE 2 roles typically involve leading larger projects or team...read more

Asked in Cogoport

Q. There are three rods and N disks of different sizes. The disks can be moved from one rod to another. The goal is to move the stack of disks from the first rod to the last rod, following these rules: 1. Only one...
read moreThe Tower of Hanoi is a classic recursive problem involving moving disks between rods under specific rules.
Three rods: source, auxiliary, and destination.
Move one disk at a time from the top of one rod to another.
A larger disk cannot be placed on top of a smaller disk.
For n disks, the minimum number of moves required is 2^n - 1.
Example: For 3 disks, the sequence of moves is: A to C, A to B, C to B, A to C, B to A, B to C, A to C.

Asked in OnMobile Global

Q. Explain the internal workings of a HashMap, including the calculation aspects.
HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values.
HashMap uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to determine the index in the array where it will be stored.
If multiple keys hash to the same index (collision), a linked list is used to store all key-value pairs at that index.
To retrieve a value, the key is hashed again to find the index and then the linked li...read more

Asked in Infinity Learn

Q. Implementing a feature in REACT
Implementing a feature in REACT
Identify the feature requirements and design the component structure
Write the necessary JSX code to create the feature
Implement state management using React hooks or Redux if needed
Handle user interactions and update the component state accordingly
Test the feature to ensure it works as expected
Asked in Dark Horse Digital Solutions

Q. Coding question 1. Find maximum subarray
Maximum subarray problem is to find the contiguous subarray with maximum sum in an array of integers.
Use Kadane's algorithm to find the maximum subarray sum in linear time complexity.
Initialize two variables, max_so_far and max_ending_here, to track the maximum sum so far and the maximum sum ending at the current index, respectively.
Iterate through the array and update max_ending_here and max_so_far accordingly.
Return max_so_far as the maximum subarray sum.

Asked in Amazon

Q. Given the head of a singly linked list, reverse the list, and return the reversed list.
Reverse a linked list
Iterate through the linked list and reverse the pointers
Use three pointers - prev, current, next to reverse the links
Update the head of the linked list to the last node after reversing

Asked in Meesho

Q. Design a shopping cart.
Design a shopping cart system to manage products, users, and transactions efficiently.
Define Product class with attributes like id, name, price, and quantity.
Create Cart class to manage items added by users, with methods to add, remove, and update quantities.
Implement User class to handle user information and their associated cart.
Include methods for checkout process, calculating total price, and applying discounts.
Consider using a database or in-memory storage for persistenc...read more

Asked in TCS

Q. Based on my resume, what is your Java experience?
Java is a versatile, object-oriented programming language used for building applications across various platforms.
Java is platform-independent due to the Java Virtual Machine (JVM). For example, code written in Java can run on any device with a JVM.
It supports Object-Oriented Programming (OOP) principles like inheritance, encapsulation, and polymorphism. For instance, a 'Car' class can inherit from a 'Vehicle' class.
Java has a rich API and a large ecosystem of libraries and f...read more

Asked in Amazon

Q. Multiply one matrix with another
Matrix multiplication involves multiplying the elements of one matrix with another matrix.
Create two matrices with compatible dimensions
Multiply corresponding elements of each row in the first matrix with each column in the second matrix
Sum the products to get the resulting matrix

Asked in Aloha Technology

Q. Write a function syntax.
Function syntax is the structure and format of a function in a programming language.
Function name followed by parentheses and parameters
Code block enclosed in curly braces
Return statement to output a value
Example: function add(a, b) { return a + b; }
Example: function greet(name) { console.log('Hello, ' + name + '!'); }

Asked in OnMobile Global

Q. Types of synchronization?
Types of synchronization include mutual exclusion, semaphores, monitors, and condition variables.
Mutual exclusion: Ensures that only one thread can access a resource at a time.
Semaphores: Used to control access to a common resource by multiple threads.
Monitors: Combines data and procedures into a single unit to control access to shared resources.
Condition variables: Allow threads to wait for a certain condition to be met before proceeding.

Asked in Amazon

Q. Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Rain water trapping problem refers to the accumulation of rainwater in low-lying areas or on flat roofs.
The problem can be solved by installing rainwater harvesting systems.
Proper drainage systems can also prevent rainwater trapping.
Green roofs and permeable pavements can help absorb rainwater.
Rain gardens can be created to collect and filter rainwater.
Regular maintenance of gutters and downspouts can prevent clogging and overflow.
The problem can lead to water damage, mold gr...read more

Asked in Amazon

Q. Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descen...
read moreLargest common ancestor is the most recent node that is a common ancestor of two or more nodes in a tree.
It is commonly used in computer science and genealogy.
In genealogy, it refers to the most recent common ancestor of two or more individuals.
In computer science, it is used in algorithms for finding the lowest common ancestor of two nodes in a tree.
It can be found using various algorithms such as Tarjan's off-line least common ancestors algorithm and the binary lifting algo...read more

Asked in OnMobile Global

Q. Capacity of SCP?
SCP stands for Secure, Contain, Protect. It refers to a fictional organization that secures and contains anomalous objects.
SCP Foundation is a fictional organization in the SCP universe that secures and contains anomalous objects
The capacity of SCP refers to the organization's ability to contain and manage these anomalous objects
SCP Foundation has various containment facilities with different capacities to house different types of anomalies

Asked in Apptio

Q. Given an integer n, determine whether it is a prime number.
A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.
A prime number has exactly two distinct positive divisors: 1 and itself.
Examples of prime numbers: 2, 3, 5, 7, 11, 13.
The number 1 is not prime because it has only one divisor.
The number 4 is not prime because it can be divided by 1, 2, and 4.
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

