[Youth training camp - front-end practice questions]
Want to know how to test the written test questions of the youth training camp? Come here to have a look at the practice questions!
Collected from the official account of Byte Youth Training Camp
Day1
Multiple Choice Question 1:
Which of the following are new features of HTML5?
A. Semantic tags
B. Canvas drawing
C. <audio> element
D. Enhanced form
Multiple choice question 2:
What are the following attributes that can be inherited?
A. font-size
B. background
C. color
D. cursor
1、ABCD;2、ACD
Day2
Multiple choice question 1:
For a 100M broadband, what is the upper limit of the theoretical download speed?
A. 12.5MB/s
B. 100MB/s
C. 10MB/s
D. 10Mb/s
Multiple choice question 2:
Regarding the description of for of and for in, which one is correct?
A. for in can loop ordinary objects
B. for of can loop ordinary objects
C. neither can loop arrays
D. both can loop arrays
1、A;2、AD
Day3
Multiple Choice Question 1:
Which one is correct about event bubbling?
A. Bubble from target element to document
B. Bubble from document to target element
C. Bubble from document to target element, then bubble from target element to document
D. None of the above
Multiple Choice Question 2:
Which of the following script tag attributes make it possible for scripts to be loaded after the DOMContentLoaded event?
A. <script async>
B. <script defer>
C. <script type="module">
D. <script type="module" async>
1、A;2、AD
Day4
Multiple Choice Question 1:
Which of the following are properties of CSS block-level elements?
A. The width is determined by the content by default
B. The height is determined by the content by default
C. It can be split into multiple lines
D. The height can be specified through the height attribute
Multiple choice question 2:
Which of the following statements about cross-domain is wrong?
A. example.com and example.com are the same domain name and belong to the same origin
B. The cross-domain resource sharing specification stipulates that for HTTP requests other than GET, or with certain MINE type POST requests, the browser needs to first Send an OPTIONS request.
C. Using fonts in CSS through @font-face will also have cross-domain problems
D. Cookies, LocalStorage and IndexedDB will all be restricted by the same-origin policy
1、BD;2、A
Day5
Multiple choice question 1:
Which of the following can realize browser storage data?
A. cookie
B. localStorage
C. session
D. sessionStorage
Multiple Choice Question 2:
Which statement about the following code is correct?
let arr = [1,2,3,4,5];
let arr2 = [1, , 3];
A. Execute arr.length = 3
, the array is [1,2,3]
B. Execute arr[10] = 11
, the arr.length is 6
C. Execute delete arr[2]
, the arr.length is 4, the array is [1,2,4,5]
D .arr2.length has a length of 2
1、US;2、A
Day6
Multiple Choice Question 1:
Among the CSS selectors, which one has the correct priority?
A. id selector > tag selector > class selector
B. tag selector > class selector > id selector
C. class selector > tag selector > id selector
D. id selector > class selector > tag Selector
Multiple choice question 2:
As shown in the following code, after binding two events to the body, what is the output result of calling document.body.click()?
document.body.addEventListener('click', () => {
Promise.resolve().then(() => console.log(1))
console.log(2);
}, false);
document.body.addEventListener('click', () => {
Promise.resolve().then(() => console.log(3))
console.log(4);
}, false);
A. 2, 4, 1, 3
B. 2, 1, 4, 3
C. 1, 2, 3, 4
D. 1, 3, 2, 4
1、D;2、A
Day7
Multiple-choice question 1:
Floating will lead to abnormal display of the page. Which of the following methods to clear the floating is not recommended?
A. Add an empty tag at the end of the floating element such as <div style=”clear:both”></div>
B. By setting the overflow value of the parent element to hidden;
C. Add a clearfix class to the parent element
D. The parent element also set float
Multiple Choice Question 2:
What is the result of running the following code?
var f = function () {
console.log('1'); } function f() {
console.log('2'); }
f()
A. undefined
B. error
C. 2
D. 1
1、D;2、B or D;
Explanation: The code for the second question is missing a newline
var f = function () {
console.log('1'); }
function f() {
console.log('2'); }
f()
If there is no newline, an error will be reported
Day 8
Multiple Choice Question 1:
Which of the following statements is correct?
A. visibility:hidden
Indicates that the occupied space still exists, only visually completely transparent
B. display:none
Does not reserve its physical space for hidden objects
C. There is no essential difference between the two visibility:hidden
D. Reflow and redrawdisplay:none
visibility:hidden
Multiple-choice question 2:
If host A has established a TCP connection with the host, the maximum segment size (MSS) is 1KB, and the round-trip time (RTT) is 2 ms, then the congestion window increases from 8KB to 32KB without congestion What is the maximum time required?
A. 4ms
B. 8ms
C. 24ms
D. 48ms
1、AB;2、D
Day9
Multiple Choice Question 1:
Which of the following uses of HTML tags are semantically correct?
A. Use table to display tabular data
B. Use span to represent buttons
C. Use article to display article content
D. Use p tag to display article title
Multiple-choice question 2:
What is not included in the packet filtering basis of the packet filtering firewall?
A. Source IP address
B. Source port number
C. MAC address
D. Destination IP address
1、AC;2、C
programming questions
Restricted languages: C, C++, Java, Python, JavaScript V8]
Programming question 1
Given a string of decimal integers, check whether it is a power of 4.
Example 1
input: "16", output: true
Example 2
input: "101", output: false
Example 3
Input: "70368744177664"
Output: true
Programming question 2
Given a string, verify that it is a palindrome, considering only alphanumeric characters, ignoring spaces, case of letters.
Example
Input: "A man, a plan, a canal: Panama"
Output: true
Programming Question 3
Given a string, find the length of the longest palindromic substring in that string.
Example 1
Input: "abc"
Output: 0
Example 2
Input: "abcbe"
Output: 3
Example 3
Input: "acdcecdcf"
Output: 7