Section mcq’s choice Choice Choice 1,2 Choice 1,3,5


Download 63.22 Kb.
bet1/8
Sana03.06.2024
Hajmi63.22 Kb.
#1840512
  1   2   3   4   5   6   7   8
Bog'liq
CODER EXAM



SECTION 1 MCQ’S

  1. Choice 1

  2. Choice 3

  3. Choice 1,2

  4. Choice 1,3,5

  5. Choice 1,2,4

  6. Choice 1,3

  7. Choice 1

  8. Choice 2

  9. Choice 2,3

SECTION 2 RATING

  1. Write a program in Java to compute the sum of two numbers that sum up to a given number K.

Response 1 - 5, 5, 5, 5, 1, 1
Response 2 - 5, 5, 2, 5, 1, 1


  1. Explain this code. Go step by step, explaining each line in detail:

const re = /A[a-zA-Z]+g/;
const str = "I like to fun";
const myArray = str.match(re);
console.log(myArray);
Response 1 - 2 , 5 , 5, 2, 1, 1
Response 2- 5, 5, 5, 5 1, 1


  1. Write a JS/React component for showing a button that opens a popup and says 'Hello, how are you?

Response 1 - 2,3,4,4,1,1
Response 2 – 5,3,5,5,1,1


  1. Explain to me why I get this error message:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at ArrayClass.main(test2.java:4)
When I tried to run the following code:
public class ArrayClass {
public static void main(String[] args) {
int[] numbers = {1, 2, 3, 4, 5};
System.out.println(numbers[5]);
}
Response 1 - 2,4,2,2,1,1
Response 2 – 5,5,5,5,1,1


  1. I'm trying to initialize a list of points in python where the y coordinate is double the x coordinate and the x coordinate is increasing from 0 to 5. Please tell me what I'm doing wrong

o = {"x": 0, "y": 0}
l = []
for i in xrange(0, 5):
m = o
m["x"] = i
m["y"] = i*2
l.append(m)
print(l)

Download 63.22 Kb.

Do'stlaringiz bilan baham:
  1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling