-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathquestions.json
More file actions
498 lines (498 loc) · 29.2 KB
/
questions.json
File metadata and controls
498 lines (498 loc) · 29.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
{
"Languages": [
{
"Language": "en",
"questionCategories": [
{
"category":"Variables And Outputs",
"questions":[
{
"question": "Variable $a will contain: \n $a = 1 \n $a = write-host 2",
"answers": [
"1",
"2",
"$null",
"Command will return error message"
],
"correctAnswer": "82-99-07-9E-60-A4-1A-01-B1-70-EA-C4-33-A4-8C-0F"
},
{
"question": "Variable $a will contain: \n $a = '1' \n $a = $a + 2",
"answers": [
"$null",
"12",
"2",
"1"
],
"correctAnswer": "6B-15-1B-4C-B5-82-AC-32-49-AD-60-FC-FB-92-7E-0E"
},
{
"question": "While executing the following code: \n $a = write-output 1 \n $b = write-host 2 \n $a \n $b",
"answers": [
"Console output will looks like: \n 1 \n 2",
"Console output will looks like: \n $a \n $b",
"Console output will looks like: \n 2 \n 1",
"Console output will looks like: \n $b \n $a"
],
"correctAnswer": "E0-E3-C9-13-60-D8-88-9B-11-65-7E-FE-67-D4-6A-07"
},
{
"question": "Which type of the $variable will be When entering 1 into the command: \n $variable = Read-Host",
"answers": [
"int32",
"bool",
"PSCustomObject",
"string"
],
"correctAnswer": "ED-7F-9D-5C-63-28-B8-BD-39-5E-E2-1A-C4-00-A7-87"
},
{
"question": "While executing the following commands: \n $a = 123 \n $b = \"$a\" \n $a[-2] \n $b[-2]",
"answers": [
"Console output will looks like: \n 2",
"Console output will looks like: \n 123 \n 2",
"Console output will looks like: \n 121 \n 121",
"Console output will looks like: \n 1 \n 1"
],
"correctAnswer": "9F-BC-2A-CB-0D-0A-3C-60-20-50-7E-E4-F1-67-BC-EE"
},
{
"question": "While executing the following snippet: \n [int]$variable = $True \n $variable.GetType() \nVariable type will be as follows:",
"answers": [
"int32",
"bool",
"PSCustomObject",
"string"
],
"correctAnswer": "9D-1B-FD-6C-EE-18-FC-2F-16-57-80-11-4C-3C-49-22"
}
]
},
{
"category":"Strings",
"questions":[
{
"question": "While executing the following snippet: \n $PartialString = \"World\" \n $FullString = \"Hello $PartialString\" \nVariable $FullString will contain:",
"answers": [
"Hello $PartialString",
"Hello World"
],
"correctAnswer": "C1-2D-0F-C2-4D-A6-35-7D-9A-63-9D-08-86-23-71-35"
},
{
"question": "[Not the same as previous question!] \nWhile executing the following snippet: \n $PartialString = 'World' \n $FullString = 'Hello $PartialString' \n Variable $FullString will contain:",
"answers": [
"Hello $PartialString",
"Hello World"
],
"correctAnswer": "96-19-42-85-C4-E4-AF-AD-F1-D9-8B-23-B4-3D-E1-A5"
}
]
},
{
"category":"Regex",
"questions":[
{
"question": "What is an output of the following command: \n \"Hello world\" -match 'hell'",
"answers": [
"Hello",
"Hello world",
"true",
"false"
],
"correctAnswer": "D0-E8-4C-02-59-93-09-34-6A-94-21-71-25-70-4F-74"
},
{
"question": "What is an output of the following command: \n \"Hello world\" -replace 'lo|wo'",
"answers": [
"Hello world",
"Hel rld",
"true",
"Helwo lorld"
],
"correctAnswer": "57-A4-ED-AD-AF-0D-0D-77-90-FC-EE-71-4F-3E-EF-E2"
}
]
},
{
"category":"Logical",
"questions":[
{
"question": "What is an output of the following command: \n 0 -gt $true",
"answers": [
"0",
"false",
"1",
"true"
],
"correctAnswer": "94-B5-9C-D8-51-63-EA-6B-BA-0E-BE-C3-15-4A-65-B3"
},
{
"question": "What is an output of the following command: \n 5 -in @(1..10)",
"answers": [
"0",
"false",
"1",
"true"
],
"correctAnswer": "11-A8-13-41-AD-3C-FE-4A-7C-4F-14-BC-A4-00-8C-96"
},
{
"question": "What is an output of the following command: \n [Int](Get-Date).DayOfWeek -in @(6..9)",
"answers": [
"Command will return date '1678-09-01'",
"The result will always be $False",
"If at the time of command execution there is a 6, 7, 8 or 9 number, then the command will return True, otherwise it will be False",
"The command will return True on Saturday, and False on the rest of the week"
],
"correctAnswer": "EC-AC-AD-86-A8-53-BB-47-4E-04-B8-92-34-22-69-45"
}
]
},
{
"category":"Functions",
"questions":[
{
"question": "What will appear on the screen when the following command is executed: \n function new-function { \n param($string) \n \"~~ $string ~~\" \n } \n $string = 'ABC' \n new-function \"DEF\"",
"answers": [
"ABC",
"DEF",
"~~ DEF ~~",
"$string"
],
"correctAnswer": "E1-78-1B-78-3B-8E-49-BA-FE-5C-1C-16-CA-83-DA-65"
},
{
"question": "When executing the following code snippet \n $ErrorActionPreference = 'Stop' \n try { \n throw 'Custom Error Message' \n $a = 'ABCD' \n } catch { \n $b = $_ \n }",
"answers": [
"Variable $a will be empty ($null) \n Variable $b will contain an error ('Custom Error Message')",
"Variable $a will contain a string ('ABCD') \n Variable $b will be empty ($null)",
"Both variables $a and $b would contain string ('ABCD')",
"Both variables $a and $b would be empty ($null)"
],
"correctAnswer": "5C-A7-81-1A-61-01-24-13-DB-B5-F9-8F-2F-50-E7-EA"
},
{
"question": "What will appear in the console when the following code snippet is executed \n foreach ($i in @(1..3)){ \n if($i -eq 2){\n continue\n }else{\n $i\n }\n }",
"answers": [
"1",
"1 \n 2",
"1 \n 2 \n 3",
"1 \n 3"
],
"correctAnswer": "49-AC-DA-1D-C6-85-34-DC-31-0D-B3-96-C6-8D-F7-79"
}
,
{
"question": "What $unsecureString variable will contain when executing the following code snippet \n $SecureString = ConvertTo-SecureString -String 'Password' -Force -AsPlainText \n $unsecureString = ConvertFrom-SecureString $SecureString",
"answers": [
"Decrypted string equal to 'Password'",
"PSCredential object, which can be used in Invoke-Command or Enter-PSSession",
"Password that can be used to access PC on which this password was generated",
"Encrypted sequence that can be converted to SecureString"
],
"correctAnswer": "C6-96-6D-8E-5B-80-A9-1B-57-79-47-AB-FC-91-9D-0F"
}
]
},
{
"category":"Files",
"questions":[
{
"question": "What will be displayed in the console when the next snippet is executed: \n $TestFile = New-TemporaryFile \n New-Item -Force -ItemType File -Path $TestFile \n 1 | Out-File $TestFile \n 2 | Out-File $TestFile \n Get-Content $TestFile",
"answers": [
"12",
"1",
"2",
"1 \n 2"
],
"correctAnswer": "E4-2D-24-9B-F7-AF-CE-68-BF-4F-80-D5-8A-0B-21-8A"
},
{
"question": "What will be displayed in the console when the next snippet is executed: \n $TestFile = New-TemporaryFile \n New-Item -Force -ItemType File -Path $TestFile \n 1 | Out-File $TestFile \n 2 | Out-File $TestFile \n $Content = Get-Content $TestFile | Select -First 1 \n $Content + 3",
"answers": [
"13",
"4",
"23",
"5"
],
"correctAnswer": "F0-85-0C-6D-0A-46-AF-A8-F8-D6-BE-66-6E-16-0B-75"
},
{
"question": "What options can be obtained in the console when executing the following snippet: \n $randomValue = Get-Random -InputObject @($true, $false) \n if ($randomValue){ \n 1 \n } elseif ($randomValue -eq $false){ \n 2 \n } else { \n 3 \n }",
"answers": [
"1, 2, 3",
"1 and 2",
"2 and 3",
"3"
],
"correctAnswer": "B2-C4-E5-DC-8E-BE-F8-F9-5E-BA-F4-59-C8-69-A1-09"
}
]
},
{
"category":"Optimization",
"questions":[
{
"question": "What will be the result of executing the following code snippet: \n $FunctionAResult = Measure-Command {1..1000000 | foreach{$_}} \n $FunctionBResult = Measure-Command {$i = 0 ; 1..1000000 | foreach{$a = $i+$_ ; Write-Output $a}} \n $FunctionAResult -ge $FunctionBResult \n $FunctionAResult -eq $FunctionBResult \n $FunctionAResult -le $FunctionBResult",
"answers": [
"False \n False \n True",
"True \n True \n True",
"True \n True \n False",
"Error"
],
"correctAnswer": "4C-AA-05-16-20-04-94-DD-E7-B4-6B-CE-74-A9-93-0F"
}
]
}
]
},
{
"Language": "ru",
"questionCategories": [
{
"category":"Variables And Outputs",
"questions":[
{
"question": "Переменная $a будет содержать: \n $a = 1 \n $a = write-host 2",
"answers": [
"1",
"2",
"$null",
"Команда вернет ошибку"
],
"correctAnswer": "FE-9D-4C-19-E5-C4-00-F1-79-4B-75-EB-E9-67-50-B6"
},
{
"question": "Переменная $a будет содержать: \n $a = '1' \n $a = $a + 2",
"answers": [
"$null",
"12",
"2",
"1"
],
"correctAnswer": "39-07-71-93-21-33-D9-72-A1-CC-F7-3D-AD-84-51-3F"
},
{
"question": "При выполнении следующего кода: \n $a = write-output 1 \n $b = write-host 2 \n $a \n $b",
"answers": [
"Вывод в консоли будет следующим: \n 1 \n 2",
"Вывод в консоли будет следующим: \n $a \n $b",
"Вывод в консоли будет следующим: \n 2 \n 1",
"Вывод в консоли будет следующим: \n $b \n $a"
],
"correctAnswer": "B8-AF-11-F5-01-42-41-FF-64-04-35-D7-97-ED-C4-75"
},
{
"question": "При вводе 1 в следующую команду \n $variable = Read-Host \n Тип переменной будет следующим:",
"answers": [
"int32",
"bool",
"PSCustomObject",
"string"
],
"correctAnswer": "21-CA-6A-6D-3F-FC-82-12-41-3A-D5-05-CB-81-91-2A"
},
{
"question": "При выполнении следующих команд: \n $a = 123 \n $b = \"$a\" \n $a[-2] \n $b[-2]",
"answers": [
"Вывод в консоли будет следующим: \n 2",
"Вывод в консоли будет следующим: \n 123 \n 2",
"Вывод в консоли будет следующим: \n 121 \n 121",
"Вывод в консоли будет следующим: \n 1 \n 1"
],
"correctAnswer": "6A-72-09-B6-F5-E2-93-55-74-95-0D-D2-14-83-CA-D1"
},
{
"question": "При выполнении следующего фрагмента \n [int]$variable = $True \n $variable.GetType() \n Тип переменной будет следующим:",
"answers": [
"int32",
"bool",
"PSCustomObject",
"string"
],
"correctAnswer": "F9-7B-37-71-B4-E0-45-C9-46-88-79-80-D1-07-61-C1"
}
]
},
{
"category":"Strings",
"questions":[
{
"question": "Что будет содержать переменная $FullString: \n $PartialString = \"World\" \n $FullString = \"Hello $PartialString\"",
"answers": [
"Hello $PartialString",
"Hello World"
],
"correctAnswer": "FB-67-67-40-84-4A-38-5F-C4-62-1C-83-19-A9-F3-E6"
},
{
"question": "$FullString будет содержать: \n $PartialString = 'World' \n $FullString = 'Hello $PartialString'",
"answers": [
"Hello $PartialString",
"Hello World"
],
"correctAnswer": "A0-FA-8B-AE-95-0F-F3-58-42-4F-F8-D7-C3-B4-90-D9"
}
]
},
{
"category":"Regex",
"questions":[
{
"question": "Какой будет вывод следующей команды \n \"Hello world\" -match 'hell'",
"answers": [
"Hello",
"Hello world",
"true",
"false"
],
"correctAnswer": "8B-3A-0A-AC-26-29-48-54-B5-EB-BE-31-3C-87-1B-C1"
},
{
"question": "Какой будет вывод следующей команды \n \"Hello world\" -replace 'lo|wo'",
"answers": [
"Hello world",
"Hel rld",
"true",
"Helwo lorld"
],
"correctAnswer": "03-93-CD-66-C5-51-E7-D5-62-51-F5-AB-9C-78-D6-5D"
}
]
},
{
"category":"Logical",
"questions":[
{
"question": "Какой будет вывод следующей команды: \n 0 -gt $true",
"answers": [
"0",
"false",
"1",
"true"
],
"correctAnswer": ""
},
{
"question": "Какой будет вывод следующей команды: \n 5 -in @(1..10)",
"answers": [
"0",
"false",
"1",
"true"
],
"correctAnswer": "1E-24-FE-F1-16-EC-D0-E7-86-63-A3-C5-32-9E-22-D9"
},
{
"question": "Что будет делать следующая команда \n [Int](Get-Date).DayOfWeek -in @(6..9)",
"answers": [
"Команда вернет дату 1989-07-06",
"Всегда результат будет идентичным и равным False",
"Если в момент выполнения команды будет 6, 7, 8 или 9 число то команда вернет True, в другом случае будет False",
"Команда вернет True в субботу и воскресенье, и False в остальные дни недели"
],
"correctAnswer": "1B-98-7B-CB-18-2D-36-BB-B7-98-92-E9-A1-76-13-DC"
}
]
},
{
"category":"Functions",
"questions":[
{
"question": "Что появится на экране при выполнeнии следующей команды: \n function new-function { \n param($string) \n \"~~ $string ~~\" \n } \n $string = 'ABC' \n new-function \"DEF\"",
"answers": [
"ABC",
"DEF",
"~~ DEF ~~",
"$string"
],
"correctAnswer": "12-EC-10-FA-CF-4B-C5-F7-3D-B2-88-D7-22-C8-8B-C7"
},
{
"question": "При выполнении следующего фрагмента кода \n $ErrorActionPreference = 'Stop' \n try { \n throw 'Custom Error Message' \n $a = 'ABCD' \n } catch { \n $b = $_ \n }",
"answers": [
"Переменная $a будет пустая ($null) \n Переменная $b будет содержать ошибку ('Custom Error Message') ",
"Переменная $a будет содержать строку ('ABCD') \n Переменная $b будет пустая ($null)",
"Обе переменные $a и $b будут содержать строку ('ABCD')",
"Обе переменные $a и $b будут пустыми ($null)"
],
"correctAnswer": "DC-03-DD-6D-9B-DF-73-BA-B4-DB-36-72-82-83-B1-5D"
},
{
"question": "Что появится в консоли при выполнении следующего фрагмента кода \n foreach ($i in @(1..3)){if($i -eq 2){continue}else{$i}}",
"answers": [
"1",
"1 \n 2",
"1 \n 2 \n 3",
"1 \n 3"
],
"correctAnswer": "40-D0-37-94-44-E5-BB-28-34-3A-2E-1E-AD-E1-39-05"
}
,
{
"question": "Что будет содержать переменная $unsecureString при выполнении следующего фрагмента кода \n $SecureString = ConvertTo-SecureString -String 'Password' -Force -AsPlainText \n $unsecureString = ConvertFrom-SecureString $SecureString",
"answers": [
"Расшифрованную строку равную 'Password'",
"Объект PSCredential, который можно использовать в Invoke-Command и Enter-PSSession ",
"Пароль который можно будет использовать для доступа к ПК на котором пароль был сгенерирован",
"Шифрованную последовательность которую можно сконвертировать в SecureString"
],
"correctAnswer": "95-E8-2E-11-4E-D4-AC-CA-8A-B8-45-12-11-A7-2B-84"
}
]
},
{
"category":"Files",
"questions":[
{
"question": "Что будет отображено в консоли при выполнении следующего фрагмента: \n $TestFile = New-TemporaryFile \n New-Item -Force -ItemType File -Path $TestFile \n 1 | Out-File $TestFile \n 2 | Out-File $TestFile \n Get-Content $TestFile",
"answers": [
"12",
"1",
"2",
"1 \n 2"
],
"correctAnswer": "58-58-AC-E8-33-AB-FC-6B-F1-9D-41-5F-F6-99-FC-4B"
},
{
"question": "Что будет отображено в консоли при выполнении следующего фрагмента: \n $TestFile = New-TemporaryFile \n New-Item -Force -ItemType File -Path $TestFile \n 1 | Out-File $TestFile \n 2 | Out-File $TestFile \n $Content = Get-Content $TestFile | Select -First 1 \n $Content + 3",
"answers": [
"13",
"4",
"23",
"5"
],
"correctAnswer": "D6-1F-F1-1C-A9-B6-B4-5C-26-D2-1B-99-82-1C-04-8B"
},
{
"question": "Какие варианты возможно получить в консоли при выполнении следующего фрагмента: \n $randomValue = Get-Random -InputObject @($true, $false) \n if ($randomValue){ \n 1 \n } elseif ($randomValue -eq $false){ \n 2 \n } else { \n 3 \n }",
"answers": [
"1, 2, 3",
"1 и 2",
"2 и 3",
"3"
],
"correctAnswer": "AA-19-39-FC-AB-BE-28-45-5D-4A-48-5E-C4-90-27-0C"
}
]
},
{
"category":"Optimization",
"questions":[
{
"question": "Какой будет результат выполнения следующего фрагмента кода: \n $FunctionAResult = Measure-Command {1..1000000 | foreach{$_}} \n $FunctionBResult = Measure-Command {$i = 0 ; 1..1000000 | foreach{$a = $i+$_ ; Write-Output $a}} \n $FunctionAResult -ge $FunctionBResult \n $FunctionAResult -eq $FunctionBResult \n $FunctionAResult -le $FunctionBResult",
"answers": [
"False \n False \n True",
"True \n True \n True",
"True \n True \n False",
"Error"
],
"correctAnswer": "4E-92-E8-1C-1E-F1-86-D4-DD-A1-35-C8-0C-46-1F-9A"
}
]
}
]
}
]
}