Filter interviews by
I applied via Naukri.com and was interviewed before Jan 2020. There were 4 interview rounds.
Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods. Interface is a blueprint for a class and can only have abstract methods.
Abstract class can have constructors while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
Abstract class can have instance variables while interface cannot
Abstract class is used for code r...
Multiple credentials can be logged in using data from an excel sheet.
Read the excel sheet using a library like Apache POI
Iterate through the rows and columns to get the data
Use a loop to login with each set of credentials
Assert the login success or failure for each set of credentials
Top trending discussions
I applied via Referral and was interviewed in Sep 2023. There was 1 interview round.
Data Structures and Algorithms
Data Structures and Algorithms
Find an odd occurring number among even occurring numbers.
Use XOR operation to cancel out even occurring numbers and get the odd occurring number.
Iterate through the array and XOR each element with the result variable.
The final result will be the odd occurring number.
Print the spiral order of a binary tree and matrix.
For binary tree, use level order traversal and alternate direction for each level.
For matrix, use four pointers to traverse in spiral order.
Example for binary tree: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9
Example for matrix: 1 2 3 4 -> 8 7 6 5 -> 9 10 11 12 -> 16 15 14 13
Finding pairs in an array with a given sum.
Iterate through the array and for each element, check if the difference between the given sum and the element exists in the array.
Use a hash table to store the elements of the array and their indices for faster lookup.
If there are multiple pairs with the same sum, return any one of them.
If no pair is found, return null or an empty array.
Find total number of k element with given avg in an array in minimum time complexity.
Use sliding window technique to traverse the array in O(n) time complexity.
Maintain a sum variable to keep track of the sum of elements in the window.
If the sum of elements in the window is equal to k times the given avg, increment the count.
Move the window by subtracting the first element and adding the next element in the array.
Printing non-boundary elements of a binary tree
Traverse the tree in any order (preorder, inorder, postorder)
Check if the current node is not a boundary node (not the first or last node in its level)
If it is not a boundary node, print its value
Recursively traverse its left and right subtrees
I was interviewed in Dec 2016.
posted on 21 Aug 2016
I applied via Campus Placement
To test if every left child's value is less than the right child's value in a binary tree.
Traverse the binary tree using any traversal algorithm (e.g., in-order, pre-order, post-order)
Compare the value of each left child with its right child
If any left child's value is greater than or equal to its right child's value, return false
If all left child's values are less than their right child's values, return true
Cloning a linked list-like structure
Create a new node for each node in the original linked list
Set the value of the new node to the value of the corresponding node in the original linked list
Set the next pointer of the new node to the new node corresponding to the next node in the original linked list
Repeat the above steps until all nodes in the original linked list are cloned
To find the nth character in a stream of bytes, we need to read the stream byte by byte until we reach the nth position.
Start reading the stream byte by byte until you reach the nth position
Return the byte at the nth position
If the stream ends before reaching the nth position, return null or throw an exception
Rearrange a string to avoid consecutive same characters.
Iterate through the string and keep track of the previous character.
If the current character is the same as the previous, swap it with the next different character.
Repeat until no consecutive same characters are left.
The task is to find the next highest palindrome number given a number.
Convert the given number to a string
Check if the number is already a palindrome
If not, increment the number by 1 and check if it is a palindrome
Repeat the previous step until a palindrome is found
Canonicalizing a directory path involves simplifying and standardizing the path to remove any redundant or unnecessary elements.
Remove any consecutive slashes and replace them with a single slash
Remove any trailing slashes
Resolve any relative paths (e.g., '..' and '.')
Handle special cases like the root directory ('/')
Normalize the path by removing any unnecessary elements
posted on 21 Aug 2016
I applied via Campus Placement
Content Analyst
43
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
27
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer
23
salaries
| ₹0 L/yr - ₹0 L/yr |
QA Engineer
16
salaries
| ₹0 L/yr - ₹0 L/yr |
Analyst
7
salaries
| ₹0 L/yr - ₹0 L/yr |
Bloomberg
FactSet
S&P Global
Morningstar