Filter interviews by
Profit and Loss, Numbers questions
Java related questions
Basi Java questions
Basic question
I appeared for an interview before Sep 2020.
Round duration - 70 minutes
Round difficulty - Medium
It consisted of three coding questions varying from easy to medium.
You are provided with the root of a binary tree that consists of 'N' nodes. Each node in this tree contains coins, and the total number of coins across all nodes is equ...
Determine the minimum number of moves required to distribute coins in a binary tree so that every node has exactly one coin.
Traverse the binary tree in a bottom-up manner to distribute coins efficiently.
Keep track of the excess or deficit of coins at each node to calculate the minimum moves required.
Transfer coins from nodes with excess coins to nodes with deficits to balance the distribution.
Example: For the input ROO...
Given an array arr
of N integers that may include duplicates, determine the number of subsets of this array containing only distinct elements.
The result should be returned modulo ...
Count the number of distinct-element subsets in an array modulo 10^9+7.
Iterate through the array and keep track of distinct elements using a set.
Calculate the number of subsets using the formula 2^distinct_count - 1.
Return the result modulo 10^9+7 for each test case.
A thief is robbing a store and can carry a maximal weight 'W' in his knapsack. There are 'N' items, where the i-th item has a weight 'wi' and value 'vi'. Consider the maximu...
The 0-1 Knapsack Problem involves maximizing the value of items a thief can steal within a weight limit.
Use dynamic programming to solve the problem efficiently.
Create a 2D array to store the maximum value that can be achieved at each weight limit.
Iterate through the items and weights to fill the array with optimal values.
Return the maximum value achievable at the given weight limit.
Round duration - 60 minutes
Round difficulty - Medium
The interview was focused on data structures as well as computer fundamentals along with puzzles.
You are given an unsorted array ARR
. Your task is to sort it so that it forms a wave-like array.
The first line contains an integer 'T', the number of test cases.
For ea...
Sort an array in wave form where each element is greater than or equal to its adjacent elements.
Iterate through the array and swap adjacent elements to form a wave pattern.
Ensure that the first element is greater than or equal to the second element.
There can be multiple valid wave arrays, so any valid wave array is acceptable.
You are given a Singly Linked List of integers. Your task is to reverse the Linked List by changing the links between nodes.
The first line of input contai...
Reverse a given singly linked list by changing the links between nodes.
Iterate through the linked list and reverse the links between nodes
Use three pointers to keep track of the current, previous, and next nodes
Update the links between nodes to reverse the list
Return the head of the reversed linked list
Round duration - 90 minutes
Round difficulty - Easy
The Round was mainly focused on resume+ dsa + system design +computer fundamentals
Given a stream of integers, calculate and print the median after each new integer is added to the stream.
Output only the integer part of the median.
N = 5
Stre...
Calculate and print the median after each new integer is added to the stream.
Use a min heap to store the larger half of the numbers and a max heap to store the smaller half.
Keep the two heaps balanced by ensuring the size difference is at most 1.
If the total number of elements is odd, the median is the top of the larger heap. If even, average the tops of both heaps.
LRU cache in a database management system stores most recently used data and removes least recently used data when full.
LRU cache is implemented using a doubly linked list and a hash map.
Each node in the linked list represents a key-value pair.
When a key is accessed, it is moved to the front of the linked list.
If the cache is full, the least recently used node at the end of the list is removed.
Example: If cache size is...
Use two stacks - one to store actual values and one to store minimum values.
Use two stacks - one to store actual values and one to store minimum values
When pushing a new value, check if it is smaller than the current minimum and push it to the min stack if so
When popping a value, check if it is the current minimum and pop from min stack if so
getMin() operation can be done by peeking at the top of the min stack
Tip 1 : Properly grasp over basic concepts
Tip 2 : Prepare good for DS & Algo as most companies have a separate round for it.
Tip 3 : Don't lie over your resume
Tip 1 : Don't Lie over your resume
Tip 2 : Avoid unnecessary details like Hobbies, family details, declaration, date, signature, etc.
SOLID principles are a set of five design principles for writing maintainable and scalable code.
S - Single Responsibility Principle
O - Open/Closed Principle
L - Liskov Substitution Principle
I - Interface Segregation Principle
D - Dependency Inversion Principle
HashSet is a collection that stores unique elements by using a hash table.
Elements are stored based on their hash code
Uses hashCode() and equals() methods to check for duplicates
Does not maintain insertion order
Allows null values
Example: HashSet
I applied via Naukri.com and was interviewed before Apr 2023. There were 4 interview rounds.
Python, SQL related questions
I applied via Approached by Company and was interviewed before May 2023. There were 2 interview rounds.
1 Hour, Asked LRU Cache
Left Side of binary tree
The Lowest Common Ancestor (LCA) of a Binary Search Tree is the node that is the common ancestor of two given nodes.
The LCA of a Binary Search Tree can be found by comparing the values of the two nodes with the current node's value and traversing left or right accordingly.
If one node's value is less than the current node's value and the other node's value is greater, then the current node is the LCA.
If both nodes are l...
I applied via Recruitment Consulltant and was interviewed before Mar 2023. There was 1 interview round.
Standard leetcode problems - stacks,queues etc
based on 3 interviews
Interview experience
based on 13 reviews
Rating in categories
Territory Sales Manager
146
salaries
| ₹2.2 L/yr - ₹5.5 L/yr |
Software Engineer
102
salaries
| ₹4.3 L/yr - ₹16.5 L/yr |
Area Sales Manager
58
salaries
| ₹3.7 L/yr - ₹7 L/yr |
Assistant Manager
44
salaries
| ₹2.5 L/yr - ₹7 L/yr |
Software Developer
33
salaries
| ₹5.8 L/yr - ₹13 L/yr |
Paytm
PhonePe
Mobikwik
Payed