0% found this document useful (0 votes)
6 views3 pages

Java Selenium & Appium Interview Guide

The document provides Java programming interview preparation material focusing on key algorithms and data structures, including string reversal, finding duplicates, and identifying the largest numbers. It also covers essential concepts in Selenium, Appium, and CI/CD practices with Jenkins, emphasizing automation strategies for web and OTT TV testing. Additionally, it outlines testing concepts and methodologies relevant for candidates with 3.5 years of experience in the field.

Uploaded by

basavarajkarki90
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Java Selenium & Appium Interview Guide

The document provides Java programming interview preparation material focusing on key algorithms and data structures, including string reversal, finding duplicates, and identifying the largest numbers. It also covers essential concepts in Selenium, Appium, and CI/CD practices with Jenkins, emphasizing automation strategies for web and OTT TV testing. Additionally, it outlines testing concepts and methodologies relevant for candidates with 3.5 years of experience in the field.

Uploaded by

basavarajkarki90
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Selenium, Appium & OTT TV Testing Interview Prep (3.

5 Years Experience)

1️⃣ Java Programs for Interviews

a) Reverse a String (recursion)

public class ReverseString {


public static void main(String[] args) {
String str = "Basu";
String reversed = reverse(str, [Link]() - 1);
[Link]("Reversed: " + reversed);
}

static String reverse(String str, int index) {


if(index < 0) return "";
return [Link](index) + reverse(str, index - 1);
}
}

b) Find duplicate characters in a string

import [Link].*;
public class DuplicateChars {
public static void main(String[] args) {
String str = "Programming";
str = [Link]();
Set<Character> seen = new HashSet<>();
Set<Character> duplicates = new HashSet<>();
for(char c : [Link]()) {
if(![Link](c)) [Link](c);
}
[Link]("Duplicates: " + duplicates);
}
}

c) First and Second Largest Numbers

public class LargestNumbers {


public static void main(String[] args) {
int[] arr = {10, 50, 20, 70, 40};
int first = Integer.MIN_VALUE;
int second = Integer.MIN_VALUE;

1
for(int num : arr) {
if(num > first) {
second = first;
first = num;
} else if(num > second && num != first) {
second = num;
}
}
[Link]("First Largest: " + first);
[Link]("Second Largest: " + second);
}
}

d) Character Type Check

public class CharCheck {


public static void main(String[] args) {
char ch = 'A';
if([Link](ch)) [Link](ch + " is a digit");
else if([Link](ch)) [Link](ch + " is a letter");
else [Link](ch + " is a special character");
}
}

e) Remove Duplicates from Array

import [Link].*;
public class RemoveDuplicates {
public static void main(String[] args) {
int[] arr = {1,2,2,3,4,4,5};
Set<Integer> set = new LinkedHashSet<>();
for(int num : arr) [Link](num);
[Link]("Unique elements: " + set);
}
}

2️⃣ Expanded Explanations

Java / Framework

• Dynamic XPath: contains() , starts-with() handle dynamic elements.


• Streams / Lambda: filtering WebElements using stream().filter() .
• Framework: POM + utility classes + TestNG + reporting for modular automation.

2
Selenium

• Synchronization: Explicit / Fluent Wait preferred.


• Multiple windows/tabs: store parent handle, switch, then switch back.
• Parallel execution: TestNG parallel / Selenium Grid.

CI/CD - Jenkins

• Parameterized build: pass environment/browser dynamically.


• Reports: archive Extent/Allure reports for team visibility.

Appium

• Gestures: TouchAction / W3C Actions API.


• Context Switching: Native <-> WebView in hybrid apps.
• Real device vs Emulator: ADB / Xcode connection.

OTT / Smart TV Testing

• Inspecting elements: Android TV (ADB/UIAutomator), Tizen (Tizen Studio), WebOS (DevTools).


• Video automation: validate play, pause, resume, buffering, ads.
• Challenges: device fragmentation, slow UI, locator instability.

Testing Concepts

• Smoke vs Sanity: Smoke for build, Sanity for features/bugs.


• Automation vs Manual: repetitive/high-priority automated; complex/manual left for exploratory.

Prepared for hands-on 3.5 years experience in Java, Selenium, Appium, Jenkins, Mobile & OTT TV automation.

Common questions

Powered by AI

The program iterates through the integer array, updating the first and second largest variables. If the current number is greater than the first largest number, it becomes the new first largest, and the previous first becomes the second largest. If the current number is more than the second largest but less than the first, it updates the second largest .

Selenium synchronization is crucial as it ensures that automated tests wait for elements to be in a ready state before interacting with them. Explicit and Fluent Wait are preferred as they allow setting conditions for waits precisely, thus reducing flaky tests and increasing test reliability by dynamically polling for conditions .

Smoke testing involves checking the most critical functions of the software build to ensure they work after a new build, often acting as a preliminary test. Sanity testing, however, focuses on validating specific functionalities and bug fixes to ensure they work correctly after minor changes, serving as a narrower and deeper test .

The Java program uses conditional statements to check if a character is a digit, letter, or a special character. This is done using the Character.isDigit and Character.isLetter methods. Depending on the method return, it prints whether the character is a digit, letter, or special character .

The Java program uses recursion to reverse a string. For each recursive call, it appends the character at the current index to the result of reversing the remaining string (by reducing the index). This ensures all characters are processed by progressing through the string from the last character to the first .

The Java program uses two sets: one to keep track of seen characters and another to store duplicate characters. As the string is iterated, each character is attempted to be added to the seen set, and if it is already present, it is added to the duplicate set, effectively identifying duplicates .

Parallel execution is critical in Selenium testing for increasing test coverage and reducing execution time by running multiple tests simultaneously. Tools like TestNG and Selenium Grid facilitate this process by allowing tests to run across different environments and configurations, enhancing efficiency and scalability .

The program uses a LinkedHashSet to retain only unique elements from the array while preserving their insertion order. As the array is iterated, elements are added to the set, thereby automatically handling duplicates as sets do not allow duplicate entries .

Dynamic XPath is used to identify elements that may have changing attributes or positions in web applications. Techniques like using contains() or starts-with() in XPath expressions can help to locate such elements by matching part of the attribute values, offering flexibility in element identification .

In mobile and OTT TV automation, context switching strategies are crucial for hybrid apps. Tools like Appium offer API functionalities to switch between native and web views, which is essential for testing hybrid applications that have both native and web components .

You might also like