Filter interviews by
B.tech
I appeared for an interview in May 2017.
String is immutable because it ensures data integrity and allows for efficient memory management.
Immutable strings prevent accidental modification of data.
Immutable strings can be easily shared and reused, improving memory efficiency.
Immutable strings enable efficient string interning and caching.
Immutable strings support thread safety in concurrent environments.
Yes, @RequestParam has a default value if not specified.
If a @RequestParam is not provided in the request, it will use its default value.
The default value can be set using the 'defaultValue' attribute of @RequestParam annotation.
If no default value is specified, the parameter will be considered as required and an exception will be thrown if not provided.
Abstract classes are required to provide a common interface and share code among related classes.
Abstract classes allow for code reusability and promote modular design.
They provide a common interface for a group of related classes.
Abstract classes can define abstract methods that must be implemented by subclasses.
They can also provide default implementations for common methods.
Abstract classes cannot be instantiated, b
I appeared for an interview in Nov 2020.
Round duration - 40 minutes
Round difficulty - Medium
It was conducted on hackkerank. MCQs cover various topics including -Data Structures, Aptitude, etc
You are given a binary tree. Your task is to return the count of the diagonal paths to the leaf of the given binary tree such that all the values of the nodes on the diagonal are equa...
Count the number of diagonal paths in a binary tree where all nodes on the diagonal have equal values.
Traverse the binary tree in a diagonal manner and keep track of nodes with equal values.
Use recursion to explore all possible diagonal paths in the tree.
Count the number of paths where all nodes on the diagonal have the same value.
Round duration - 20 minutes
Round difficulty - Medium
This round was conducted on skype. Questions were mainly personality based rather knowledge.
Tip 1 : Practice as much as you can
Tip 2 : Be aware of the methodologies used in your project
Tip 1 : It should be in proper format
Tip 2 : Do not put false things on resume.
I appeared for an interview before Jan 2021.
Round duration - 120 Minutes
Round difficulty - Medium
The round had 2 coding problems to solve with varying difficulty. Each candidate had a different set of questions. The round was around 2 pm. The webcam was turned on to keep an eye on candidates.
Given an array ARR
of size N
, where each element represents the height of a balloon. The task is to destroy all balloons by shooting arrows from left to right. When an arrow hits...
Find the minimum number of arrows needed to burst all balloons by shooting arrows from left to right.
Sort the array in non-decreasing order to make it easier to calculate the minimum number of arrows needed.
Iterate through the sorted array and count the number of times the height decreases compared to the previous balloon.
The count of decreases + 1 will give the minimum number of arrows needed to burst all balloons.
Exa...
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 check if both left and right children are NULL to identify leaf nodes.
Use recursion to traverse the tree efficiently.
Keep track of the count of leaf nodes as you traverse the tree.
Handle base cases where the current node is NULL or a leaf node.
Round duration - 60 Minutes
Round difficulty - Medium
This round had 2 questions related to DSA. I was first asked to explain my approach with proper complexity analysis and then code the soution in any IDE that I prefer.
Given a rod of a certain length, the rod can be divided into different sizes, each with an associated cost. Your task is to determine the maximum cost that can be obtained by...
The Rod Cutting Problem involves maximizing the profit obtained by cutting a rod into smaller pieces and selling them.
Use dynamic programming to solve this problem efficiently.
Create a table to store the maximum profit for each sub-length of the rod.
Iterate through the rod lengths and update the table with the maximum profit.
The final answer will be the maximum profit for the total length of the rod.
You are given an array of integers ARR
and an integer X
. Your task is to determine the number of subarrays of ARR
whose bitwise XOR is equal to X
.
Count the number of subarrays in an array whose XOR is equal to a given value.
Iterate through the array and keep track of XOR values and their frequencies using a hashmap.
For each element in the array, calculate the XOR with the current element and check if the required XOR value exists in the hashmap.
Increment the count of subarrays whenever the required XOR value is found in the hashmap.
Round duration - 60 Minutes
Round difficulty - Medium
This round had 2 questions of DSA of Easy-Medium difficulty and at the end I was asked a Puzzle to check my general problem solving ability.
You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:
Find the minimum time required to rot all fresh oranges in a grid.
Use Breadth First Search (BFS) to simulate the rotting process of oranges.
Keep track of the time taken to rot all oranges and the count of fresh oranges remaining.
If all fresh oranges are not rotten after simulation, return -1.
Handle edge cases like empty grid or no fresh oranges present.
Example: For the given grid, the minimum time required is 4 seconds
For a given singly linked list, identify if a loop exists and remove it, adjusting the linked list in place. Return the modified linked list.
A...
Detect and remove loop in a singly linked list in place with O(n) time complexity and O(1) space complexity.
Use Floyd's Cycle Detection Algorithm to identify the loop in the linked list.
Once the loop is detected, use two pointers approach to find the start of the loop.
Adjust the pointers to remove the loop and return the modified linked list.
Example: For input 5 2 and 1 2 3 4 5, return 1 2 3 4 5 without the loop.
Round duration - 50 Minutes
Round difficulty - Medium
This round had 2 Algorithmic questions wherein I was supposed to code both the problems after discussing their
approaches and respective time and space complexities . After that , I was grilled on some OOPS concepts related to C++.
You are provided with a string STR
of length N. The task is to find the longest palindromic substring within STR
. If there are several palindromic substring...
Given a string, find the longest palindromic substring within it.
Iterate through the string and expand around each character to find palindromes
Keep track of the longest palindrome found so far
Return the longest palindromic substring
You are provided with an array of integers. The task is to sort the array in ascending order using the quick sort algorithm.
Quick sort is a divide-and-conquer algorithm. It ...
Yes, the quick sort algorithm can be enhanced to achieve NlogN complexity in the worst case by using a randomized version of the algorithm.
Randomized quick sort involves randomly selecting the pivot element to reduce the chances of worst-case scenarios.
By choosing a random pivot, the algorithm becomes less predictable and more likely to achieve the desired time complexity.
This enhancement helps in avoiding the worst-ca...
Friend functions in C++ are functions that are not members of a class but have access to its private and protected members.
Friend functions are declared inside a class with the keyword 'friend'.
They can access private and protected members of the class.
They are not member functions of the class, but have the same access rights as member functions.
Friend functions are useful for implementing operators that are not part ...
Early binding is resolved at compile time while late binding is resolved at runtime in C++.
Early binding is also known as static binding, where the function call is resolved at compile time based on the type of the object.
Late binding is also known as dynamic binding, where the function call is resolved at runtime based on the actual type of the object.
Early binding is faster as the function call is directly linked to ...
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Aptitude test as usual
I applied via Approached by Company and was interviewed in Oct 2022. There were 2 interview rounds.
Method for deleting a node from a Linked List
Find the node to be deleted
Update the previous node's next pointer to skip the deleted node
Free the memory occupied by the deleted node
No, it is not possible in Java due to circular inheritance.
Circular inheritance is not allowed in Java.
It creates an infinite loop and leads to compile-time errors.
To avoid this, inheritance hierarchy should be designed carefully.
Example: Class A extends B, B extends C, and C extends D.
This creates a linear inheritance hierarchy and is allowed in Java.
Creating a custom immutable class in Java
Make the class final
Make all fields private and final
Do not provide any setter methods
Provide a constructor to initialize all fields
Override equals() and hashCode() methods
Prevent modification of mutable objects passed in constructor
Code to check if two strings are anagrams of each other.
Create two character arrays from the strings
Sort the arrays
Compare the sorted arrays
Time complexity of linked list operations is O(n) for traversal, insertion and deletion.
Traversal, insertion and deletion in linked lists take linear time.
Insertion and deletion at the beginning of the list is faster than at the end.
Doubly linked lists have slightly higher time complexity due to maintaining two pointers.
I applied via Approached by Company and was interviewed before Aug 2021. There were 3 interview rounds.
C++ & C Based Questions Mostly from Arrays, Linked List, Queues
To reverse a string, iterate through the string and append each character to a new string in reverse order.
Create an empty string to store the reversed string
Iterate through the original string from the end to the beginning
Append each character to the new string
Return the new string
I applied via Approached by Company and was interviewed before May 2023. There were 2 interview rounds.
OOD (Object-Oriented Design) is essential for creating modular, reusable, and maintainable software systems.
OOD helps in organizing code into manageable components
Encourages code reusability through inheritance and polymorphism
Facilitates easier maintenance and updates
Promotes scalability and flexibility in software development
Enables better collaboration among team members
using namespace std; is a directive in C++ that allows the programmer to use all elements of the standard C++ library without specifying the std:: prefix.
It is used to avoid having to write std:: before standard library elements.
It should be used with caution as it can lead to naming conflicts.
Example: cout << 'Hello, World!'; instead of std::cout << 'Hello, World!';
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Animal class with methods like eat() can be inherited by classes like Dog and Cat, which can override
A sorting algorithm is a method used to arrange elements in a specific order.
Common sorting algorithms include Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort.
Bubble Sort compares adjacent elements and swaps them if they are in the wrong order.
Merge Sort divides the array into two halves, sorts them separately, and then merges them back together.
Quick Sort picks a pivot element and pa...
I applied via Approached by Company and was interviewed in Mar 2024. There were 2 interview rounds.
Service Engineer
105
salaries
| ₹1.5 L/yr - ₹4.2 L/yr |
Technical Support Engineer
66
salaries
| ₹2 L/yr - ₹4 L/yr |
Surveillance Officer
41
salaries
| ₹1.8 L/yr - ₹3.5 L/yr |
MIS Executive
30
salaries
| ₹1.7 L/yr - ₹3.5 L/yr |
Cctv Engineer
30
salaries
| ₹1.8 L/yr - ₹4.5 L/yr |
Samsung
OPPO
LG Electronics
HARMAN