i
HCLTech
Filter interviews by
Sort input array of strings in descending order without using inbuilt functions
Iterate through the array and compare each element with the rest to find the largest element
Swap the largest element with the first element, then repeat the process for the remaining elements
Continue this process until the array is sorted in descending order
String is immutable, while StringBuilder is mutable and more efficient for concatenating strings.
String is immutable, meaning its value cannot be changed once it is created.
StringBuilder is mutable, allowing for modifications to the string without creating a new object.
StringBuilder is more efficient for concatenating multiple strings as it does not create new objects each time.
Example: String str = "Hello"; Strin...
The output of the code will be 'animal is created' followed by 'Dog is created'.
The code defines a class Animal with a constructor that prints 'animal is created'.
It also defines a class Dog that extends Animal, with a constructor that prints 'Dog is created'.
In the main method, an instance of Dog is created, which will trigger the constructors of both Animal and Dog classes.
The code creates a StringBuffer object with 'Hello' and appends 'There' to it before printing the final string.
StringBuffer is mutable, so the original 'Hello' string can be modified
The append() method adds the specified string to the end of the buffer
The final output will be 'HelloThere'
What people are saying about HCLTech
findElement returns the first matching element on the page, while findElements returns a list of all matching elements.
findElement returns a single WebElement matching the locator provided
findElements returns a list of WebElements matching the locator provided
findElement will throw NoSuchElementException if no element is found, while findElements will return an empty list
getwindowhandle returns the handle of the current window, getwindowhandles() returns handles of all open windows
getwindowhandle returns a single window handle, while getwindowhandles() returns a set of window handles
getwindowhandle is used to switch between windows in Selenium WebDriver
Output type of getwindowhandle is String, while output type of getwindowhandles() is Set<String>
Java programs utilize OOP concepts like inheritance, encapsulation, polymorphism, and abstraction for modular and reusable code.
Encapsulation: Use private variables and public methods. Example: class Employee { private String name; public String getName() { return name; }}
Inheritance: Create a subclass that inherits from a superclass. Example: class Manager extends Employee {}
Polymorphism: Use method overriding. E...
The combined characters in the given testing example 'Testing Testing Testing' is 'te'.
Iterate through the text and check for consecutive characters 'te'.
Combine the characters 'te' whenever they are found together.
Return the combined text 'te' as the result.
Find the 2nd largest number in the given array
Sort the array in descending order
Get the element at index 1, which will be the 2nd largest number
Option a is valid, option b is valid, option c is invalid.
Option a is valid because ChromeDriver is a subclass of WebDriver, so it can be assigned to a WebDriver reference.
Option b is valid because ChromeDriver is a subclass of WebDriver, so it can be instantiated using a WebDriver reference.
Option c is invalid because WebDriver is an interface and cannot be instantiated directly. It can only be used as a referenc...
I applied via Naukri.com and was interviewed in Sep 2024. There was 1 interview round.
The output of the code will be 'animal is created' followed by 'Dog is created'.
The code defines a class Animal with a constructor that prints 'animal is created'.
It also defines a class Dog that extends Animal, with a constructor that prints 'Dog is created'.
In the main method, an instance of Dog is created, which will trigger the constructors of both Animal and Dog classes.
The output combines integers and strings, resulting in a concatenated string due to Java's type handling.
Java evaluates expressions from left to right.
The first operation is 10 + 20, which equals 30 (an integer).
Next, '30' is concatenated with 'Hello', resulting in '30Hello'.
Then, '30Hello' is concatenated with 30, resulting in '30Hello30'.
Finally, '30Hello30' is concatenated with 40, resulting in '30Hello3040'.
The output will be 'HelloThere'
Concatenation of 'Hello' and 'There' results in 'HelloThere'
The final string is printed using System.out.println()
The code creates a StringBuffer object with 'Hello' and appends 'There' to it before printing the final string.
StringBuffer is mutable, so the original 'Hello' string can be modified
The append() method adds the specified string to the end of the buffer
The final output will be 'HelloThere'
Option a is valid, option b is valid, option c is invalid.
Option a is valid because ChromeDriver is a subclass of WebDriver, so it can be assigned to a WebDriver reference.
Option b is valid because ChromeDriver is a subclass of WebDriver, so it can be instantiated using a WebDriver reference.
Option c is invalid because WebDriver is an interface and cannot be instantiated directly. It can only be used as a reference typ...
Sort input array of strings in descending order without using inbuilt functions
Iterate through the array and compare each element with the rest to find the largest element
Swap the largest element with the first element, then repeat the process for the remaining elements
Continue this process until the array is sorted in descending order
findElement returns the first matching element on the page, while findElements returns a list of all matching elements.
findElement returns a single WebElement matching the locator provided
findElements returns a list of WebElements matching the locator provided
findElement will throw NoSuchElementException if no element is found, while findElements will return an empty list
getwindowhandle returns the handle of the current window, getwindowhandles() returns handles of all open windows
getwindowhandle returns a single window handle, while getwindowhandles() returns a set of window handles
getwindowhandle is used to switch between windows in Selenium WebDriver
Output type of getwindowhandle is String, while output type of getwindowhandles() is Set<String>
String is immutable, while StringBuilder is mutable and more efficient for concatenating strings.
String is immutable, meaning its value cannot be changed once it is created.
StringBuilder is mutable, allowing for modifications to the string without creating a new object.
StringBuilder is more efficient for concatenating multiple strings as it does not create new objects each time.
Example: String str = "Hello"; StringBuil...
I applied via Recruitment Consulltant and was interviewed in Apr 2024. There was 1 interview round.
Find the 2nd largest number in the given array
Sort the array in descending order
Get the element at index 1, which will be the 2nd largest number
The combined characters in the given testing example 'Testing Testing Testing' is 'te'.
Iterate through the text and check for consecutive characters 'te'.
Combine the characters 'te' whenever they are found together.
Return the combined text 'te' as the result.
Java programs utilize OOP concepts like inheritance, encapsulation, polymorphism, and abstraction for modular and reusable code.
Encapsulation: Use private variables and public methods. Example: class Employee { private String name; public String getName() { return name; }}
Inheritance: Create a subclass that inherits from a superclass. Example: class Manager extends Employee {}
Polymorphism: Use method overriding. Exampl...
I applied via Naukri.com and was interviewed before Jul 2021. There were 2 interview rounds.
I applied via Campus Placement and was interviewed before May 2020. There were 4 interview rounds.
I applied via Company Website and was interviewed in Dec 2020. There was 1 interview round.
I applied via Campus Placement and was interviewed before Nov 2021. There were 2 interview rounds.
Some of the top questions asked at the HCLTech Automation Engineer interview -
based on 4 interview experiences
Difficulty level
Duration
based on 9 reviews
Rating in categories
Software Engineer
25k
salaries
| ₹2.7 L/yr - ₹8.1 L/yr |
Technical Lead
23k
salaries
| ₹10.7 L/yr - ₹21 L/yr |
Senior Software Engineer
16.8k
salaries
| ₹5.4 L/yr - ₹15.7 L/yr |
Lead Engineer
16.4k
salaries
| ₹5.3 L/yr - ₹12.5 L/yr |
Analyst
15.9k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
TCS
Wipro
Accenture
Cognizant