Programming Quiz Channel – Telegram
Programming Quiz Channel
612 subscribers
81 photos
4 videos
1 file
Programming quizzes and knowledge tests

Short quizzes on programming, logic and computer science.

Test and improve your coding knowledge.
Join 👉 https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Download Telegram
In React, how do you pass data from a parent component to a child component?
Anonymous Quiz
10%
Using local stage
45%
Using props
38%
Using state management library
7%
Using Redux
Which attribute is used to specify the URL in an img tag?
Anonymous Quiz
72%
src
9%
link
5%
alt
14%
href
JavaScript Task
Fill the array with random numbers from 1 to 100.
Difficulty: Easy😁

console.log(randomNumbers);
Which method can be used to convert a string to a number?
Anonymous Quiz
13%
parseFloat()
15%
convert()
44%
parseInt()
28%
toNumber()
Which of the following is the correct way to comment in HTML?
Anonymous Quiz
13%
// This is a comment
20%
/* This is a comment */
7%
# This is a comment
61%
<!-- This is a comment -->
Find errors in the code.
Difficulty: Impossible😈

class User {
constructor(name, age) {
this.name = name;
this.age = age;
}

getProfile() {
return Name: ${name}, Age: ${this.age};
}

isAdult() {
return this.age > 18 ? "Yes" : false;
}

updateProfile(newName, newAge) {
if (newAge < 0) {
throw "Age can't be negative";
}
this.name = newName ?? this.name;
this.age = newAge || this.age;
}
}

const user = new User("John", 25);

console.log(user.getProfile());?2
user.updateProfile("", -5);
What is the result of 5 + "5" in JavaScript?
Anonymous Quiz
19%
10
68%
55
3%
15
11%
Error
JavaScript Task
Get an array of letters from this string.
Difficulty: Easy😁

const str = 'abcde';
Which attribute of the <form> tag is used to specify the URL to which the form data will be sent when it is submitted?
Anonymous Quiz
61%
action
17%
method
17%
target
5%
enctype
Find errors in the code.
Difficulty: Average🤨

function bubbleSort(arr) {
let n = arr.length;

for (let i = 0; i < n - 1; i++) {
for (let j = 0; j < n - i - 1; j++) {
if (j > arr[j + 1]) {
let temp = j;
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}

}
return arr;
}

const numbers = [64, 34, 25, 12, 22, 11, 90];
const sortedNumbers = bubbleSort(numbers);
console.log("Sorted array:", sortedNumbers);
What will this code output? Spot the bug.
Difficulty: Average🤨

const obj = {
value: 42,
getValue: function() {
setTimeout(function() {
console.log(this.value);
}, 1000);
}
};

obj.getValue();
Which operator is used to compare both value and type?
Anonymous Quiz
6%
=
9%
!==
24%
==
62%
===
🔥2
Which CSS rule can be used to change the cursor when hovering over an element?
Anonymous Quiz
18%
hover: cursor;
58%
cursor: pointer;
3%
hover-cursor: hand;
21%
pointer: hover;
JavaScript Task
Given an array. Print to the console all options for permuting the elements of this array.
Difficulty: Hard😤

const arr = [1, 2, 3, 4];
What will this code output? And why?
Difficulty: Average🤨

const numbers = [1, 2, 3, 4, 5];

const result = numbers.map(num => {
if (num % 2 === 0) {
return num * 2;
} else {
return num * 3;
}
}).reduce((acc, curr) => acc + curr);

console.log(result);
Inside which HTML element do we put the JavaScript?
Anonymous Quiz
6%
<javanoscript>
3%
<noscripting>
83%
<noscript>
8%
<js>