InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What does the rel attribute of a variable have when the type of file is CSS?(a) css(b) stylesheet(c) text/css(d) plainsheetThe question was asked during an online exam.I need to ask this question from Lazy Loading in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (b) stylesheet |
|
| 2. |
Which of the below does not belong to the Render Engine workflow?(a) Paint DOM elements(b) Parse Content(c) Build DOM nodes in render tree(d) Parse identifiersThis question was addressed to me in an interview.I need to ask this question from Page Render BottleNecks Optimization in section Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (d) Parse identifiers |
|
| 3. |
Which of the following layer retrieves the content from the network?(a) Transport Layer(b) Application Layer(c) Network Layer(d) Physical LayerThe question was posed to me by my school principal while I was bunking the class.My question is taken from Page Render BottleNecks Optimization topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» Right OPTION is (c) Network Layer |
|
| 4. |
What is the purpose of the property PerformanceTiming.navigationStart?(a) Ready to end the navigation(b) Ready to jump the navigation(c) Ready for navigation(d) Ready to changing the navigationThe question was posed to me during an online exam.Question is from Integrating the Performance Object with perfLogger topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Right ANSWER is (c) Ready for navigation |
|
| 5. |
What should be the value of the type attribute of a variable if the type of file is CSS?(a) text/js/css(b) text/js(c) text/css(d) textI have been asked this question in homework.This key question is from Lazy Loading in portion Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (C) text/css |
|
| 6. |
What is the purpose of garbage collection?(a) Removes object with many reference(b) Removes object with reference(c) Removes object with invalid reference(d) Removes object with no referenceThe question was posed to me by my school principal while I was bunking the class.The doubt is from Performance Navigation and Memory in section Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT answer is (d) Removes object with no reference Explanation: When the interpreter sees an object in the HEAP with no object references, it removes that object from the heap. This is called garbage collection. An object is considered garbage collectible if there are ZERO references pointing at this object. |
|
| 7. |
How many properties does a prototype object have?(a) 6(b) 7(c) 8(d) 9This question was posed to me in examination.My enquiry is from Integrating the Performance Object with perfLogger topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT option is (b) 7 For explanation I would say: The prototype is an object that is associated with every functions and objects by DEFAULT in JAVASCRIPT, where function’s prototype property is accessible and modifiable and object’s prototype property (aka attribute) is not VISIBLE. There are a total of 7 properties in the prototype object namely: perceivedTime redirectTime cacheTime dnsLookupTime tcpConnectionTime roundTripTime pageRenderTime. |
|
| 8. |
What is the purpose of the timing property in the window.performance object?(a) Time of navigation event(b) Time of page load event(c) Time of navigation and page load event(d) Time of scrollingI got this question during an internship interview.This is a very interesting question from Invocation of the Performance Object topic in division Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (c) Time of navigation and page load event |
|
| 9. |
What is the purpose of the domLoading attribute?(a) Document exists(b) Document can load(c) Document has loaded(d) Document begins to loadI got this question in class test.My question comes from Lazy Loading topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Correct OPTION is (d) Document begins to LOAD |
|
| 10. |
Which of the following are client-side JavaScript object?(a) Database(b) Cursor(c) Client(d) FileUpLoadI have been asked this question by my school principal while I was bunking the class.My doubt is from Script Loading topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» The CORRECT CHOICE is (d) FileUpLoad |
|
| 11. |
How many constant values can the property type be represented?(a) 2(b) 3(c) 4(d) 5I have been asked this question during an interview for a job.My doubt is from Performance Navigation and Memory topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (C) 4 |
|
| 12. |
Which of the following gives the high level breakdown of memory usage?(a) about:memory(b) memory(c) about-memory(d) about::memoryThe question was posed to me in an online interview.My question comes from Performance Navigation and Memory topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT option is (a) about:memory Explanation: The Memory column represents native memory. DOM NODES are stored in native memory. If this value is increasing, DOM nodes are getting CREATED. Typing about:memory into the location bar brings up a PAGE that gives a high-level breakdown of memory usage. |
|
| 13. |
Which of the following does JSON.stringify not serialize?(a) Undefined values(b) Functions within an object(c) Both Undefined values and Functions within an object(d) Functions outside the objectThis question was addressed to me at a job interview.This interesting question is from Integrating the Performance Object with perfLogger in portion Invocation and Performance Navigation of JavaScript |
|
Answer» The CORRECT ANSWER is (c) Both Undefined values and Functions WITHIN an object |
|
| 14. |
Which of the following property gives access to the JavaScript memory usage data?(a) performance.memory(b) memory(performance)(c) performance(memory)(d) performance()I have been asked this question in a national level competition.The doubt is from Invocation of the Performance Object in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (a) performance.MEMORY |
|
| 15. |
How many properties are there in the interface PerformanceTiming?(a) 21(b) 22(c) 23(d) 24The question was posed to me during an online interview.Origin of the question is Integrating the Performance Object with perfLogger in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (a) 21 |
|
| 16. |
What is the purpose of creating a data frame?(a) Hold the page render time(b) Hold the load time(c) Hold the page render time & load time(d) Hold the reload timeI have been asked this question in final exam.My doubt is from Script Loading topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT choice is (c) Hold the PAGE render time & load time For explanation: A Data FRAME is a two-dimensional data STRUCTURE, i.e., data is aligned in a tabular fashion in rows and columns. You can create a data frame to hold the mean page render times for each test URL, and a data frame to hold the mean load time for each test URL. |
|
| 17. |
What is the purpose of the navigation property in the window.performance object?(a) To which page the user navigated(b) How the user navigated(c) Information about the page(d) Information of the curserThis question was posed to me in an international level competition.This key question is from Integrating the Performance Object with perfLogger topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» The CORRECT ANSWER is (b) How the user navigated |
|
| 18. |
What is the purpose of the startTimeLogging() method?(a) Start the timer(b) Capture time logging(c) Capture timing data for referencing(d) All of the mentionedI got this question during an internship interview.The above asked question is from Script Loading in portion Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT option is (d) All of the mentioned To explain: The startTimeLogging() method CAPTURES the TIMING DATA for ad hoc, etc for referencing an uncached document.location. Once the startTimeLogging() method is called, run the code to TEST. |
|
| 19. |
What is the solution to the absence of a script tag without an src attribute?(a) Resend the scripts(b) Create inline JavaScript(c) Attach a javascript file(d) Include a fileI got this question in an interview.This intriguing question originated from Script Loading topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Correct answer is (b) Create inline JAVASCRIPT |
|
| 20. |
Which of the following runs the JavaScript code?(a) Just In Time compiler(b) JavaScript Interpreter(c) Both Just In Time compiler and JavaScript Interpreter(d) Javascript compilerThe question was posed to me in an interview for internship.My enquiry is from Page Render BottleNecks Optimization topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Right option is (B) JavaScript Interpreter |
|
| 21. |
Which of the following property indicate the total size of the heap?(a) heapSize(b) totalHeapSize(c) totalJsHeapSize(d) totalHeapThe question was asked in an interview.The query is from Performance Navigation and Memory topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (C) totalJsHeapSize |
|
| 22. |
What does the usedJsHeapSize property indicate?(a) Amount of memory used(b) Amount of memory unused(c) Amount of memory used & unused(d) Amount of memory requiredThe question was posed to me by my college director while I was bunking the class.The question is from Performance Navigation and Memory in section Invocation and Performance Navigation of JavaScript |
|
Answer» Correct answer is (a) Amount of memory used |
|
| 23. |
What does the constant TYPE_BACK_FORWRD indicate?(a) Navigation via browser history(b) Navigation via user request(c) Navigation via URL(d) Navigation via load operationI had been asked this question in my homework.The origin of the question is Performance Navigation and Memory in division Invocation and Performance Navigation of JavaScript |
|
Answer» Right OPTION is (a) Navigation via BROWSER HISTORY |
|
| 24. |
Which of the following constants has the value 255?(a) TYPE_NAVIGATE(b) TYPE_RELOAD(c) TYPE_BACK_FORWARD(d) TYPE_RESERVEDI had been asked this question in semester exam.I'd like to ask this question from Performance Navigation and Memory topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (d) TYPE_RESERVED |
|
| 25. |
When the “end” event fires on EOF when no more data will arrive, which function is called?(a) s.on(“data”,f);(b) s.on(“end”,f);(c) s.on(“error”,f);(d) s.on(“default”,f);The question was asked during a job interview.Origin of the question is Script Loading topic in division Invocation and Performance Navigation of JavaScript |
|
Answer» Right choice is (b) s.on(“end”,f); |
|
| 26. |
Which of the following navigator object properties is the same in bothNetscape and IE?(a) navigator.appCodeName(b) navigator.appName(c) navigator.appVersion(d) appcode.navigator()The question was posed to me in semester exam.My query is from Script Loading in section Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT CHOICE is (a) navigator.appCodeName The explanation is: The property navigator.appCodeName is the same in both NETSCAPE and IE. The appCodeName property returns the CODE name of the browser. |
|
| 27. |
Which of the following handles painting the content on to the screen?(a) Rendering engine(b) JavaScript Interpreter(c) UI Layer(d) Network LayerI had been asked this question during an interview.Asked question is from Page Render BottleNecks Optimization topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT answer is (a) Rendering ENGINE To elaborate: A rendering engine is a software that draws text and images on the SCREEN. The rendering engine HANDLES painting the content to the screen. When it encounters JavaScript, it hands it off to the JavaScript interpreter. |
|
| 28. |
What is the function of the memory object?(a) Gets unused memory details(b) Shows optimization(c) Gets memory usage(d) Memory optimizationThis question was addressed to me during an internship interview.This intriguing question comes from Performance Navigation and Memory in division Invocation and Performance Navigation of JavaScript |
|
Answer» The correct option is (c) Gets MEMORY USAGE |
|
| 29. |
What can be done to monitor the memory usage?(a) Profiling(b) Sequencing(c) Serializing(d) Serializing & SequencingI had been asked this question in unit test.I would like to ask this question from Performance Navigation and Memory topic in division Invocation and Performance Navigation of JavaScript |
|
Answer» Correct answer is (a) PROFILING |
|
| 30. |
The object whose properties are inherited by all instances of the class, and properties whose values are functions behaving like instance methods of the class, is _____________(a) Instance object(b) Constructor object(c) Destructor object(d) Prototype objectI had been asked this question by my school principal while I was bunking the class.My question is from Lazy Loading topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Right choice is (d) PROTOTYPE object |
|
| 31. |
What is the parameter of the method getElementsbyTagName() if we need to get an image?(a) image(b) src(c) img(d) imageurlI had been asked this question in my homework.My question is taken from Lazy Loading topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT choice is (c) img Explanation: To get the SOURCE attribute the parameter is src. The method must look LIKE getElementsbyTageName(“img”) if we need to get an IMAGE. |
|
| 32. |
Which best explains getSelection()?(a) Returns the VALUE of a selected OPTION(b) Returns document.URL of the window in focus(c) Returns the value of cursor-selected text(d) Returns the VALUE of a checked radio inputI had been asked this question during an online interview.Enquiry is from Script Loading in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Right CHOICE is (c) Returns the VALUE of cursor-selected text |
|
| 33. |
What is the default value of the asyc attribute?(a) 0(b) 1(c) False(d) TrueI got this question in an interview for internship.My doubt stems from Script Loading topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Correct answer is (d) True |
|
| 34. |
Why do we need to use an onload event in the script tag after using the async attribute?(a) Invoke code during page loading(b) Invoke code during script loading(c) Invoke code during downloading(d) Invoke code during reloadingI got this question in a job interview.Asked question is from Script Loading in section Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (c) INVOKE code during downloading |
|
| 35. |
What is the purpose of using the async attribute in the script tag?(a) Load the script asynchronously(b) Load the script synchronously(c) Load the page asynchronously(d) Load the page synchronouslyI had been asked this question in homework.This key question is from Script Loading in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT choice is (a) Load the script asynchronously To ELABORATE: The ASYNC option is a NATIVE attribute that will tell the browser to load the script asynchronously. The async attribute is a BOOLEAN attribute. When present, it specifies that the script will be executed asynchronously as soon as it is available. |
|
| 36. |
What will happen after executing the script?(a) Execute script(b) Layout positioning of DOM elements(c) Paint DOM elements(d) Build DOM nodes in render treeI got this question in an interview for job.Enquiry is from Page Render BottleNecks Optimization in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» The correct CHOICE is (d) Build DOM nodes in RENDER tree |
|
| 37. |
What is the command to access the Heap size limit?(a) performance.memory. SizeLimit(b) performance.memory. jsHeapSizeLimit(c) jsHeapSizeLimit(d) performance.jsHeapSizeLimitThis question was posed to me in an internship interview.This key question is from Performance Navigation and Memory topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» The correct ANSWER is (b) performance.memory. jsHeapSizeLimit |
|
| 38. |
What is the purpose of the constant TYPE_RELOAD?(a) Reload performed(b) Reload not performed(c) Reload must be performed(d) Reload may be performedThis question was addressed to me in an interview for internship.This intriguing question originated from Performance Navigation and Memory in portion Invocation and Performance Navigation of JavaScript |
|
Answer» CORRECT choice is (a) Reload performed The EXPLANATION is: TYPE_RELOAD: Has the VALUE of 1, indicating that the current page was ARRIVED at VIA a reload operation. TYPE_RELOAD performs navigation through the reload operation or the location.reload() method. |
|
| 39. |
How many properties are associated with the Response event?(a) 1(b) 2(c) 3(d) 4The question was asked in a national level competition.The query is from Invocation of the Performance Object in section Invocation and Performance Navigation of JavaScript |
|
Answer» The correct option is (b) 2 |
|
| 40. |
Where does the DNS reply go to in a single HTTP redirect?(a) Browser(b) Client(c) Server(d) DNS ServerThis question was posed to me in semester exam.This question is from Performance Navigation and Memory topic in division Invocation and Performance Navigation of JavaScript |
|
Answer» Right answer is (a) BROWSER |
|
| 41. |
Which of the following is a read-only property?(a) PerformanceTiming.navigationStart(b) PerformanceTiming.fetchStart(c) PerformanceTiming.navigationStart & PerformanceTiming.fetchStart(d) PerformanceTiming.responseStartThe question was asked in an internship interview.My question comes from Invocation of the Performance Object in division Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (c) PerformanceTiming.navigationStart & PerformanceTiming.fetchStart |
|
| 42. |
What does the rendering engine do when it encounters JavaScript?(a) Skips the code(b) Continues painting(c) Switches to Javascript Interpreter(d) Restructures the codeThis question was addressed to me at a job interview.My question comes from Page Render BottleNecks Optimization topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» The CORRECT answer is (c) Switches to Javascript Interpreter |
|
| 43. |
What does the appendChild() method perform?(a) Appends a node in the middle of the index taken as the parameter(b) Appends a node as the first child(c) Appends a node as the last child(d) Replaces and appends at the last nodeThe question was posed to me in an interview.The origin of the question is Lazy Loading in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» The correct answer is (c) Appends a node as the LAST CHILD |
|
| 44. |
Where is the external JavaScript placed in the case of lazy loading?(a) After window.onload event(b) Before window.onload event(c) In the header tag(d) In the HTML tagI have been asked this question in unit test.Enquiry is from Lazy Loading in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Right choice is (a) After window.onload EVENT |
|
| 45. |
What is the purpose of the method localeCompare()?(a) If the reference string comes before or after another string(b) If the reference string is validated(c) If the string is a reference string(d) If the reference string comes firstThe question was asked in an online quiz.The doubt is from Script Loading topic in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» Correct option is (a) If the reference string comes before or after another string |
|
| 46. |
What is the purpose of script loading?(a) Load Scripts programmatically(b) Load JavaScript files manually(c) Load JavaScript files programmatically(d) Load Scripts programmatically & manuallyThe question was asked during an interview.This interesting question is from Script Loading topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» The correct choice is (c) Load JAVASCRIPT files PROGRAMMATICALLY |
|
| 47. |
What is a heap in JavaScript?(a) Collection of Java objects(b) Collection of JavaScript objects(c) Collection of memory usage values(d) Collection of data stored in memoryThis question was posed to me in an interview for job.The query is from Performance Navigation and Memory topic in division Invocation and Performance Navigation of JavaScript |
|
Answer» RIGHT CHOICE is (b) Collection of JAVASCRIPT objects To EXPLAIN: A heap is a tree-like data structure where each node must be ORDERED with respect to the value of its children. The heap is the collection of JavaScript objects that the interpreter keeps in resident memory. |
|
| 48. |
How many properties are available in a memory object?(a) 1(b) 2(c) 3(d) 4The question was posed to me in an online quiz.The question is from Performance Navigation and Memory topic in portion Invocation and Performance Navigation of JavaScript |
|
Answer» Right answer is (C) 3 |
|
| 49. |
How can one access the redirectCount property?(a) navigation.redirectCount(b) performance.navigation.redirectCount(c) performance.redirectCount(d) redirectCountI got this question in semester exam.Query is from Performance Navigation and Memory topic in section Invocation and Performance Navigation of JavaScript |
|
Answer» Correct OPTION is (b) performance.navigation.redirectCount |
|
| 50. |
What is the purpose of the property PerformanceTiming.fetchStart?(a) Browser ready to fetch input(b) Browser ready to fetch document(c) Browser ready to fetch summary(d) Browser ready to fetch outputI got this question during a job interview.Enquiry is from Integrating the Performance Object with perfLogger in chapter Invocation and Performance Navigation of JavaScript |
|
Answer» The correct choice is (b) Browser ready to fetch DOCUMENT |
|