Virtusa Consulting Services
B Ravi Teja Interview Questions and Answers
Q1. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Q2. Find the Third Greatest Element
Given an array 'ARR' of 'N' distinct integers, determine the third largest element in the array.
Input:
The first line contains a single integer 'T' representing the number of te...read more
Find the third largest element in an array of distinct integers.
Sort the array in descending order and return the element at index 2.
Handle cases where the array has less than 3 elements separately.
Consider edge cases like negative numbers and duplicates.
Q3. Anagram Pairs Verification Problem
Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more
Determine if two strings are anagrams of each other by checking if they contain the same characters.
Create character frequency maps for both strings
Compare the frequency of characters in both maps to check if they are anagrams
Return True if the frequencies match, False otherwise
Q4. Queue Using Stacks Implementation
Design a queue data structure following the FIFO (First In First Out) principle using only stack instances.
Explanation:
Your task is to complete predefined functions to suppor...read more
Implement a queue using stacks following FIFO principle.
Use two stacks to simulate a queue - one for enqueue and one for dequeue operations.
For enQueue operation, push elements onto the enqueue stack.
For deQueue operation, if the dequeue stack is empty, pop all elements from enqueue stack to dequeue stack.
For peek operation, return the top element of the dequeue stack.
For isEmpty operation, check if both stacks are empty.
Example: enQueue(5), enQueue(10), peek() -> 5, deQueue(...read more
Q5. Minimum Number of Swaps to Sort an Array
Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.
Input:
T (number of test cases)
For each test case:
N (size of the...read more
The minimum number of swaps required to sort a given array of distinct elements in ascending order.
Use a hashmap to store the original indices of the elements in the array.
Iterate through the array and swap elements to their correct positions.
Count the number of swaps needed to sort the array.
Account Statements Transcription is a full stack application for converting Excel sheets to SQL tables, fetching data in UI, and allowing downloads in various formats.
Create a front-end interface for users to upload Excel sheets
Develop a back-end system to convert Excel data into SQL tables
Implement a query system to fetch data based on user needs in the UI
Provide options for users to download data in Excel or Word formats
Prisoners must devise a strategy to guess the color of their own hat based on the hats of others.
Prisoners can agree on a strategy before the hats are assigned.
One strategy is for each prisoner to count the number of hats of a certain color and use that information to guess their own hat color.
Another strategy involves using parity to determine the color of their own hat.
Prisoners can also use a signaling system to convey information about their hat color to others.
More about working at Virtusa Consulting Services
Interview Process at B Ravi Teja
Top Full Stack Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month