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 the following array and an integer, return the indices of 2 numbers that sum to the given integer.
Input: nums = [2,7,11,15] target = 9
Output: [0,1]
Explanation: The sum of position 0 and 1 of the array return as result 9. 2 + 7 = 9
3.
Given an integer n, return a string array answer where:
answer[i] == “FizzBuzz” if i is divisible by 3 and 5. answer[i] == “Fizz” if i is divisible by 3. answer[i] == “Buzz” if i is divisible by 5. answer[i] == i (as a string) if none of the above conditions are true Input: n = 15
Output: [“1″,”2″,”Fizz”,”4″,”Buzz”,”Fizz”,”7″,”8″,”Fizz”,”Buzz”,”11″,”Fizz”,”13″,”14″,”FizzBuzz”]
4.
What is a relational database?
5.
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 ]
6.
Given the following array of integers, returns the smaller number.
Input: arr = [23,456,89,1,34]
Output: 1
7.
Which SQL query updates the name of a customer with ID 123 in a table "customers"?
8.
What does the encapsulation pillar mean in object-oriented programming?
9.
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?
10.
Reverses the following string.
Input: “Hello World”.
Output: “dlroW olleH”.
11.
What is the pillar of object-oriented programming that promotes code reuse?
12.
What is the difference between a class and an object in OOP?
13.
Access modifier that only allows access within the class and child classes.
14.
Which of the following SQL statements deletes a record from a table?
15.
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.
16.
Given the following array of integers, sort it in ascending order using the quick sort algorithm
Input: arr = [5, 3, 7, 1, 9, 2]
Output: [1, 2, 3, 5, 7, 9]
17.
What is a primary key in a database?
18.
What is the function of the constructor method in OOP?
19.
Given a string, replace the x's by the y's.
Input: string = “abxbxc”.
Output: “abybyc”
20.
Given an array of countries and another array with capitals returns a new array with country-capital pairs.
Input: countries = [“Mexico”, “Spain”, “United States”]
capitals = [“Ciudad de México”, “Madrid”, “Washington D.C.”]
Output:
[ [ ‘Mexico’, ‘Ciudad de México’ ], [ ‘Spain’, ‘Madrid’ ], [ ‘United States’, ‘Washington D.C.’ ] ]