1.
What is polymorphism in OOP?
2.
What is a primary key in a database?
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.
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
5.
What is the pillar of object-oriented programming that promotes code reuse?
6.
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]
7.
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.
8.
Given the following array of integers, returns the smaller number.
Input: arr = [23,456,89,1,34]
Output: 1
9.
Which SQL query updates the name of a customer with ID 123 in a table "customers"?
10.
What is inheritance in object-oriented programming and what is its purpose?
11.
SQL clause used to filter the records in a table based on a specific condition.
12.
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 ]
13.
Reverses the following string.
Input: “Hello World”.
Output: “dlroW olleH”.
14.
What is the function of the constructor method in OOP?
15.
What is the SQL query to select all records in a table named "customers"?
16.
What does the encapsulation pillar mean in object-oriented programming?
17.
SQL query fetching unique records from a "city" column in a "customers" table?
18.
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]
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 difference between a class and an object in OOP?