1.
Search in Rotated Sorted Array
There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], …, nums[n-1], nums[0], nums[1], …, nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].
Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums. You must write an algorithm with O(log n) runtime complexity.
Example 1: Input: nums = [4,5,6,7,0,1,2], target = 0Output: 4
Example 2: Input: nums = [4,5,6,7,0,1,2], target = 3Output: -1
Example 3: Input: nums = [1], target = 0Output: -1
3.
Given the following array of integers in Java:
After applying the sorting algorithm Arrays.sort(numbers);, what will be the content of the numbers array?
{8, 5, 4, 3, 1}
{1, 3, 4, 5, 8}
{1, 4, 3, 5, 8}
{3, 1, 4, 5, 8}
None
4.
The SET clause is used in which of the following SQL statements?
5.
What result will the following code show?
6.
What will be the output of the following pseudocode?
7.
Which SOLID principle is this code violating?
8.
Suppose you have a functional interface called Calculator with a single abstract method called performOperation, which takes two numbers and returns a result. Below is the interface:
Now, consider the following MathOperations class that implements the Calculator interface: Now, how could you use the MathOperations interface Options: Calculator and class to calculate the multiplication of 3.5 and 2.0?
9.
What is the correct definition of an abstract class?
10.
What is the correct definition of table in database?
11.
It is a generic template for a set of objects with similar characteristics.
12.
It is considered as the main field of a table in the database:
13.
What does the INSERT statement do?
14.
Which of the following series will be printed by the given pseudocode?
15.
Find First and Last Position of Element in Sorted Array
Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. Example 1: Input: nums = [5,7,7,8,8,10], target = 8 Output: [3,4]
Example 2: Input: nums = [5,7,7,8,8,10], target = 6 Output: [-1,-1]
Example 3: Input: nums = [], target = 0 Output: [-1,-1]
17.
What result will the following code show?
18.
What Design Patterns category is Abstract Factory in?
19.
Which of the following series will be printed by the given pseudocode?
20.
Within a set of objects there are different forms and ways of doing things: