{ "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
const results = [1.32, 2.43, 3.9]\n  .map(Math.floor);\nconsole.log(results);1.32 2.43 3.9['1.32', '2.43', '3.9'][1, 2, 3]'1 2 3'Math.floor 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?\nconst results = ['a', 'b', 'c']\n  .map(a => [a.toUpperCase()]);\nconsole.log(results);[['A'], ['B'], ['C']]['A', 'B', 'C']['a', 'b', 'c]'ABC'[['A'], ['B'], ['C']]"
        },
        {
          "subtitle": "Maps on Maps",
          "question": "What will the following code print out?\nconst 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);[[0, 1], [0, 0], [1, 1]][[0, 0], [0, -1], [1, 2]][1, 1, 2][0, -1, 3][4, 1].  Our first map callback will run a mod 2 map function over [4, 1] leaving us with a new array of [0, 1].  The second map call which is inside our callback will subtract 1 from every element, leaving us with [3, 0].  Last, we take element at index 0, 0, and add it to element of index 1 from our second map function, 0, 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: [1, [2, 0], [3, 3]].  We simply keep doing that logic for the other elements until we finish: [1, -1, [3, 3]], and [1, -1, 3]"
        },
        {
          "subtitle": "Words Containing 'a'",
          "question": "What will the following code print out?\nconst results = ['apple', 'dog', 'cat']\n  .map((a, i) => \n    a.indexOf('a') !== -1 ? i : null)\nconsole.log(results);[0, -1, 1][0, null, 2][null, null, null][-1, null, 2]const results = [1, 2, 3]\n  .map((a, _, o) => a + o[0])\nconsole.log(results);[1, 2, 3][0, 0, 0][3, 2, 1][2, 3, 4]const results = [8, 5, 3]\n  .map((a, i, o) => o[o.length - i - 1])\nconsole.log(results);[3, 5, 8][5, 3, 8][8, 5, 3][3, 8, 5]const results = ['a', 'b', 'c']\n  .map(function(a) { return this[a]; }, {a: 9, b: 3, c: 1})\nconsole.log(results);['a', 'b', 'c'][9, 3, 1][3, 9, 1][{a: 9}, {b: 3}, {c: 1}]const results = [1, 2, 3, 4, 5]\n  .map((a, _, o) => o.reverse() && a)\nconsole.log(results);[5, 4, 3, 2, 1][5, 2, 3, 5, 1][1, 2, 3, 4, 5][1, 4, 3, 2, 5]truefalseBubble SortQuickSortHeapSortBranch SortCreate, Read, Update, DeleteCopy, Reduce, Update, DefineCreate, Rich, Unique, DocumentCancel, Reduce, Unify, DisposeByte - 8 bits, long - 64 bits,int - 32 bits, short - 16 bits.Byte - 8 bits, long - 32 bits ,int - 64 bits, short - 16 bits.Byte - 8 bits, long - 16 bits ,int - 32 bits, short - 64 bits.Byte - 32 bits, long - 8 bits ,int - 64 bits, short - 16 bits.MeanStack - View - ClassModal - Vector - ControllModel - View - ControllerMapped - Volume - ContentXMLJSONXtendTextOnly return after an enclosed inner function has returnedContain 'Blocking' code which can affect the stability of the programModify some kind of state outside of its own scope such as a global variable or change the value of its own arguments.Have high algorithm complexity.HTTP requestsAlgorithmsInheritanceConsuming API'sC#JavaCobolPHPBooleanCharacterArrayNullProceduralImperativeDeclarativeInstanceCreating database schemas.Software visualization using diagrams.Simplifying multi language software applications.Integration of cross-platform systems on one network.overflow, left or right margins", "
border-radius, z-index", "
font-size, animation", "
width, top or bottom margins" ], "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
.test > div {\n...\n}Selects all divs within elements with the class of test.Selects all divs outside of elements with the class of test.Selects only divs that are immediate children of elements with the class of test.This would not be considered a valid selector.<div class='test'>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n<div class='box'>\n<div class='content'>...</div>\n</div>\n</div>*override*overrideAll!vital!importantLessSassStylusExpressBorderPaddingMarginOutlinetruefalseBodyUniversalWildcardSelectAll*{}. 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": [
            "em%tppxAllows transparency of an element.Prevents prior properties of the selector from taking effect.Positions an element clear of a siblings margins and borders.Sets which sides of an element floating elements are not allowed to be floated.ul:first-childul..first-childul::first-childul first-child::before and ::after which are examples of content.
 .container div p {
position: relative;
width: 300px;
margin: auto;
color: #ffffff;
}Base-BlockSelection PropertiesSelector GroupRuleset-webkit--win--moz--o--win- is incorrect, -webkit- (Chrome, Safari, ioS and modern versions of Opera), -moz- (Firefox), -o- (Older versions of Opera), the other would be -ms- used for (IE and Microsoft Edge)."
        },
        {
          "subtitle": "CSS 'text-transform' property",
          "question": "The Css property 'text-transform' is mainly used for?",
          "choices": [
            "Alteration of text letter case.Changing the alignment of text.Increase/Decrease font size.Transformation of font family.12.5px9px18px6pxfont-weight: 400;font-weight: 900font-weight: 700font-weight: 500
.testDiv {
width: 20%;
height: 20%;
content: 'add this text'
}NothingAppended to any text contained in element with class of testDiv.Prepended to any text contained in element with class of testDiv.Overwrite any text contained in element with class of testDiv.::after or ::before eg:.testDiv {
width: 20%;
height: 20%;\n}\n.testDiv::after {\ncontent: 'add this text'\n}"
        },
        {
          "subtitle": "CSS match selector",
          "question": "What would the following Css selector match?section + p",
          "choices": [
            "All <section> and <p> tags.All <p> tags within a <section> tag.All <p> tags placed immediately after a <section> tag.Not a valid selector.<p>First Paragraph</p>
<section>...</section>
<p>Second Paragraph</p>
<p>Third Paragraph</p>1234[role=contentinfo] {...} target in Css?",
          "choices": [
            "Any element with the role attribute of contentinfo.Any element within a <span> tag.Any element within a <span> tag with the role attribute of contentinfo.This would only be valid using Sass or Scss.AbsoluteStaticResponsiveinheritpop()unshift()split()every()split() is a string methodpop() removes from the end of an arrayunshift() adds to the front of an arrayevery() 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": [
            "TrueFalseBefore declaring a variableAt the start of a script or functionIt is used inline within an HTML elementWithin a Css selectorconst x = '7'
const y = 7
console.log(x == y)",
          "choices": [
            "truefalseNaNundefinedrequire() function?",
          "choices": [
            "Vanilla JavascriptReact.jsNode.jsJqueryrequire() 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": [
            "To reduce the algorithm complexity of the function.To terminate the recursion.To keep track of each invocation of the function on the stack.To return null.JqueryReactAngularEmberfunction multiply(num1, num2) {
return
num1 * num2;
}
multiply(4,6)",
          "choices": [
            "TrueFalseLoopback functionHigher-order functionRecursive functionPure FunctiontruefalseConfirm BoxAlert BoxMessage BoxPrompt BoxForWhileNextDo-While\nconsole.log( 4 + 4 + \"2\" );",
          "choices": [
            "\"82\"1082\"10\"\nconsole.log( \"3\" + 6 + 6 );",
          "choices": [
            "15\"15\"\"366\"366To Handle synchronous code one line at a time in the main script.To remove any blocking functions accidently pushed on to the call stack.To constantly monitor if the call stack is empty and then invoke any asynchronous functions from the event queue.A mechanism to best decide how to terminate any looping structure.console.log(typeof(NaN)) Will log?",
          "choices": [
            "falsenullnumberundefined
let x = 'teststring';
console.log([...x]);[\"t\",\"e\",\"s\",\"t\",\"s\",\"t\",\"r\",\"i\",\"n\",\"g\"]uncaught syntax error[\"teststring\"]t e s t s t r i n gx.split(\"\")"
        },
        {
          "subtitle": "ES6 let / const declarations",
          "question": "What will the following code log?
function myFunction() {
const a = 'variableA'
if( 3 > 1) {
let b = 'variableB'
}
console.log(a)
console.log(b)
}
myFunction();variableA, variableBvariableAvariableB, variableAvariableA, Uncaught ReferenceError: b is not defined
function getsum(num1 = 1, num2 = 1) {
return num1 + num2;
}
getsum(3);4625truefalseMAC Address", "
IPv4 Address", "
IPv6 Address", "
A wireless protocol" ], "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": [ "
Application", "
Presentation", "
Session", "
Protocol", "
Network", "
Data Link", "
Physical" ], "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": [ "
Wireless standards", "
Password policies", "
Remote access", "
Fault tolerance" ], "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": [ "
Upgrade required", "
Not found", "
Gateway Timeout", "
No Response" ], "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": [ "
Internal Server Error", "
Proxy Authentication Required", "
Upgrade Required", "
Too Many Requests" ], "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": [ "
HEAD", "
PUT", "
BODY", "
DELETE" ], "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": [ "
172.0.0.1", "
127.0.0.1", "
10.0.0.0", "
192.168.0.0" ], "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": [ "
Network topologies", "
Security Protocols for mobile development", "
Restful API's", "
File server storage methods" ], "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": [ "
254432321LANMANPANNANTo hide the id of a wireless access point.To identyfy the extended and host address.To encrypt the broadcasting of ip addresses.To connect to a vpn.Network Isolated ConnectionNetwork Interconnect CablesNetwork Interface CardNetwork Interference CausetruefalseReassigning ip addresses.Tool for masking ip adresses.Monitoring network traffic.Identify address information of a machine on a network.The logical state of a network.A loss of data expected in transfer over a network.A measure of time delay between request and response experienced by a system.The scope for expanding a network.Two way data transfer but not at the same time.Two way data transfer simultaneously.One way data transfer at high speed.One way data transfer with encryption