Trellix
10+ Trellix Interview Questions and Answers
Q1. find middle element in linked list
Traverse the linked list with two pointers, one moving twice as fast as the other.
Initialize two pointers, slow and fast, at the head of the linked list.
Move slow pointer by one node and fast pointer by two nodes until fast pointer reaches the end.
The node pointed to by slow pointer at this point is the middle element.
Q2. insert and delete in linked list
Inserting and deleting nodes in a linked list involves updating pointers to maintain the list's structure.
To insert a node, update the next pointer of the new node to point to the current node's next, then update the current node's next pointer to the new node.
To delete a node, update the next pointer of the previous node to skip over the node to be deleted, then free the memory of the deleted node.
Q3. reverse a n digit number
Reverse a n digit number
Convert the number to a string to easily reverse it
Iterate through the string in reverse order and append each character to a new string
Convert the reversed string back to a number
Q4. linked list implementation
Linked list is a data structure where each element points to the next element in the sequence.
Nodes contain data and a reference to the next node
Insertion and deletion can be done efficiently
Traversal starts from the head node
Q5. Find middle element of a linked list?
To find the middle element of a linked list, use the slow and fast pointer approach.
Initialize two pointers, slow and fast, both pointing to the head of the linked list.
Move the slow pointer by one step and the fast pointer by two steps until the fast pointer reaches the end of the list.
The element pointed to by the slow pointer at this point will be the middle element of the linked list.
Q6. Implement binary search tree?
Binary search tree is a data structure where each node has at most two children, with left child less than parent and right child greater.
Create a Node class with data, left child, and right child attributes.
Implement insert method to add nodes in correct position based on value.
Implement search method to find a specific value in the tree.
Implement delete method to remove a node from the tree while maintaining the binary search tree property.
Q7. Write singleton design pattern Find vowels from a string and its indexes
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Create a private static instance of the class
Provide a public static method to access the instance
Ensure the constructor is private to prevent instantiation
Q8. Details about linux a nd its working
Linux is an open-source operating system kernel that serves as the foundation for various Linux distributions.
Linux is a Unix-like operating system kernel developed by Linus Torvalds in 1991.
It is open-source, meaning its source code is freely available for anyone to modify and distribute.
Linux distributions, such as Ubuntu, Fedora, and CentOS, package the Linux kernel with additional software to create a complete operating system.
Linux uses a monolithic kernel architecture, ...read more
Q9. describe problem facing in project
One problem facing in the project is inefficient database queries slowing down application performance.
Database indexes may need to be optimized
Queries may need to be rewritten to be more efficient
Consider caching frequently accessed data
Q10. Explain the different types of testing done
Different types of testing include unit testing, integration testing, system testing, and acceptance testing.
Unit testing: Testing individual components or modules of the software.
Integration testing: Testing how different components work together.
System testing: Testing the entire system as a whole.
Acceptance testing: Testing to ensure the software meets the requirements of the end users.
Q11. Progrsm for python to remove dublicate
Program in Python to remove duplicates from an array of strings.
Use a set to store unique elements
Iterate through the array and add each element to the set
Convert the set back to a list to remove duplicates
Q12. Explain Scrum process
Scrum is an agile framework for managing work on complex projects.
Scrum involves breaking down work into small, manageable tasks called user stories.
It includes sprint planning, daily stand-up meetings, sprint review, and sprint retrospective.
Scrum teams are self-organizing and cross-functional.
The product owner prioritizes the backlog, and the Scrum Master facilitates the process.
Scrum emphasizes iterative development and continuous feedback.
Q13. Program for regex
Program for regex
Use regex to search for patterns in strings
Regex can be used for validation, searching, and replacing text
Examples: /hello/ matches 'hello', /[0-9]+/ matches any number