Explain the concepts of Automation Frameworks with a focus on Cucumber and JUnit. Provide an overview of their functionalities and how they can be used together for effective testing. Include examples of how to set up and use these tools to automate test scenarios.
Please sign-in to view the solution
Write a function in Python and Java to find the union of two strings. The union of two strings includes all unique characters present in either of the strings.
Please sign-in to view the solution
Write a Java method using Selenium WebDriver to automate a test case for logging into a website. The method should navigate to the given URL, input a username and password, and assert that login was successful. Assume the login page has input fields with IDs 'username' and 'password', and a login button with ID 'loginButton'.
Please sign-in to view the solution
As a software engineer at Oracle, explain the concept of multithreading in Java and its advantages. Provide an example that demonstrates creating and running multiple threads in Java. Additionally, explain how synchronization is used to handle thread safety.
Please sign-in to view the solution
Write a Java program to check if a given string is a palindrome. A palindrome is a word, number, phrase, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).
Please sign-in to view the solution
- How would you test the search form on Amazon?
- Write a simple program in Java to get the second greatest number in an array.
Please sign-in to view the solution
Write a function in any language that will print "AN" if a number is divisible by 8, "ANIM" if divisible by 16, and "ANIMAL" if divisible by 32.
Please sign-in to view the solution
Write a class representation of a deck of cards (52 cards) in Python and Java that includes shuffle and deal methods.
Please sign-in to view the solution
Write a function to reverse a linked list in groups of K (any number) in Python and Java.
Please sign-in to view the solution
As a software engineer at Oracle, you need to demonstrate your understanding of core Java SE features. Explain the concept of Java SE's Garbage Collection mechanism. Provide an example code snippet that shows how you can suggest garbage collection in Java and explain how the garbage collector works.
Please sign-in to view the solution
As a software engineer at Oracle, explain the concept of thread safety in Java. Describe various techniques to ensure thread safety in Java applications. Provide an example that demonstrates how to use synchronized blocks and java.util.concurrent package to handle thread safety.
Please sign-in to view the solution
Explain the purpose and usage of the static keyword in Java. Provide examples of how it is used in the context of a class and its members. Discuss its impact on memory allocation and access control.
Please sign-in to view the solution
Describe the differences between List, Set, and Map in Java Collections. Provide examples of common implementations for each type and explain when you would use them.
Please sign-in to view the solution
Given a string in a character array, write a function in Java to remove subsequent duplicate characters until we get a unique set of characters.
Example:
- Input:
apple
- Expected Output:
ale
- Expected Output:
- Input:
appapple
- Expected Output:
le
- Expected Output:
The input will be in the form of a character array.
Function Signature:
char[] removeDupes(char[] inputString);
Please sign-in to view the solution
What is binary search?
Please sign-in to view the solution
What is a Binary Search Tree? What is a Doubly Circular Linked List?
Please sign-in to view the solution
Write a function in Python and Java to check if parentheses are closed correctly in a given string. The function should support different types of parentheses: ()
, {}
, and []
.
Please sign-in to view the solution
You are building a web application and need to select all HTML elements that have a specific data attribute using jQuery. Specifically, select all elements with the data attribute data-status
equal to active
and apply a CSS class highlight
to them.
Please sign-in to view the solution
Describe the difference between JDK (Java Development Kit) and JRE (Java Runtime Environment). Provide a brief explanation of each and explain when you would use one over the other.
Please sign-in to view the solution
Given an array with numbers from 1 to 5, write a function in Python to subtract one number from each index.
Please sign-in to view the solution
As a software engineer at Oracle, demonstrate your understanding of logical programming and algorithms. Provide examples in Java for the following:
- A program to check if a string is a palindrome.
- A sorting algorithm (such as Bubble Sort) with an explanation.
- Basics of Java language concepts, such as loops and conditionals, with a simple example.
Please sign-in to view the solution
Explain two ways to create and start threads in Java. Provide a brief explanation and example code for each method.
Please sign-in to view the solution
Explain how exceptions are handled in Java. Provide a brief explanation of the different types of exceptions and include example code demonstrating the use of try
, catch
, and finally
blocks.
Please sign-in to view the solution
Explain the core Object-Oriented Programming (OOP) methods. Provide definitions and examples for each of the primary methods: encapsulation, inheritance, polymorphism, and abstraction.
Please sign-in to view the solution