Arcesium
Manu Electricals Interview Questions and Answers
Q1. There's a string s1,s2 and s3. s1 and s2 are divided into n and m parts respectively. check if, after interleaving strings s1 and s2, we get s3 as one of the answers.
Check if after interleaving strings s1 and s2, we get s3 as one of the answers.
Create a recursive function to check all possible interleavings of s1 and s2
Check if the current interleaving matches s3
Return true if a valid interleaving is found, false otherwise
Q2. What's the time complexity of insertion in a hashmap?
Time complexity of insertion in a hashmap is O(1).
Insertion in a hashmap has a constant time complexity of O(1) on average.
This is because hashmaps use a hashing function to determine the index where the key-value pair should be stored.
Even in the worst-case scenario, where there are collisions, the time complexity is still O(1) due to techniques like chaining or open addressing.
Example: Inserting a key-value pair into a hashmap takes constant time regardless of the size of t...read more
Q3. Difference between cluster and non-cluster indexing. Do you know about database indexing?
Cluster indexing physically reorders the data on disk to match the index, while non-cluster indexing does not.
Cluster indexing physically reorders the data on disk to match the index structure, leading to faster retrieval of data.
Non-cluster indexing creates a separate data structure that points to the actual data, which may result in slower retrieval times.
Cluster indexing is typically used in primary keys, while non-cluster indexing is used for secondary indexes.
Examples of...read more
Q4. Difference between stack and heap memory.
Stack memory is used for static memory allocation and follows a Last In First Out (LIFO) structure, while heap memory is used for dynamic memory allocation and has a more flexible structure.
Stack memory is limited in size and is typically faster to access compared to heap memory.
Variables stored in stack memory have a fixed size determined at compile time, while variables in heap memory can have a size determined at runtime.
Stack memory is automatically managed by the system,...read more
Q5. What is a stable sort?
A stable sort is a sorting algorithm that preserves the relative order of equal elements in the sorted output.
Stable sorts are useful when the original order of equal elements needs to be maintained.
Examples of stable sorting algorithms include Merge Sort, Bubble Sort, and Insertion Sort.
In a stable sort, if two elements have the same key value, their relative order in the original array is preserved in the sorted array.
Q6. What is hashing?
Hashing is a process of converting input data into a fixed-size string of bytes using a hash function.
Hashing is used to securely store passwords by converting them into a hash value.
Hashing is used in data structures like hash tables to quickly retrieve data based on a key.
Common hash functions include MD5, SHA-1, and SHA-256.
Q7. Trapping Rain Water problem.
Trapping Rain Water problem involves calculating the amount of water that can be trapped between buildings given their heights.
Calculate the maximum height of buildings to the left and right of each building
Find the minimum of the two heights
Subtract the height of the current building to get the amount of water that can be trapped at that building
Interview Process at Manu Electricals
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month