Given a string containing both numbers and letters, write a Python function to extract and return the vowels, sorted in reverse alphabetical order. For example, given the string 'h3ll04a2bci27u8o1e', the expected output is 'uoiea'.
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
Consider the classic Egg Dropping problem where you need to determine the highest floor from which an egg can be dropped without breaking. Implement a solution using dynamic programming to find the minimum number of trials needed in the worst case for n
eggs and k
floors.
Additionally, suppose you have two candles, each of which burns for exactly one hour. How would you measure 45 minutes using these two candles? Explain your solution.
Please sign-in to view the solution
Write an SQL query to find the third highest salary from an Employee table. Additionally, write a query to find the count of employees in each department from the Employee and Department tables.
Assume the Employee table (Emp
) has columns: EmpID
, EmpName
, DeptID
, Salary
, and the Department table (Dept
) has columns: DeptID
, DeptName
.
Please sign-in to view the solution
How can you swap two INTEGER variables A and B without using a third temporary variable in C++? Provide the code and explain how it works.
Please sign-in to view the solution
As a Business Analyst at Oracle, you need to analyze a large volume of trace logs to identify and extract error patterns for system diagnostics. Describe the process, tools, and technologies you would utilize. Additionally, provide an example Python script to extract error patterns from a log file.
Please sign-in to view the solution
As a Data Analyst at Oracle, you're asked to optimize a SQL database for better performance. Describe the strategies you would implement to optimize the database and provide an example SQL query to identify slow-running queries along with an explanation.
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 XPath axes and functions. Provide an example of how you would use two different XPath axes and two XPath functions to query XML data. Include a brief explanation of each axis and function you use.
Please sign-in to view the solution
As a Quality Assurance Engineer at Oracle, you are tasked with designing a test automation framework using Object-Oriented Programming (OOP) principles. Explain how you would apply OOP concepts such as inheritance, polymorphism, encapsulation, and abstraction in building the framework. Provide a simple example in Python demonstrating these OOP principles in the context of test automation.
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
As a software engineer at Oracle, explain the concept of JSONPath and its usage. Provide an example demonstrating how to query JSON data using JSONPath expressions in Python. Include examples that show how to select specific elements, access array elements, and filter nodes.
Please sign-in to view the solution
As a software engineer at Oracle, explain the key concepts of Docker and its advantages. Provide a simple example demonstrating how to create a Dockerfile for a Python application, build a Docker image, and run a Docker container. Additionally, explain how to share your Docker image via Docker Hub.
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
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
You're provided with a database containing customer interaction data collected from a web application. Using SQL, extract the list of customers who have logged in more than 5 times in the past 30 days but have not made any purchases. Explain the steps and SQL query you would use to achieve this. Assume the database has the following tables:
logins
(fields:customer_id
,login_date
)purchases
(fields:customer_id
,purchase_date
,amount
)
Please sign-in to view the solution
In the context of a business analysis for a web application, you are given two data tables: logins
and purchases
. You are asked to find out the engagement level of customers who have interacted with the application. Write a SQL query to determine the list of customers who have logged in more than 5 times in the last 30 days and have made at least one purchase. Provide the steps and the final SQL query. The table structures are:
logins
(fields:customer_id
,login_date
)purchases
(fields:customer_id
,purchase_date
,amount
)
Please sign-in to view the solution
You need to write a SQL query to reverse the digits of a given integer. Assume the integer is stored in a table called numbers
with a single column value
. Provide an example integer and show how your query processes it to produce the reversed number.
Please sign-in to view the solution
You are given a table articles
containing a column content
which holds textual data. Write an SQL query to count the frequency of each word in the content
column across all rows. Explain the steps and the final SQL query to achieve this. Assume your SQL environment supports common table expressions (CTEs) and string functions.
Please sign-in to view the solution
In a multi-threaded environment, you have a log table thread_logs
with the columns thread_id
, start_time
, end_time
, and operation
. You need to analyze the performance of each thread by calculating the total time spent on operations by each thread. Write an SQL query to summarize the total processing time for each thread. Provide the steps and the final SQL query.
Please sign-in to view the solution
You are given a table employees
with columns employee_id
, name
, and department_id
. You also have a table departments
with columns department_id
and department_name
. Describe how you would leverage a HashMap (or equivalent data structure) approach to optimize querying the department name for each employee in an SQL environment. Provide the steps and the final SQL query.
Please sign-in to view the solution
You are given a table orders
with columns order_id
, customer_id
, and order_date
. Additionally, you have a table customers
with columns customer_id
, customer_name
, and customer_email
. Explain how you can use principles similar to a Hash Table to efficiently retrieve customer details for each order in an SQL database. Provide the steps and the final SQL query.
Please sign-in to view the solution
You need to write an SQL query that identifies whether a given integer in a table is a prime number. Assume the table numbers
has a single column value
containing positive integers. Write a query to determine if each number is prime and return the value
along with a is_prime
flag. Provide the steps and the final SQL query.
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
Explain the fundamentals of automation testing. Discuss the advantages and disadvantages of using automation testing over manual testing. Provide examples of popular automation testing tools and their use cases.
Please sign-in to view the solution