Summary of "Can you ? Virtusa Important Coding Questions | Virtusa Online Assessment Test 2025 | Tekno UF"
Summary of the Video: "Can you ? Virtusa Important Coding Questions | Virtusa Online Assessment Test 2025 | Tekno UF"
Main Ideas and Concepts:
- The video is aimed at candidates preparing for Virtusa and Zoho online assessment tests and campus drives.
- The focus is on a common coding question frequently asked in recent Virtusa drives: Removing duplicates from an array.
- The presenter emphasizes understanding the gist of the problem despite lengthy and confusing question statements in exams.
- The key task is to remove duplicate elements from an array, keeping only one occurrence of each element.
Detailed Explanation of the Coding Problem:
- Problem Statement: Given an array, remove duplicate elements such that only one instance of each element remains.
- Example:
Input:
[1, 2, 2, 3, 4, 4, 5]Output:[1, 2, 3, 4, 5]Duplicate elements like the second '2' and '4' should be removed.
Methodology / Instructions to Solve the Problem:
Python Solution:
- Initialize an empty list to store unique elements.
- Iterate over each element in the input array.
- For each element, check if it is not already present in the unique elements list.
- If not present, append it to the unique elements list.
- After the loop ends, return the list of unique elements.
- Print the returned list.
Code Logic (in brief):
def remove_duplicates(array):
unique_elements = []
for num in array:
if num not in unique_elements:
unique_elements.append(num)
return unique_elements
# Example usage:
input_array = [1, 2, 2, 3, 4, 4, 5]
print(remove_duplicates(input_array)) # Output: [1, 2, 3, 4, 5]
Java Solution:
- Use a
List<Integer>to store unique elements. - Iterate over the input array.
- For each element, check if the list does not contain the element using the
contains()method. - If not contained, add the element using the
add()method. - Return the list after iteration.
- Print the returned list.
Code Logic (in brief):
import Java.util.ArrayList;
import Java.util.List;
public class RemoveDuplicates {
public static List<Integer> RemoveDuplicates(int[] array) {
List<Integer> uniqueElements = new ArrayList<>();
for (int num : array) {
if (!uniqueElements.contains(num)) {
uniqueElements.add(num);
}
}
return uniqueElements;
}
public static void main(String[] args) {
int[] input = {1, 2, 2, 3, 4, 4, 5};
System.out.println(RemoveDuplicates(input)); // Output: [1, 2, 3, 4, 5]
}
}
Additional Notes:
- The problem may appear lengthy or complex in the exam, but the core task is simple: remove duplicates.
- The presenter encourages viewers to try solving the problem themselves before watching the solution.
- Viewers are invited to share more efficient or alternative solutions in the comments.
- The presenter promotes a resource website (topmet.io/teonus) where viewers can purchase preparation materials for Virtusa, Zoho, and other MNCs at low prices.
- The video ends with a call to subscribe, like, and share the channel for more coding content.
Speakers / Sources Featured:
- Main Speaker: The channel host/presenter (unnamed) who explains the problem, demonstrates the solutions in Python and Java, and provides motivational advice and resource recommendations.
Category
Educational