freeCodeCamp/curriculum/formattingConversion/system-design-and-concept-q...

974 lines
55 KiB
JSON

{
"name": "System Design and Concept Questions",
"order": 3,
"time": "",
"helpRoom": "HelpJavaScript",
"challenges": [
{
"id": "59874fc749228906236a3275",
"title": "Array.prototype.map",
"description": [
{
"subtitle": "Flooring an Array",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = [1.32, 2.43, 3.9]\n .map(Math.floor);\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>1.32 2.43 3.9</code></pre>",
"<pre><code class='language-javascript'>['1.32', '2.43', '3.9']</code></pre>",
"<pre><code class='language-javascript'>[1, 2, 3]</code></pre>",
"<pre><code class='language-javascript'>'1 2 3'</code></pre>"
],
"answer": 2,
"explanation": "The map function takes a callback function as it's first parameter and applies that function against every value inside the array. In this example, our callback function is the <code>Math.floor</code> function which will truncate the decimal points of all the numbers and convert them to integers."
},
{
"subtitle": "Custom Map Functions",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = ['a', 'b', 'c']\n .map(a => [a.toUpperCase()]);\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[['A'], ['B'], ['C']]</code></pre>",
"<pre><code class='language-javascript'>['A', 'B', 'C']</code></pre>",
"<pre><code class='language-javascript'>['a', 'b', 'c]</code></pre>",
"<pre><code class='language-javascript'>'ABC'</code></pre>"
],
"answer": 0,
"explanation": "The map function will return a new array with each element equal to the old element ran through a callback function. Our callback function takes our original element, changes it to a upper case, and then wraps it in an array; thus, leaving us with <code>[['A'], ['B'], ['C']]</code>"
},
{
"subtitle": "Maps on Maps",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = [[4, 1], [2, 0], [3, 3]]\n .map(a => \n a.map(b => b % 2)[0] + a.map(b => b - 1)[1]\n )\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[[0, 1], [0, 0], [1, 1]]</code></pre>",
"<pre><code class='language-javascript'>[[0, 0], [0, -1], [1, 2]]</code></pre>",
"<pre><code class='language-javascript'>[1, 1, 2]</code></pre>",
"<pre><code class='language-javascript'>[0, -1, 3]</code></pre>"
],
"answer": 3,
"explanation": "This answer can be explained by first looking at the example of what happens with the first element in our array, <code>[4, 1]</code>. Our first map callback will run a mod 2 map function over <code>[4, 1]</code> leaving us with a new array of <code>[0, 1]</code>. The second map call which is inside our callback will subtract 1 from every element, leaving us with <code>[3, 0]</code>. Last, we take element at index 0, <code>0</code>, and add it to element of index 1 from our second map function, <code>0</code>, leaving us with 0; thus, after the first iteration of the top level map function, we are left with an array that looks like so: <code>[1, [2, 0], [3, 3]]</code>. We simply keep doing that logic for the other elements until we finish: <code>[1, -1, [3, 3]]</code>, and <code>[1, -1, 3]</code>"
},
{
"subtitle": "Words Containing 'a'",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = ['apple', 'dog', 'cat']\n .map((a, i) => \n a.indexOf('a') !== -1 ? i : null)\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[0, -1, 1]</code></pre>",
"<pre><code class='language-javascript'>[0, null, 2]</code></pre>",
"<pre><code class='language-javascript'>[null, null, null]</code></pre>",
"<pre><code class='language-javascript'>[-1, null, 2]</code></pre>"
],
"answer": 1,
"explanation": "This map example will return an array where each elements of the new array is either the original array index when the element contains the character 'a'; otherwise, an element of null for any words that do not have the character 'a'."
},
{
"subtitle": "Accessing the Original Array Elements",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = [1, 2, 3]\n .map((a, _, o) => a + o[0])\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[1, 2, 3]</code></pre>",
"<pre><code class='language-javascript'>[0, 0, 0]</code></pre>",
"<pre><code class='language-javascript'>[3, 2, 1]</code></pre>",
"<pre><code class='language-javascript'>[2, 3, 4]</code></pre>"
],
"answer": 3,
"explanation": "This map example will add the value of the first element in the original array to all the other elements in the array."
},
{
"subtitle": "More Map Hacking",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = [8, 5, 3]\n .map((a, i, o) => o[o.length - i - 1])\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[3, 5, 8]</code></pre>",
"<pre><code class='language-javascript'>[5, 3, 8]</code></pre>",
"<pre><code class='language-javascript'>[8, 5, 3]</code></pre>",
"<pre><code class='language-javascript'>[3, 8, 5]</code></pre>"
],
"answer": 0,
"explanation": "This map example will reverse the array. The third argument to the map callback function is the original array; therefore, we can use the current index in the map function, and work our way backwards from the end of the array using the o.length."
},
{
"subtitle": "Custom Scoping",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = ['a', 'b', 'c']\n .map(function(a) { return this[a]; }, {a: 9, b: 3, c: 1})\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>['a', 'b', 'c']</code></pre>",
"<pre><code class='language-javascript'>[9, 3, 1]</code></pre>",
"<pre><code class='language-javascript'>[3, 9, 1]</code></pre>",
"<pre><code class='language-javascript'>[{a: 9}, {b: 3}, {c: 1}]</code></pre>"
],
"answer": 1,
"explanation": "This map example will reverse the array. The third argument to the map callback function is the original array; therefore, we can use the current index in the map function, and work our way backwards from the end of the array using the o.length."
},
{
"subtitle": "Reversing in Map, Just Because",
"question": "What will the following code print out?\n<pre><code class='language-javascript'>const results = [1, 2, 3, 4, 5]\n .map((a, _, o) => o.reverse() && a)\nconsole.log(results);</code></pre>",
"choices": [
"<pre><code class='language-javascript'>[5, 4, 3, 2, 1]</code></pre>",
"<pre><code class='language-javascript'>[5, 2, 3, 5, 1]</code></pre>",
"<pre><code class='language-javascript'>[1, 2, 3, 4, 5]</code></pre>",
"<pre><code class='language-javascript'>[1, 4, 3, 2, 5]</code></pre>"
],
"answer": 3,
"explanation": "This map example will reverse the array. The third argument to the map callback function is the original array; therefore, we can use the current index in the map function, and work our way backwards from the end of the array using the o.length."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a916843a9178457a6f1281f",
"title": "General questions",
"description": [
{
"subtitle": "Data structure stack",
"question": "A stack data structure obeys the principles of Last in First Out (LIFO)? True or false.",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>"
],
"answer": 0,
"explanation": "true"
},
{
"subtitle": "Sorting algorithm",
"question": "Which of the following is not a common sorting algorithm?",
"choices": [
"<pre><code class='language-javascript'>Bubble Sort</code></pre>",
"<pre><code class='language-javascript'>QuickSort</code></pre>",
"<pre><code class='language-javascript'>HeapSort</code></pre>",
"<pre><code class='language-javascript'>Branch Sort</code></pre>"
],
"answer": 3,
"explanation": "Branch sort is not a sorting algorithm"
},
{
"subtitle": "Persistent storage",
"question": "CRUD operation stand for ?",
"choices": [
"<pre><code class='language-javascript'>Create, Read, Update, Delete</code></pre>",
"<pre><code class='language-javascript'>Copy, Reduce, Update, Define</code></pre>",
"<pre><code class='language-javascript'>Create, Rich, Unique, Document</code></pre>",
"<pre><code class='language-javascript'>Cancel, Reduce, Unify, Dispose</code></pre>"
],
"answer": 0,
"explanation": "CRUD stands for Create - Read - Update and Delete and are the four basic operations of persistent storage"
},
{
"subtitle": "Numeric types",
"question": "Match the correct numeric types to their correct size.",
"choices": [
"<pre><code class='language-javascript'>Byte - 8 bits, long - 64 bits,int - 32 bits, short - 16 bits.</code></pre>",
"<pre><code class='language-javascript'>Byte - 8 bits, long - 32 bits ,int - 64 bits, short - 16 bits.</code></pre>",
"<pre><code class='language-javascript'>Byte - 8 bits, long - 16 bits ,int - 32 bits, short - 64 bits.</code></pre>",
"<pre><code class='language-javascript'>Byte - 32 bits, long - 8 bits ,int - 64 bits, short - 16 bits.</code></pre>"
],
"answer": 0,
"explanation": "byte 8 bits, short 16 bits, int 32 bits, long 64 bits."
},
{
"subtitle": "Software architecture pattern",
"question": "The MVC software architectural pattern stands for ?",
"choices": [
"<pre><code class='language-javascript'>MeanStack - View - Class</code></pre>",
"<pre><code class='language-javascript'>Modal - Vector - Control</code></pre>",
"<pre><code class='language-javascript'>Model - View - Controller</code></pre>",
"<pre><code class='language-javascript'>Mapped - Volume - Content</code></pre>"
],
"answer": 2,
"explanation": "The MVC pattern is used to keep separate three main components of an application, the idea being for example the data or 'Model' does not need to know what the 'View' or presentation of that data is doing and vice versa, with the 'Controller' handling any logic or input from the user to manipulate the 'Model'."
},
{
"subtitle": "XPath navigation",
"question": "The XPath syntax is used to traverse data stored in which format?",
"choices": [
"<pre><code class='language-javascript'>XML</code></pre>",
"<pre><code class='language-javascript'>JSON</code></pre>",
"<pre><code class='language-javascript'>Xtend</code></pre>",
"<pre><code class='language-javascript'>Text</code></pre>"
],
"answer": 0,
"explanation": "is used to navigate nodes and attributes within an XML document and stands for XML Path Language."
},
{
"subtitle": "Functions and side effects",
"question": "If a function is said to have side-effects it is expected to ?",
"choices": [
"<pre><code class='language-javascript'>Only return after an enclosed inner function has returned</code></pre>",
"<pre><code class='language-javascript'>Contain 'Blocking' code which can affect the stability of the program</code></pre>",
"<pre><code class='language-javascript'>Modify some kind of state outside of its own scope such as a global variable or change the value of its own arguments.</code></pre>",
"<pre><code class='language-javascript'>Have high algorithm complexity.</code></pre>"
],
"answer": 2,
"explanation": "Other charateristics of side-effects would be writing data to the log, interacting with users or systems on the same network and calling other functions with side-effects."
},
{
"subtitle": "Time-Complexity",
"question": "The term 'Time-Complexity' relates to ?",
"choices": [
"<pre><code class='language-javascript'>HTTP requests</code></pre>",
"<pre><code class='language-javascript'>Algorithms</code></pre>",
"<pre><code class='language-javascript'>Inheritance</code></pre>",
"<pre><code class='language-javascript'>Consuming API's</code></pre>"
],
"answer": 1,
"explanation": "Algorithm Time-Complexity is the total amount of time needed for an algorithm to run till full completion and is more often expressed with 'big-O-notation'."
},
{
"subtitle": "Find the odd",
"question": "Which of the following programming languages is the odd one out ?",
"choices": [
"<pre><code class='language-javascript'>C#</code></pre>",
"<pre><code class='language-javascript'>Java</code></pre>",
"<pre><code class='language-javascript'>Cobol</code></pre>",
"<pre><code class='language-javascript'>PHP</code></pre>"
],
"answer": 3,
"explanation": "PHP is generally referred to as an interpreted language where as the other three are considered languages generally processed by compilers."
},
{
"subtitle": "Find the odd, again",
"question": "Which in the following list is the odd one out ?",
"choices": [
"<pre><code class='language-javascript'>Boolean</code></pre>",
"<pre><code class='language-javascript'>Character</code></pre>",
"<pre><code class='language-javascript'>Array</code></pre>",
"<pre><code class='language-javascript'>Null</code></pre>"
],
"answer": 2,
"explanation": "An array in most languages is considered an object where as the other three are primitive data types."
},
{
"subtitle": "Programming language paradigms",
"question": "Object-oriented and Functional are said to be programming language paradigms. Which of the following isn't a language paradigm?"
"choices": [
"<pre><code class='language-javascript'>Procedural</code></pre>",
"<pre><code class='language-javascript'>Imperative</code></pre>",
"<pre><code class='language-javascript'>Declarative</code></pre>",
"<pre><code class='language-javascript'>Instance</code></pre>"
],
"answer": 3,
"explanation": "Instance is not a recognized programming paradigm."
},
{
"subtitle": "UML",
"question": "UML or Universal Modeling Language is a language created for ?",
"choices": [
"<pre><code class='language-javascript'>Creating database schemas.</code></pre>",
"<pre><code class='language-javascript'>Software visualization using diagrams.</code></pre>",
"<pre><code class='language-javascript'>Simplifying multi language software applications.</code></pre>",
"<pre><code class='language-javascript'>Integration of cross-platform systems on one network.</code></pre>"
],
"answer": 1,
"explanation": "UML is used for software modeling in diagram form including Class diagrams, Object diagrams and Use case diagrams among others."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a91690fa9178457a6f12820",
"title": "CSS questions part 1",
"description": [
{
"subtitle": "Element properties",
"question": "Which properties do inline elements not possess under normal document flow?",
"choices": [
"<pre>overflow, left or right margins</pre>",
"<pre>border-radius, z-index</pre>",
"<pre>font-size, animation</pre>",
"<pre>width, top or bottom margins</pre>"
],
"answer": 3,
"explanation": "An inline element will only take up the width of the inner content."
},
{
"subtitle": "CSS rules",
"question": "What will the following css rule select?\n<pre><code class='language-javascript'>.test > div</code> {\n...\n}</code></pre>",
"choices": [
"<pre><code class='language-javascript'>Selects all divs within elements with the class of test.</code></pre>",
"<pre><code class='language-javascript'>Selects all divs outside of elements with the class of test.</code></pre>",
"<pre><code class='language-javascript'>Selects only divs that are immediate children of elements with the class of test.</code></pre>",
"<pre><code class='language-javascript'>This would not be considered a valid selector.</code></pre>"
],
"answer": 2,
"explanation": "eg: \n<pre><code class='language-html'>&lt;div class='test'&gt;\n&lt;div class='box'&gt;\n&lt;div class='content'&gt;...&lt;/div&gt;\n&lt;/div&gt;\n&lt;div class='box'&gt;\n&lt;div class='content'&gt;...&lt;/div&gt;\n&lt;/div&gt;\n&lt;/div&gt;</code></pre>\n\nWould target only the elements with a class of 'box' as these are the direct children of 'test'."
},
{
"subtitle": "Overriding properties",
"question": "Which keyword would you add to the end of a style rule to override another Css style for a specific element ?",
"choices": [
"<pre><code class='language-javascript'>*override</code></pre>",
"<pre><code class='language-javascript'>*overrideAll</code></pre>",
"<pre><code class='language-javascript'>!vital</code></pre>",
"<pre><code class='language-javascript'>!important</code></pre>"
],
"answer": 3,
"explanation": "For example if you wanted all the paragraph tags in a specific class to have the colour blue instead of black\n<pre><code class='language-javascript'></code>.myClass p {\ncolor: blue !important\n}</code></pre>"
},
{
"subtitle": "Preprocessor CSS",
"question": "Which is not considered a CSS preprocessor?",
"choices": [
"<pre><code class='language-javascript'>Less</code></pre>",
"<pre><code class='language-javascript'>Sass</code></pre>",
"<pre><code class='language-javascript'>Stylus</code></pre>",
"<pre><code class='language-javascript'>Express</code></pre>"
],
"answer": 3,
"explanation": "Express is an application framework for Node.js"
},
{
"subtitle": "CSS Box Model",
"question": "Which is not a property of the CSS 'Box Model'?",
"choices": [
"<pre><code class='language-javascript'>Border</code></pre>",
"<pre><code class='language-javascript'>Padding</code></pre>",
"<pre><code class='language-javascript'>Margin</code></pre>",
"<pre><code class='language-javascript'>Outline</code></pre>"
],
"answer": 3,
"explanation": "Content is the fourth property of the box model not outline."
},
{
"subtitle": "CSS positioning",
"question": "Absolute positioning in CSS removes an element from the normal document flow. True or false?",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>"
],
"answer": 0,
"explanation": "Giving an element absolute positioning removes it from the normal document flow completely allowing positioning attributes top, left, bottom."
},
{
"subtitle": "CSS selector",
"question": "With this CSS Selector it is possible to select every element in a document.",
"choices": [
"<pre><code class='language-javascript'>Body</code></pre>",
"<pre><code class='language-javascript'>Universal</code></pre>",
"<pre><code class='language-javascript'>Wildcard</code></pre>",
"<pre><code class='language-javascript'>SelectAll</code></pre>"
],
"answer": 1,
"explanation": "The Universal selector will select every element on a page and is denoted by <code>*{}</code>. note: The rule of specificity still applies, so a more specific selector can override the universal selector in a Css document."
},
{
"subtitle": "Font size in CSS",
"question": "Which is not a valid CSS font size?",
"choices": [
"<pre><code class='language-javascript'>em</code></pre>",
"<pre><code class='language-javascript'>%</code></pre>",
"<pre><code class='language-javascript'>tp</code></pre>",
"<pre><code class='language-javascript'>px</code></pre>"
],
"answer": 2,
"explanation": "tp is not valid this should be pt."
},
{
"subtitle": "CSS clear property",
"question": "The CSS 'clear' property fulfills which task?",
"choices": [
"<pre><code class='language-javascript'>Allows transparency of an element.</code></pre>",
"<pre><code class='language-javascript'>Prevents prior properties of the selector from taking effect.</code></pre>",
"<pre><code class='language-javascript'>Positions an element clear of a siblings margins and borders.</code></pre>",
"<pre><code class='language-javascript'>Sets which sides of an element floating elements are not allowed to be floated.</code></pre>"
],
"answer": 3,
"explanation": "The clear property has the following values available: both, left, right, inherit, initial and none."
},
{
"subtitle": "CSS sudo-class",
"question": "An example of a sudo-class of a ul element written in CSS would be defined how?",
"choices": [
"<pre><code class='language-javascript'>ul:first-child</code></pre>",
"<pre><code class='language-javascript'>ul..first-child</code></pre>",
"<pre><code class='language-javascript'>ul::first-child</code></pre>",
"<pre><code class='language-javascript'>ul first-child</code></pre>"
],
"answer": 0,
"explanation": "First answer : Would be correct of a sudo-class.<br />Second answer : Would be an error of syntax.<br />Third answer: The double colon would be an example of a sudo element used with the likes of <code>::before</code> and <code>::after</code> which are examples of content.<br />Fourth answer : This would relate to html tag elements of which there is no first-child tag."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a91a167a9178457a6f12821",
"title": "CSS questions part 2",
"description": [
{
"subtitle": "CSS selector",
"question": "An entire CSS selector and declaration block whithin a CSS document eg:<code><br /> .container div p {<br />position: relative;<br />width: 300px;<br />margin: auto;<br />color: #ffffff;<br />}</code><br /> is referred to as?",
"choices": [
"<pre><code class='language-javascript'>Base-Block</code></pre>",
"<pre><code class='language-javascript'>Selection Properties</code></pre>",
"<pre><code class='language-javascript'>Selector Group</code></pre>",
"<pre><code class='language-javascript'>Ruleset</code></pre>"
],
"answer": 3,
"explanation": "The selectors name and properties are collectively called a Ruleset."
},
{
"subtitle": "CSS Browser compatibility",
"question": "Which is not a valid CSS prefix to ensure browser compatibility?",
"choices": [
"<pre><code class='language-javascript'>-webkit-</code></pre>",
"<pre><code class='language-javascript'>-win-</code></pre>",
"<pre><code class='language-javascript'>-moz-</code></pre>",
"<pre><code class='language-javascript'>-o-</code></pre>"
],
"answer": 1,
"explanation": "<code>-win-</code> is incorrect, <code>-webkit-</code> (Chrome, Safari, ioS and modern versions of Opera), <code>-moz-</code> (Firefox), <code>-o-</code> (Older versions of Opera), the other would be <code>-ms-</code> used for (IE and Microsoft Edge)."
},
{
"subtitle": "CSS 'text-transform' property",
"question": "The CSS property 'text-transform' is mainly used for?",
"choices": [
"<pre><code class='language-javascript'>Alteration of text letter case.</code></pre>",
"<pre><code class='language-javascript'>Changing the alignment of text.</code></pre>",
"<pre><code class='language-javascript'>Increase/Decrease font size.</code></pre>",
"<pre><code class='language-javascript'>Transformation of font family.</code></pre>"
],
"answer": 0,
"explanation": "The values for the property 'text-transform' are, capitalize, full-width, inherit, lowercase, none and uppercase."
},
{
"subtitle": "CSS font-sizes",
"question": "If the default font size for a page is 12px, What is the pixel equivalent of 1.5em?",
"choices": [
"<pre><code class='language-javascript'>12.5px</code></pre>",
"<pre><code class='language-javascript'>9px</code></pre>",
"<pre><code class='language-javascript'>18px</code></pre>",
"<pre><code class='language-javascript'>6px</code></pre>"
],
"answer": 2,
"explanation": "1em is equivalent to the base or default font size therefore (12 * 1.5 = 18)."
},
{
"subtitle": "CSS font weight",
"question": "In CSS 'font-weight: bold;' is the same as?",
"choices": [
"<pre><code class='language-javascript'>font-weight: 400;</code></pre>",
"<pre><code class='language-javascript'>font-weight: 900</code></pre>",
"<pre><code class='language-javascript'>font-weight: 700</code></pre>",
"<pre><code class='language-javascript'>font-weight: 500</code></pre>"
],
"answer": 2,
"explanation": "The keyword 'bold' is the same as the numerical value 700."
},
{
"subtitle": "CSS ruleset",
"question": "Given this ruleset <code><br />.testDiv {<br />width: 20%;<br />height: 20%;<br />content: 'add this text'<br />}</code><br />What would happen with the content properties text?",
"choices": [
"<pre><code class='language-javascript'>Nothing</code></pre>",
"<pre><code class='language-javascript'>Appended to any text contained in element with class of testDiv.</code></pre>",
"<pre><code class='language-javascript'>Prepended to any text contained in element with class of testDiv.</code></pre>",
"<pre><code class='language-javascript'>Overwrite any text contained in element with class of testDiv.</code></pre>"
],
"answer": 0,
"explanation": "Nothing would appear on the page, the content property needs to be used with sudo elements like <code>::after</code> or <code>::before</code> eg:<br /><code>.testDiv {<br />width: 20%;<br />height: 20%;\n}\n.testDiv::after {\ncontent: 'add this text'\n}</code>"
},
{
"subtitle": "CSS match selector",
"question": "What would the following CSS selector match?<br /><code>section + p</code>",
"choices": [
"<pre><code class='language-javascript'>All &lt;section&gt; and &lt;p&gt; tags.</code></pre>",
"<pre><code class='language-javascript'>All &lt;p&gt; tags within a &lt;section&gt; tag.</code></pre>",
"<pre><code class='language-javascript'>All &lt;p&gt; tags placed immediately after a &lt;section&gt; tag.</code></pre>",
"<pre><code class='language-javascript'>Not a valid selector.</code></pre>"
],
"answer": 2,
"explanation": "<pre><code class='language-javascript'>&lt;p&gt;First Paragraph&lt;/p&gt;<br />&lt;section&gt;...&lt;/section&gt;<br />&lt;p&gt;Second Paragraph&lt;/p&gt;<br />&lt;p&gt;Third Paragraph&lt;/p&gt;</code></pre><br />Only the second paragraph tag will be selected and matched."
},
{
"subtitle": "How to incorporte CSS into web document",
"question": "How many different ways is it possible to incorporate CSS into a web document?",
"choices": [
"<pre><code class='language-javascript'>1</code></pre>",
"<pre><code class='language-javascript'>2</code></pre>",
"<pre><code class='language-javascript'>3</code></pre>",
"<pre><code class='language-javascript'>4</code></pre>"
],
"answer": 2,
"explanation": "Currently CSS can be used 'Inline' as a style attribute of an Html element, 'Embedded' in a style tag of a document and 'Imported' as an external file with the link tag element."
},
{
"subtitle": "Using target in CSS",
"question": "What would <code>[role=contentinfo] {...}</code> target in CSS?",
"choices": [
"<pre><code class='language-javascript'>Any element with the role attribute of contentinfo.</code></pre>",
"<pre><code class='language-javascript'>Any element within a &lt;span&gt; tag.</code></pre>",
"<pre><code class='language-javascript'>Any element within a &lt;span&gt; tag with the role attribute of contentinfo.</code></pre>",
"<pre><code class='language-javascript'>This would only be valid using Sass or Scss.</code></pre>"
],
"answer": 0,
"explanation": "The square bracket notation is used to target elements with specific attributes."
},
{
"subtitle": "CSS positioning",
"question": "Which is not a value for 'position' in CSS?",
"choices": [
"<pre><code class='language-javascript'>Absolute</code></pre>",
"<pre><code class='language-javascript'>Static</code></pre>",
"<pre><code class='language-javascript'>Responsive</code></pre>",
"<pre><code class='language-javascript'>inherit</code></pre>"
],
"answer": 2,
"explanation": "There is no such positioning as responsive, currently there is (absolute, fixed, inherit, relative and static)."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a91b5bfa9178457a6f12822",
"title": "Javascript questions part 1",
"description": [
{
"subtitle": "JavaScript Array method",
"question": "which of the following is not an Array method?",
"choices": [
"<pre><code class='language-javascript'>pop()</code></pre>",
"<pre><code class='language-javascript'>unshift()</code></pre>",
"<pre><code class='language-javascript'>split()</code></pre>",
"<pre><code class='language-javascript'>every()</code></pre>"
],
"answer": 2,
"explanation": "<code>split()</code> is a string method<br /><code>pop()</code> removes from the end of an array<br /><code>unshift()</code> adds to the front of an array<br />and <code>every()</code> returns a true or false value for each element in an array."
},
{
"subtitle": "JavaScript ES6 feature",
"question": "ES6 Arrow functions written on one line require no return statement.",
"choices": [
"<pre><code class='language-javascript'>True</code></pre>",
"<pre><code class='language-javascript'>False</code></pre>"
],
"answer": 0,
"explanation": "True"
},
{
"subtitle": "JavaScript strict syntax",
"question": "Where is the correct place to insert the \"use strict\" expression.",
"choices": [
"<pre><code class='language-javascript'>Before declaring a variable</code></pre>",
"<pre><code class='language-javascript'>At the start of a script or function</code></pre>",
"<pre><code class='language-javascript'>It is used inline within an HTML element</code></pre>",
"<pre><code class='language-javascript'>Within a Css selector</code></pre>"
],
"answer": 1,
"explanation": "The \"use strict\"; expression should be placed at the start of a script for global scope or\nwithin a function for local scope."
},
{
"subtitle": "JavaScript equality",
"question": "The following code will output?<br /><code>const x = '7'<br />const y = 7<br />console.log(x == y)</code>",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>",
"<pre><code class='language-javascript'>NaN</code></pre>",
"<pre><code class='language-javascript'>undefined</code></pre>"
],
"answer": 0,
"explanation": "true, if triple equals '===' was used it would then evaluate to false."
},
{
"subtitle": "JavaScript modules",
"question": "In which of the following can you expect to see the <code>require()</code> function?",
"choices": [
"<pre><code class='language-javascript'>Vanilla Javascript</code></pre>",
"<pre><code class='language-javascript'>React.js</code></pre>",
"<pre><code class='language-javascript'>Node.js</code></pre>",
"<pre><code class='language-javascript'>Jquery</code></pre>"
],
"answer": 2,
"explanation": "<code>require()</code> is built into Node.js in order to load modules for use with an application."
},
{
"subtitle": "JavaScript recursive methods",
"question": "What is the main function or job of a 'base case' in a typical recursive method ?",
"choices": [
"<pre><code class='language-javascript'>To reduce the algorithm complexity of the function.</code></pre>",
"<pre><code class='language-javascript'>To terminate the recursion.</code></pre>",
"<pre><code class='language-javascript'>To keep track of each invocation of the function on the stack.</code></pre>",
"<pre><code class='language-javascript'>To return null.</code></pre>"
],
"answer": 1,
"explanation": "To allow the recursive function to terminate and inititate the popping off of the stack of each function call pushed upon it."
},
{
"subtitle": "JavaScript framework",
"question": "In which Javascript framework will you find the ng style of attributes?",
"choices": [
"<pre><code class='language-javascript'>Jquery</code></pre>",
"<pre><code class='language-javascript'>React</code></pre>",
"<pre><code class='language-javascript'>Angular</code></pre>",
"<pre><code class='language-javascript'>Ember</code></pre>"
],
"answer": 2,
"explanation": "The ng- style prefix is used to denote an angularJS directive."
},
{
"subtitle": "JavaScript syntax",
"question": "The following code will return 24 true or false?<br /><code>function multiply(num1, num2) {<br />return<br />num1 * num2;<br />}<br />multiply(4,6)</code>",
"choices": [
"<pre><code class='language-javascript'>True</code></pre>",
"<pre><code class='language-javascript'>False</code></pre>"
],
"answer": 1,
"explanation": "The function will return undefined before it reaches the multiplication of the two arguments."
},
{
"subtitle": "JavaScript callback",
"question": "A callback function is also known as?",
"choices": [
"<pre><code class='language-javascript'>Loopback function</code></pre>",
"<pre><code class='language-javascript'>Higher-order function</code></pre>",
"<pre><code class='language-javascript'>Recursive function</code></pre>",
"<pre><code class='language-javascript'>Pure Function</code></pre>"
],
"answer": 1,
"explanation": "Also Known as a Higher-order function a callback function can be passed to another function as a parameter and is called inside that function."
},
{
"subtitle": "JavaScript syntax, again",
"question": "Javascript is case sensitive true or false?",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>"
],
"answer": 0,
"explanation": "true"
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a92c913a9178457a6f12823",
"title": "Javascript questions part 2",
"description": [
{
"subtitle": "JavaScript pop up",
"question": "Which is not a pop up box in JavaScript",
"choices": [
"<pre><code class='language-javascript'>Confirm Box</code></pre>",
"<pre><code class='language-javascript'>Alert Box</code></pre>",
"<pre><code class='language-javascript'>Message Box</code></pre>",
"<pre><code class='language-javascript'>Prompt Box</code></pre>"
],
"answer": 2,
"explanation": "Message Box."
},
{
"subtitle": "JavaScript Loops",
"question": "Which of the following is not a looping format in javascript",
"choices": [
"<pre><code class='language-javascript'>For</code></pre>",
"<pre><code class='language-javascript'>While</code></pre>",
"<pre><code class='language-javascript'>Next</code></pre>",
"<pre><code class='language-javascript'>Do-While</code></pre>"
],
"answer": 2,
"explanation": "Next is not a loop available in javascript."
},
{
"subtitle": "JavaScript types",
"question": "What is the result of the following code?<code>\nconsole.log( 4 + 4 + \"2\" )</code>;",
"choices": [
"<pre><code class='language-javascript'>\"82\"</code></pre>",
"<pre><code class='language-javascript'>10</code></pre>",
"<pre><code class='language-javascript'>82</code></pre>",
"<pre><code class='language-javascript'>\"10\"</code></pre>"
],
"answer": 0,
"explanation": "The first two integers will be added as normal then the string will be concatenated to the result of 8 giving \"82\"."
},
{
"subtitle": "JavaScript types",
"question": "What is the result of the following code?<code>\nconsole.log( \"3\" + 6 + 6 );</code>",
"choices": [
"<pre><code class='language-javascript'>15</code></pre>",
"<pre><code class='language-javascript'>\"15\"</code></pre>",
"<pre><code class='language-javascript'>\"366\"</code></pre>",
"<pre><code class='language-javascript'>366</code></pre>"
],
"answer": 2,
"explanation": "As the equation begins with a string, each integer will be converted and appended in string form giving \"366\""
},
{
"subtitle": "JavaScript Event loop",
"question": "Which best describes the function of the Javascript event loop?",
"choices": [
"<pre><code class='language-javascript'>To Handle synchronous code one line at a time in the main script.</code></pre>",
"<pre><code class='language-javascript'>To remove any blocking functions accidentally pushed on to the call stack.</code></pre>",
"<pre><code class='language-javascript'>To constantly monitor if the call stack is empty and then invoke any asynchronous functions from the event queue.</code></pre>",
"<pre><code class='language-javascript'>A mechanism to best decide how to terminate any looping structure.</code></pre>"
],
"answer": 2,
"explanation": "Briefly the event loop constantly runs to monitor state between the callstack, the event table and the event queue. When asynchronous code is executed it\nis placed on to the event table only to be executed as and when a specific event occurs, when it does it is then placed on the event queue until the call\nstack is empty then when invoked, moved from the queue to the callstack."
},
{
"subtitle": "JavaSript type",
"question": "<code>console.log(typeof(NaN))</code> Will log?",
"choices": [
"<pre><code class='language-javascript'>false</code></pre>",
"<pre><code class='language-javascript'>null</code></pre>",
"<pre><code class='language-javascript'>number</code></pre>",
"<pre><code class='language-javascript'>undefined</code></pre>"
],
"answer": 2,
"explanation": "Despite standing for Not a Number NaN is still regarded as a numeric type."
},
{
"subtitle": "JavaScript ES6 operators",
"question": "What will the following log?<code><br />let x = 'teststring';<br />console.log([...x]);</code>",
"choices": [
"<pre><code class='language-javascript'>[\"t\",\"e\",\"s\",\"t\",\"s\",\"t\",\"r\",\"i\",\"n\",\"g\"]</code></pre>",
"<pre><code class='language-javascript'>uncaught syntax error</code></pre>",
"<pre><code class='language-javascript'>[\"teststring\"]</code></pre>",
"<pre><code class='language-javascript'>t e s t s t r i n g</code></pre>"
],
"answer": 0,
"explanation": "The spread syntax introduced in es6 can be used to iterate through each character of a string, and here stored in an array similar to calling <code>x.split(\"\")</code>"
},
{
"subtitle": "ES6 let / const declarations",
"question": "What will the following code log?<code><br />function myFunction() {<br />const a = 'variableA'<br />if( 3 > 1) {<br />let b = 'variableB'<br />}<br />console.log(a)<br />console.log(b)<br />}<br />myFunction();</code>",
"choices": [
"<pre><code class='language-javascript'>variableA, variableB</code></pre>",
"<pre><code class='language-javascript'>variableA</code></pre>",
"<pre><code class='language-javascript'>variableB, variableA</code></pre>",
"<pre><code class='language-javascript'>variableA, Uncaught ReferenceError: b is not defined</code></pre>"
],
"answer": 3,
"explanation": "Due to the keywords let and const being block scoped rather than just locally function scoped like var, the variable b will be garbage collected after the\nconditional if statement has finished and will no longer exist for the console.log() method."
},
{
"subtitle": "JavaSript function arguments",
"question": "The following code will return?<code><br />function getsum(num1 = 1, num2 = 1) {<br />return num1 + num2;<br />}<br />getsum(3);</code>",
"choices": [
"<pre><code class='language-javascript'>4</code></pre>",
"<pre><code class='language-javascript'>6</code></pre>",
"<pre><code class='language-javascript'>2</code></pre>",
"<pre><code class='language-javascript'>5</code></pre>"
],
"answer": 0,
"explanation": "Due to only one argument being passed this will override the first default parameter giving num1 the value of 3 + num2 default value of 1.\nIf the function were to be executed without any arguments at all both defaults would be used and return 2."
},
{
"subtitle": "JavaSript inheritance",
"question": "All Javascript objects inherit properties and methods from a class true or false?",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>"
],
"answer": 1,
"explanation": "Due to only one argument being passed this will override the first default parameter giving num1 the value of 3 + num2 default value of 1.\nIf the function were to be executed without any arguments at all both defaults would be used and return 2."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a933ce3a9178457a6f12824",
"title": "Networking questions part 1",
"description": [
{
"subtitle": "Address identification",
"question": "00:26:2D:55:42:1f is an example of what?",
"choices": [
"<pre>MAC Address</pre>",
"<pre>IPv4 Address</pre>",
"<pre>IPv6 Address</pre>",
"<pre>A wireless protocol</pre>"
],
"answer": 0,
"explanation": "A valid MAC Address."
},
{
"subtitle": "OSI networking model",
"question": "Which one of the following is not part of the seven layer OSI networking model.",
"choices": [
"<pre>Application</pre>",
"<pre>Presentation</pre>",
"<pre>Session</pre>",
"<pre>Protocol</pre>",
"<pre>Network</pre>",
"<pre>Data Link</pre>",
"<pre>Physical</pre>"
],
"answer": 3,
"explanation": "Protocol is not part of the OSI networking model layer 4 should be the transport layer."
},
{
"subtitle": "RAID",
"question": "In networking a RAID implementation relates to?",
"choices": [
"<pre>Wireless standards</pre>",
"<pre>Password policies</pre>",
"<pre>Remote access</pre>",
"<pre>Fault tolerance</pre>"
],
"answer": 3,
"explanation": "RAID stands for Redundant array of inexpensive disks and is a model that allows servers to\nendure the failure of one or more hard disks without interuption to services and resources."
},
{
"subtitle": "Server status",
"question": "Your console or terminal throws up a 404 error, this means?",
"choices": [
"<pre>Upgrade required</pre>",
"<pre>Not found</pre>",
"<pre>Gateway Timeout</pre>",
"<pre>No Response</pre>"
],
"answer": 1,
"explanation": "This error informs you that an internal or external resource has not been found and can not be loaded into a page or application."
},
{
"subtitle": "Server Status, again",
"question": "Your console or terminal throws up a 500 error, this means?",
"choices": [
"<pre>Internal Server Error</pre>",
"<pre>Proxy Authentication Required</pre>",
"<pre>Upgrade Required</pre>",
"<pre>Too Many Requests</pre>"
],
"answer": 0,
"explanation": "A generic error message which refers to an error on the webserver when no precise detail is available."
},
{
"subtitle": "HTTP methods",
"question": "GET and POST are important HTTP request methods which of the following list are Not an example of an HTTP request method?",
"choices": [
"<pre>HEAD</pre>",
"<pre>PUT</pre>",
"<pre>BODY</pre>",
"<pre>DELETE</pre>"
],
"answer": 2,
"explanation": "HEAD is similar to the Get method but returns no response body, PUT is used to replace and update a specified resource, DELETE will delete a resource,\nthere is no such method as a BODY request."
},
{
"subtitle": "Loopback",
"question": "In networking which of the following is considered to be a loopback ip address or 'localhost'?",
"choices": [
"<pre>172.0.0.1</pre>",
"<pre>127.0.0.1</pre>",
"<pre>10.0.0.0</pre>",
"<pre>192.168.0.0</pre>"
],
"answer": 1,
"explanation": "127.0.0.1 is the loopback address or localhost, option a is an example of a public address and options c and d are examples of private network addresses."
},
{
"subtitle": "Network & Security Architecture",
"question": "Ring, Star, Mesh and Bus are all examples of?",
"choices": [
"<pre>Network topologies</pre>",
"<pre>Security Protocols for mobile development</pre>",
"<pre>Restful API's</pre>",
"<pre>File server storage methods</pre>"
],
"answer": 0,
"explanation": "A network topology is a logical and physical layout of how the network appears to the devices using it."
}
],
"tests": [],
"challengeType": 8
},
{
"id": "5a933d04a9178457a6f12825",
"title": "Networking questions part 2",
"description": [
{
"subtitle": "Default port for FTP",
"question": "In attempting to connect to an FTP (File Transfer Protocol) server and failing, which port can you check is open to troubleshoot the connection issue?",
"choices": [
"<pre><code class='language-javascript'>25</code></pre>",
"<pre><code class='language-javascript'>443</code></pre>",
"<pre><code class='language-javascript'>23</code></pre>",
"<pre><code class='language-javascript'>21</code></pre>"
],
"answer": 3,
"explanation": "Port 21 is traditionally used as the default port on a system for FTP."
},
{
"subtitle": "Network types",
"question": "Which of the following is not a type of network?",
"choices": [
"<pre><code class='language-javascript'>LAN</code></pre>",
"<pre><code class='language-javascript'>MAN</code></pre>",
"<pre><code class='language-javascript'>PAN</code></pre>",
"<pre><code class='language-javascript'>NAN</code></pre>"
],
"answer": 3,
"explanation": "NAN is not a current network type. LAN (Local Area Network), MAN (Metropolitan Area Network), PAN (Personal Area Network)."
},
{
"subtitle": "Subnet mask usage",
"question": "What is a subnet mask used for?",
"choices": [
"<pre><code class='language-javascript'>To hide the id of a wireless access point.</code></pre>",
"<pre><code class='language-javascript'>To identyfy the extended and host address.</code></pre>",
"<pre><code class='language-javascript'>To encrypt the broadcasting of ip addresses.</code></pre>",
"<pre><code class='language-javascript'>To connect to a vpn.</code></pre>"
],
"answer": 1,
"explanation": "A subnet mask is used along side an IP address in order to isolate the extended or 'subnet' of the network address and the host machine address."
},
{
"subtitle": "Network acronym",
"question": "What does NIC stand for?",
"choices": [
"<pre><code class='language-javascript'>Network Isolated Connection</code></pre>",
"<pre><code class='language-javascript'>Network Interconnect Cables</code></pre>",
"<pre><code class='language-javascript'>Network Interface Card</code></pre>",
"<pre><code class='language-javascript'>Network Interference Cause</code></pre>"
],
"answer": 2,
"explanation": "A Network Interface Card or (Network Interface Controller) is a hardware component that connects to a Pc or printer in order to\nconnect and be identified on a network."
},
{
"subtitle": "Default gateway",
"question": "A 'default gateway' provides a way for a local network to connect to a larger external network true or false?",
"choices": [
"<pre><code class='language-javascript'>true</code></pre>",
"<pre><code class='language-javascript'>false</code></pre>"
],
"answer": 0,
"explanation": "True this is usually the address of of an external router or switch."
},
{
"subtitle": "The ipconfig commad",
"question": "'ipconfig' is used for?",
"choices": [
"<pre><code class='language-javascript'>Reassigning ip addresses.</code></pre>",
"<pre><code class='language-javascript'>Tool for masking ip adresses.</code></pre>",
"<pre><code class='language-javascript'>Monitoring network traffic.</code></pre>",
"<pre><code class='language-javascript'>Identify address information of a machine on a network.</code></pre>"
],
"answer": 3,
"explanation": "ipconfig or ifconfig(linux) is a utility for gaining various address information of a computer on a network."
},
{
"subtitle": "Network terminology",
"question": "The term 'Latency' refers to?",
"choices": [
"<pre><code class='language-javascript'>The logical state of a network.</code></pre>",
"<pre><code class='language-javascript'>A loss of data expected in transfer over a network.</code></pre>",
"<pre><code class='language-javascript'>A measure of time delay between request and response experienced by a system.</code></pre>",
"<pre><code class='language-javascript'>The scope for expanding a network.</code></pre>"
],
"answer": 2,
"explanation": "Latency can affect host to host transfers http requests etc."
},
{
"subtitle": "Network terminology, again",
"question": "The term 'full duplex' refers to?",
"choices": [
"<pre><code class='language-javascript'>Two way data transfer but not at the same time.</code></pre>",
"<pre><code class='language-javascript'>Two way data transfer simultaneously.</code></pre>",
"<pre><code class='language-javascript'>One way data transfer at high speed.</code></pre>",
"<pre><code class='language-javascript'>One way data transfer with encryption</code></pre>"
],
"answer": 1,
"explanation": "An example of full duplex would be like a telephone conversation between two people."
}
],
"tests": [],
"challengeType": 8
}
]
}