1.
Given the following array of integers, sort it in ascending order using the insertion sort algorithm.
Input: arr = [56,89,45,34,90]
Output: [34,45,56,89,90]
2.
Given a string, returns the number of vowels in the string.
Input: s = ” Hello, how are you?”.
Output: 7
3.
What is the difference between a class and an object in OOP?
4.
Given the following array of integers return the first number that is greater than 10.
Input: arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Output: 11
5.
What type of SQL queries are used to interact with data stored in a database, allowing operations such as inserting, updating and deleting data in tables?
6.
Given the following array of integers sort them in descending order.
Input: arr = [10, 5, 2, 8, 7, 1, 9, 6, 3, 4]
Output: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
7.
What is the function of the constructor method in OOP?
8.
What is the SQL query to select all records in a table named "customers"?
9.
What is a relational database?
10.
Given a string, replace the x's by the y's.
Input: string = “abxbxc”.
Output: “abybyc”
11.
SQL clause used to filter the records in a table based on a specific condition.
12.
What is the difference between an abstract class and an interface in OOP?
13.
Given the following array returns the total number of indexes that are out of order.
Input: heights = [1,1,4,2,1,3].
Output: 3
Explanation: By sorting the array [1,1,1,1,2,3,4] we can verify that 3 positions are out of order, position 2,4 and 5.
14.
Given the following SOS string, certain letters are altered and do not give the SOS message, return the number of SOS letters that have been altered.
Input: s = “SOSSPSSQSSOR”.
Output: 3
Explanation: In some SOS of the string there is a letter that has been modified which are “P, Q, R” so there are 3 letters that modified the SOS.
15.
Given the following array of integers, returns the smaller number.
Input: arr = [23,456,89,1,34]
Output: 1
16.
Given an array of integers, returns a new array with unique elements eliminating duplicates.
Input: arr = [23,4,5,7,4,23,8]
Output: [23, 4, 5, 7, 8]
17.
Given the following array of integers sort them in ascending order using the bubble sort algorithm
Input: arr = [5, 3, 7, 1, 9, 2]
Output: [1, 2, 3, 5, 7, 9]
18.
Given the following array of integers return a new array with the numbers from the original array that are primes.
Input: arr = [12,3,5,9,7]
Output: [ 3, 5, 7 ]
19.
It is the pillar of object-oriented programming that consists of identifying the essential characteristics of an object and its relevant behaviors, omitting non-essential details.
20.
What is the pillar of object-oriented programming that promotes code reuse?