Interview Experience at Harman Connected Services Bangalore

One of our friends went for an interview at Harman Connected Services Bangalore. He was 8 years of experience so the interviewer had asked the questions based upon his experience across different technologies such as Java, Selenium, Jenkins, Maven, Test NG, Oracle, Agile and so on. Thanks to him for sharing the questions with us.

Interview Experience at Harman Connected Services Bangalore

  • What is the difference between Collection and Collections? - The collection is an interface and Collections is a class. Collections class is used to sort and synchronize the collection elements whereas, Collection provides the functionality of data structure to List, Set and Queue.
  • What is the difference between Set and List? - The list is a type of ordered collection that maintains the elements in insertion order while Set is a type of unordered collection where elements are not maintained in any order. The list allows duplicates whereas Set doesn't allow any duplicate elements
  • How can you run a single test case using multiple data in parallel using TestNG? - By using DataProvider and Thread-count="n"parallel ="methods" where n is the number of times we want to run the test case. The parallel attribute can be set on tests, methods or classes based upon the user requirement. It has to be defined in testng.xml file. We can reduce the execution time using a parallel attribute as test cases are run simultaneously.   
  •  Write a program to print Floyd's triangle? - If you do not know what is Floyd's triangle it is the below series
                 1
                 2  3
                 4  5  6
Program to print Floyd's triangle

  • Write a program to remove duplicate elements from an array? - 
         

// simple java program to remove
// duplicates

class Main
{
// Function to remove duplicate elements
// This function returns new size of modified
// array.
static int removeDuplicates(int arr[], int n)
{
// Return, if array is empty
// or contains a single element
if (n==0 || n==1)
return n;

int[] temp = new int[n];

// Start traversing elements
int j = 0;
for (int i=0; i<n-1; i++)
// If current element is not equal
// to next element then store that
// current element
if (arr[i] != arr[i+1])
temp[j++] = arr[i];

// Store the last element as whether
// it is unique or repeated, it hasn't
// stored previously
temp[j++] = arr[n-1];

// Modify original array
for (int i=0; i<j; i++)
arr[i] = temp[i];

return j;
}

public static void main (String[] args)
{
int arr[] = {1, 2, 2, 3, 4, 4, 4, 5, 5};
int n = arr.length;

n = removeDuplicates(arr, n);

// Print updated array
for (int i=0; i<n; i++)
System.out.print(arr[i]+" ");
}
}

  • What is the Wrapper class in Java?  - Wrapper classes are used to convert primitive data types into Objects as shown in below image -
Wrapper class in Java


  • What is Alert in Selenium? - Alert is an interface that is used to handle window pop-ups. There are three main methods associated with Alert - accept, dismiss, getText using Driver().switchTo().alert()
  • How to Find Broken Links on a webpage? We have already covered this answer in another article.  Please click to find out how to find broken links on a webpage.
  • What is Sonarqube? - SonarQube is an open-source platform that is used to inspect the quality of the code. It analyzes the static code to find bugs, vulnerabilities.
  • Write an SQL query to find the second max and max salary of an employee?  - 
Consider the above table where the Names and salaries of the employees are listed.

Now to find out the name of the employee having the highest salary will be - 

Select name, max(salary) as salary  from employees;

To find out the second-highest salary we have to use the concept of nesting here as shown below -

select name, max(salary) as salary from employees where salary < (select max(salary)  from employee);
  • What are some of the GIT commands you know?
git config
git add
git status
git push
git pull
git commit
git checkout
git diff
git show
git log
git reset
git branch
git remote
git merge
git tag

  • What is the command to run Jenkins file from the terminal -Open the terminal window, go the directory where Jenkins file is kept and type java jar Jenkins.war command to run the Jenkins. - java -jar jenkins-cli.jar -s JENKINS_URL/ build JOB_NAME
  • What is the command to run Maven from the terminal - mvn exec:java -Dexec.mainClass =com.myProject
  • What is the difference between an Epic and a user story - Epic usually takes more than one iteration to complete, it may consists of more than 1 user story Whereas a user story takes 1 iteration to complete. A user story is a subset of Epic.

Those were some good questions asked in the interview experience. Please learn these concepts before appearing for an interview at Harman Connected Service Bangalore. Reach out to us if you want to share your interview experience.












Comments

Popular posts from this blog

Azure Tutorials Series - Azure Networking

Coforge Interview Questions | Automation Testing profile

Testing in CI/CD