-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestionnaire.json
More file actions
257 lines (257 loc) · 19.8 KB
/
questionnaire.json
File metadata and controls
257 lines (257 loc) · 19.8 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
[
{
"id": 1,
"question": "What is serialization?",
"answer": "<p>Packaging data for transport. Serialization is the process of converting an object into a form that can be readily transported. The <code>$.serialize()</code> method creates a text string of name/value pairs that can be sent to a server in an AJAX request. It can act on a jQuery object that has selected individual form controls, such as <code><input></code>, <code><textarea></code>, and <code><select></code>: <code>$('input, textarea, select').serialize();</code>. It is typically easier, however, to select the <code><form></code> itself for serialization: <code>$('#formData').serialize();</code></p>"
},
{
"id": 2,
"question": "What types of serialization are you familiar with?",
"answer": "<p><code>$.serialize()</code> - Only form elements are examined for inputs they contain. A form is serialized to a name-value pair string that can be sent to a server in an AJAX request.</p><p>Other types:</p><ul><li>SOAP serialization</li><li>Binary serialization</li><li>XML Serialization</li><li>JSON Serialization</li></ul>"
},
{
"id": 3,
"question": "What are the benefits of JSON serialization over XML serialization?",
"answer": "<p>XML (Extensible Markup Language) serialization serializes only the public fields and property values of an object into an XML stream. XML serialization does not include type information.</p><p>The biggest reason that JSON is now being used over XML is that JSON is inherently more efficient. It is lightweight, fewer bits are being transferred, and less machine time is required to process data (on either end).</p>"
},
{
"id": 4,
"question": "Write out the JSON for the following Contact object: Bob Smith is 30 years old and has two direct reports. They are Sally Smith, 30 y/o, and Jane Doe, 34 y/o",
"answer": "<pre>{\n  "firstName": "Bob",\n  "lastName": "Smith",\n  "age": 30,\n  "reports": [\n    {\n      "firstName": "Sally",\n      "lastName": "Smith",\n      "age": 30\n    },\n    {\n      "firstName": "Jane",\n      "lastName": "Doe",\n      "age": 34\n    }\n  ]\n}</pre>"
},
{
"id": 5,
"question": "Write out the .NET class for that Contact object in the previous question.",
"answer": "<pre>public class Contact\n{\n    public string FirstName {get; set;}\n    public string LastName {get; set;}\n    public int Age {get; set;}\n    public Contact[] Reports {get; set;}\n}\n\nContact Bob = new Contact();</pre>"
},
{
"id": 6,
"question": "How do you validate using DataAnnotations?",
"answer": "<ol><li>Decorate or "annotate" your models with a specific set of attributes that tell the .NET framework what you expect from each property.</li><li>Invoke a check of these attributes or rules at the controller level before you do anything else and return an error if the data is not valid. To check if the data was properly submitted, we invoke the check and respond appropriately.</li></ol>"
},
{
"id": 7,
"question": "What namespace do these attributes live in? (i.e. What namespace do the data attributes (server validation) in .NET belong to (what library?))",
"answer": "<p><code>using System.ComponentModel.DataAnnotations</code></p>"
},
{
"id": 8,
"question": "What are the different types of validations that these attributes let you perform?",
"answer": "<p>StringLength (designates max and min number of characters)</p><p>Required</p><p>Range</p><p>RegularExpression</p><p>DataType (such as email and phone number)</p><p>EnumDataType</p><p>CustomValidation</p><p>Validation (Serves as a base class for validation attributes)</p>"
},
{
"id": 9,
"question": "Decorate this class to the following specs: First/Last Name should be at least 3 chars long and no more than 50, Age should be at least 18 years old.",
"answer": "<pre>[StringLength(50, MinimumLength = 3)]\npublic string FirstName {get; set;}\n\n[StringLength(50, MinimumLength = 3)]\npublic string LastName {get; set;}\n\n[Range(18, 120)]Model\npublic int Age {get; set;}</pre>"
},
{
"id": 10,
"question": "What is Model Binding? Why is it important?",
"answer": "<p>The ASP.NET MVC framework provides the model binding that greatly simplifies the process of data type conversion and mapping the input values to properties. The framework retrieves the data, maps data to object properties, validates the data and passes the model object to the controller as parameter. Model binding creates and populates the objects that the controller actions require.</p><p>Model binding retrieves data from requests, populates controller action parameters, takes care of the property mapping and type casting typically involved in working with ASP.NET request data.</p>"
},
{
"id": 11,
"question": "What are fundamentals that a developer should consider when working to wire up model binding correctly?",
"answer": "<p>Have the corresponding properties in HTML <code><input></code> tags nested in <code><form></code> tags. Ensure that the "name" attribute matches the property in the model.</p>"
},
{
"id": 12,
"question": "What are ApiControllers?",
"answer": "<p>ApiControllers are specialized in returning data. Provide a REST-ful API by convention.</p><p>"Regular" Controller - contains ActionResult classes that return a View.</p>"
},
{
"id": 13,
"question": "When creating a new controller, what class do you inherit from?",
"answer": "<p>"regular" Controller inherits from Controller</p><p>ApiController inherits from ApiController</p>"
},
{
"id": 14,
"question": "What are the basic elements that exist in all HTML pages between the start and closing <code><html></code> tags?",
"answer": "<p>head</p><p>body</p>"
},
{
"id": 15,
"question": "Describe the relationship between HTML, CSS, and Javascript.",
"answer": "<p>HTML (Hypertext Markup Language) - used for structuring content</p><p>CSS (Cascading Style Sheets) - used for applying visual styles</p><p>Javascript - interacts with and manipulate HTML</p>"
},
{
"id": 16,
"question": "What is jQuery? Is it required to build HTML pages? Is it required to build interactivity into your web pages?",
"answer": "<p>jQuery is a concise and fast Javascript library that can be used to simplify event handling, HTML document traversing, AJAX interactions and animation for speedy website development.</p><p>No, not required for interactivity</p>"
},
{
"id": 17,
"question": "How do you capture the first time the HTML document is ready to be manipulated? Write out two different ways to accomplish this task.",
"answer": "<code>$(document).ready()</code><p>All three of the following syntaxes are equivalent:</p><ul><li><code>$(document).ready(handler)</code></li><li><code>$().ready(handler)</code>(this is not recommended)</li><li><code>$(handler)</code></li></ul>"
},
{
"id": 18,
"question": "How many times does the "document ready" event fire?",
"answer": "<p>once</p>"
},
{
"id": 19,
"question": "Describe the main differences or considerations between C# and Javascript.",
"answer": "<p>C# is strongly-typed language, and Javascript is a non-typed scripting language.</p>"
},
{
"id": 20,
"question": "What is AJAX? When do you use it? Why would you use it?",
"answer": "<p>AJAX stands for <strong>A</strong>synchronous <strong>Ja</strong>vascript and <strong>X</strong>ML.</p><p>AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.</p>"
},
{
"id": 21,
"question": "What does it mean to be a .NET MVC application?",
"answer": "<p>An application written in C# that implements the MVC design pattern, which has a high degree of separation of concern. The Model is properties of data, the Controller is business logic, and the View is for presentation.</p>"
},
{
"id": 22,
"question": "Does .NET support other types of web applications?",
"answer": "<p>Yes. Example: Web Forms (still some separation of concern, but all routing is gone)</p>"
},
{
"id": 23,
"question": "What are Namespaces? What are they used for?",
"answer": "<p>Namespaces are heavily used in C# programming in two ways. First, the .NET framework uses namespaces to organize its many classes.</p><p>Second, declaring your own namespaces can help you control the scope of class and method names in larger programming projects. Use the <code>namespace</code> keyword to declare a namespace, as in the following example:</p><pre>namespace SampleNamespace\n{\n    class SampleClass\n    {\n    }\n}</pre>"
},
{
"id": 24,
"question": "Are Namespaces a client side or server side construct?",
"answer": "<p>Both client and server side</p>"
},
{
"id": 25,
"question": "What is a database?",
"answer": "<p>A database is a collection of information that is organized so that it can easily be accessed, managed, and updated.</p>"
},
{
"id": 26,
"question": "What is a relational database?",
"answer": "<p>A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables.</p><p>The standard user and application program interface to a relational database is the <em>structured query language</em> (SQL). SQL statements are used both for interactive queries for information from a relational database and for gathering data for reports.</p>"
},
{
"id": 27,
"question": "What is a database "table"?",
"answer": "<p>A table contains one or more data categories in columns. Each row contains a unique instance of data for the categories defined by the columns.</p>"
},
{
"id": 28,
"question": "What is a primary key?",
"answer": "<p>The PRIMARY KEY constraint uniquely identifies each record in a database table. A primary key column cannot contain NULL values. Most tables should have a primary key, and each table can have only ONE primary key.</p><p>Column or set of columns that uniquely identifies a record.</p>"
},
{
"id": 29,
"question": "What is a foreign key?",
"answer": "<p>A FOREIGN KEY in one table points to a PRIMARY KEY in another table.</p>"
},
{
"id": 30,
"question": "How many of each can one table have?",
"answer": "<p>primary key: one</p><p>foreign key: Microsoft says, "Although a table can contain an unlimited number of FOREIGN KEY constraints, the recommended maximum is 253. Depending on the hardware configuration hosting SQL Server, specifying additional FOREIGN KEY constraints may be expensive for the query optimizer to process."</p>"
},
{
"id": 31,
"question": "What is a SQL Injection Attack?",
"answer": "<p>SQL injection is an attack in which malicious code is inserted into strings that are later passed to an instance of SQL Server for parsing and execution in order to effect the execution of predefined SQL commands.</p><p>A SQL injection attack is a form of attack that comes from user input that has not been checked to see that it is valid. The objective is to fool the database system into running malicious code that will reveal sensitive information or otherwise compromise the server.</p>"
},
{
"id": 32,
"question": "How do you protect yourself against SQL injection attacks?",
"answer": "<p>Using a combination of stored procedures and parameters. Stored procedures alone will not protect against SQL injection attacks because you still need to use them correctly.</p>"
},
{
"id": 33,
"question": "What is a SQL Server stored procedure?",
"answer": "<p>Prepared SQL code that you save to perform repetitive tasks or to perform database operations used in conjunction with web applications.</p>"
},
{
"id": 34,
"question": "What language is used to write stored procedures?",
"answer": "<p>SQL & T-SQL</p>"
},
{
"id": 35,
"question": "What language do you use to communicate with the database?",
"answer": "<p>SQL</p>"
},
{
"id": 36,
"question": "What is the generic name of the library used in .NET that is used to communicate with databases?",
"answer": "<p>ADO.NET</p>"
},
{
"id": 37,
"question": "What are the .NET objects and classes used to communicate and execute commands at the database?",
"answer": "<ul><li>The SqlConnection Object</li><li>The SqlCommand Object</li><li>The SqlDataReader Object</li><li>The DataSet Object</li><li>The SqlDataAdapter Object</li><li>The SqlParameter Object</li></ul>"
},
{
"id": 38,
"question": "What are the different types of statements available to you in T-SQL?",
"answer": "<ul><li>UPDATE</li><li>INSERT</li><li>SELECT</li><li>DELETE</li></ul>"
},
{
"id": 39,
"question": "What are indexes?",
"answer": "<p>Indexes are created on columns in tables or views. The index provides a fast way to look up data based on the values within those columns. For example, if you create an index on the primary key and then search for a row of data based on one of the primary key values, SQL Server first finds that value in the index, and then uses the index to quickly locate the entire row of data. Without the index, a table scan would have to be performed in order to locate the row, which can have a significant effect on performance. You would add indexes to columns that you would filter or join off of.</p>"
},
{
"id": 40,
"question": "If you wanted to delete information from a table, what statement would you use?",
"answer": "<code>DELETE FROM [Table_name]<br>(WHERE condition)</code>"
},
{
"id": 41,
"question": "What is the truncate statement used for? What is the key difference between this and your other options to remove data?",
"answer": "<p>Removes all rows from a table without logging the individual row deletions. <code>TRUNCATE TABLE</code> is similar to the <code>DELETE</code> statement (with no <code>WHERE</code> clause); however, <code>TRUNCATE TABLE</code> is faster and uses fewer system and transaction log resources.</p>"
},
{
"id": 42,
"question": "What are the basic parts of a simple T-SQL query?",
"answer": "<pre>SELECT [<em>column</em>]\nFROM [<em>table</em>]"
},
{
"id": 43,
"question": "When are "Joins" used?",
"answer": "SQL joins are used to combine rows from two or more tables."
},
{
"id": 44,
"question": "What are the different type of Joins?",
"answer": "<p>INNER JOIN: Returns all rows when there is at least one match in BOTH tables</p><p>LEFT JOIN: Return all rows from the left table, and the matched rows from the right table</p><p>RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table</p><p>FULL JOIN: Return all rows when there is a match in ONE of the tables</p>"
},
{
"id": 45,
"question": "What is data normalization?",
"answer": "<p>Database normalization, or data normalization, is a technique to organize the contents of the tables for transactional databases and data warehouses - to avoid redundancy. When you normalize a database, you have four goals:</p><ol><li>arranging data into logical groupings such that each group describes a small part of the whole</li><li>minimizing the amount of duplicate data stored in a database</li><li>organizing the data such that, when you modify it, you make the change in only one place</li><li>building a database in which you can access and manipulate the data quickly and efficiently without compromising the integrity of the data in storage</li></ol><p>Normalization is usually for minimizing errors and data duplication, to <em>de</em>normalize is for reporting.</p>"
},
{
"id": 46,
"question": "Why would we go through the process of normalizing our data?",
"answer": "<p>Normalization is part of successful database design; without normalization, database systems can be inaccurate, slow, and inefficient, and they might not produce the data you expect.</p>"
},
{
"id": 47,
"question": "How many normal forms are there?",
"answer": "<p>five (Follow-up explanation: The normal forms defined in relational database theory represent guidelines for record design in coherence with data normalization. <a href='http://www.bkent.net/Doc/simple5.htm' target='_blank'>http://www.bkent.net/Doc/simple5.htm</a>)</p>"
},
{
"id": 48,
"question": "What are cookies? What are they used for?",
"answer": "<p>A very small text file placed on your hard drive by a web page server. It is essentially your identification card. In this file, various information can be stored, from pages visited on the site, to information voluntarily given to the site.</p><p>Used to keep track of your movements within the site, help you resume where you left off, remember your registered login (authentication), theme selection, preferences, and other customization functions.</p>"
},
{
"id": 49,
"question": "As a developer, where can you find the cookies you have per site/URL?",
"answer": "<p>They can be seen in 1 of several places in your developer tools. You could download cookie Chrome extensions to manage and view easier.</p>"
},
{
"id": 50,
"question": "How does your browser manage cookies across all the sites you visit?",
"answer": "<p>At the domain.</p>"
},
{
"id": 51,
"question": "Describe the Request-Response lifecycle of a typical request made by your browser.",
"answer": "<ol><li>A Request (which contains the HTTP request method, cookies, URL, and data all inside headers) is made to the web server.</li><li>When it gets to the web server, the domain portion of the URL is used to route the request to a web application.</li><li>Inside the web application, the router takes over and matches the route and the HTTP method from the route table to an endpoint.</li><li>If the method takes non-model parameters, the parameters are also considered in routing.</li><li>Authentication then Authorization of the request takes place.</li><li>Model binding/parameter binding takes place.</li><li>It proceeds to send data to the specific method in the controller and it completes the request by sending an appropriate response to the browser. (discuss possible things that can happen inside the MiC [endpoint] i.e. model-validation, service calls)</li></ol>"
}
]