NCR Voyix
Mavens i Interview Questions and Answers
Q1. What is the difference between abstract and interface
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
Abstract class can have constructors, fields, and methods, while interface can only have constants and method signatures.
A class can extend only one abstract class, but can implement multiple interfaces.
Abstract classes are used to define a common behavior for subclasses, while interfaces are used to define a contract for classes to implement.
Example: Abstract class ...read more
Q2. Delete the node in a linked list with given pointer
To delete a node in a linked list with a given pointer, update the node's value and next pointer to the next node's value and next pointer.
Set the value of the node to the value of the next node
Set the next pointer of the node to the next node's next pointer
Q3. One coding problem in go lang
Implement a function to reverse a string in Go lang
Create a function that takes a string as input
Convert the string into a slice of bytes for easier manipulation
Use a loop to iterate through the slice and reverse the order of characters
Convert the reversed slice back into a string and return it
Q4. reverse a linked list
Reverse a linked list by changing the pointers direction
Iterate through the linked list and change the direction of pointers
Use three pointers - prev, current, next to reverse the list
Update the head of the linked list to the last node after reversing
Q5. fibbonaci series print
Print the Fibonacci series
Use a loop to generate Fibonacci numbers
Start with 0 and 1, then add the previous two numbers to get the next number
Repeat this process until reaching the desired length of the series
Q6. Loop in a linked list
Loop in a linked list refers to a situation where a node in the list points to a previous node, creating a cycle.
Check for a loop using Floyd's cycle detection algorithm
Use two pointers, one moving at twice the speed of the other
If the two pointers meet at some point, there is a loop
Interview Process at Mavens i
Reviews
Interviews
Salaries
Users/Month