-
Notifications
You must be signed in to change notification settings - Fork 16
/
swift.json
259 lines (259 loc) · 7.82 KB
/
swift.json
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
[
{
"id": "151",
"category": "swift",
"level": "facil",
"question": "¿Qué palabra clave usas para anunciar constantes en Swift?",
"answers": {
"answer_a": "Var",
"answer_b": "Let",
"answer_c": "Con",
"answer_d": "Value"
},
"correct_answer": "answer_b"
},
{
"id": "152",
"category": "swift",
"level": "facil",
"question": "¿Cuántos tipos de enteros hay en Swift?",
"answers": {
"answer_a": "1",
"answer_b": "2",
"answer_c": "3",
"answer_d": "4"
},
"correct_answer": "answer_b"
},
{
"id": "153",
"category": "swift",
"level": "facil",
"question": "¿Cuáles son los tipos de colección en Swift?",
"answers": {
"answer_a": "Dictionary y array",
"answer_b": "Array y library",
"answer_c": "Dictionary y library",
"answer_d": "Library, dictionary, library"
},
"correct_answer": "answer_a"
},
{
"id": "154",
"category": "swift",
"level": "facil",
"question": "¿Qué debe usar para proporcionar un valor predeterminado para una variable en Swift?",
"answers": {
"answer_a": "?",
"answer_b": "??",
"answer_c": "&",
"answer_d": "&&"
},
"correct_answer": "answer_b"
},
{
"id": "155",
"category": "swift",
"level": "facil",
"question": "¿Cuál de las siguientes definiciones de funciones es incorrecta considerando el lenguaje Swift?",
"answers": {
"answer_a": "func mean(numbers: Double...) -> Double",
"answer_b": "func minMax(array: [Int]) -> (min: Int, max: Int)?",
"answer_c": "func minMax(array: [Int]) -> (min: Int?, max: Int?)",
"answer_d": "func haveChar(#string: String, character: Character) -> (Bool)"
},
"correct_answer": "answer_d"
},
{
"id": "156",
"category": "swift",
"level": "normal",
"question": "¿Cuál crea un diccionario con un tipo de clave de Entero y valor de Cadena?",
"answers": {
"answer_a": "var dict = [\"one\":1]",
"answer_b": "var dict: [String: Int] = [1:\"one\"]",
"answer_c": "var dict: [Int: String] = [1:\"one\"]",
"answer_d": "var dict:[Int: String] = [\"one\":1]"
},
"correct_answer": "answer_c"
},
{
"id": "157",
"category": "swift",
"level": "normal",
"question": "¿Cuál de estas no es una declaración de propiedad válida en Swift?",
"answers": {
"answer_a": "final var x = 0",
"answer_b": "final lazy var x = 0",
"answer_c": "final lazy let x = 0",
"answer_d": "final let x = 0"
},
"correct_answer": "answer_c"
},
{
"id": "158",
"category": "swift",
"level": "normal",
"question": "¿Cuál es la definición incorrecta de un protocolo en Swift?",
"answers": {
"answer_a": "protocol SomeProtocol { var first: Int{ set } }",
"answer_b": "protocol SomeProtocol { var first: Int{ get } }",
"answer_c": "protocol SomeProtocol { var first: Int { get set } }",
"answer_d": "protocol SomeProtocol { var first: Int { get set } var second: Int { get } }"
},
"correct_answer": "answer_a"
},
{
"id": "159",
"category": "swift",
"level": "normal",
"question": "¿De qué clase raíz deben heredar todas las clases de Swift?",
"answers": {
"answer_a": "Root",
"answer_b": "@ObjC",
"answer_c": "NSObject",
"answer_d": "Las clases Swift no requieren una clase raíz"
},
"correct_answer": "answer_d"
},
{
"id": "160",
"category": "swift",
"level": "normal",
"question": "¿Cuál es correcta sobre las enumeraciones?",
"answers": {
"answer_a": "Las enumeraciones no pueden ajustarse a los protocolos",
"answer_b": "Las enumeraciones pueden definir inicializadores"
},
"correct_answer": "answer_b"
},
{
"id": "161",
"category": "swift",
"level": "normal",
"question": "¿Cuál de las siguientes declaraciones podría usarse para determinar si una variable dada es de tipo String?",
"answers": {
"answer_a": "if unkownVariable: String { }",
"answer_b": "if (String)unknownVariable { }",
"answer_c": "if unknownVariable is String { }",
"answer_d": "if String.hierarchy(unknownVariable) { }"
},
"correct_answer": "answer_c"
},
{
"id": "162",
"category": "swift",
"level": "normal",
"question": "¿Cuál de estas podría ser una declaración de protocolo adecuada en Swift?",
"answers": {
"answer_a": "protocol someProtocal { var first: Int { set } }",
"answer_b": "protocol someProtocal { optional var first: Int { get } }",
"answer_c": "@objc protocol someProtocal { optional var first: Int { set } }",
"answer_d": "@objc protocol someProtocal { optional var first: Int { get } }"
},
"correct_answer": "answer_d"
},
{
"id": "163",
"category": "swift",
"level": "normal",
"question": "¿Qué se usa para importar archivos Objective-C a Swift?",
"answers": {
"answer_a": "Las clases de Objective-C se importan automáticamente",
"answer_b": "Las clases de Objective-C se importan mediante un \"Bridging Header\"",
"answer_c": "Las clases de Objective-C se importan declarando @SwiftImportable",
"answer_d": "Las clases de Objective-C se importan en el archivo Swift usando la clase"
},
"correct_answer": "answer_b"
},
{
"id": "164",
"category": "swift",
"level": "dificil",
"question": "¿Qué tipo de objeto son las \"Swift Structures\"?",
"answers": {
"answer_a": "Value Type",
"answer_b": "Abstract Type",
"answer_c": "Memory Type",
"answer_d": "Reference Type"
},
"correct_answer": "answer_a"
},
{
"id": "165",
"category": "swift",
"level": "dificil",
"question": "¿Qué palabra clave en el contexto de una instrucción Switch se requiere para forzar la ejecución de un caso posterior?",
"answers": {
"answer_a": "Break",
"answer_b": "Return",
"answer_c": "Continue",
"answer_d": "Fallthrough"
},
"correct_answer": "answer_d"
},
{
"id": "166",
"category": "swift",
"level": "normal",
"question": "¿Cuál es el tipo de de las enumeraciones?",
"answers": {
"answer_a": "Value type",
"answer_b": "Class type",
"answer_c": "Collection type",
"answer_d": "Reference type"
},
"correct_answer": "answer_a"
},
{
"id": "167",
"category": "swift",
"level": "normal",
"question": "¿Qué tipos de colección están disponibles en Swift?",
"answers": {
"answer_a": "Array",
"answer_b": "Dictionary",
"answer_c": "Las dos estan disponibles",
"answer_d": "Ninguna de las anteriores"
},
"correct_answer": "answer_c"
},
{
"id": "168",
"category": "swift",
"level": "dificil",
"question": "_____________ es un proceso de consulta y llamada de propiedades.",
"answers": {
"answer_a": "Lazy Chaining",
"answer_b": "Swift Chaining",
"answer_c": "Optional Chaining",
"answer_d": "Todas las anteriores"
},
"correct_answer": "answer_c"
},
{
"id": "169",
"category": "swift",
"level": "dificil",
"question": "Dado lo siguiente... var stringValue:String = \"Jane Doe\", ¿cuál es el resultado de realizar... stringValue = nil?",
"answers": {
"answer_a": "stringValue == nil",
"answer_b": "stringValue == \"Jane Doe\"",
"answer_c": "El compilador no lo permitirá"
},
"correct_answer": "answer_b"
},
{
"id": "170",
"category": "swift",
"level": "normal",
"question": "¿Qué tipo de lenguaje es Swift?",
"answers": {
"answer_a": "Scripting language",
"answer_b": "Programación orientada a objetos",
"answer_c": "Type-safe language",
"answer_d": "Todo lo anterior"
},
"correct_answer": "answer_d"
}
]