InterviewSolution
Saved Bookmarks
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.
| 151. |
How many properties are there in window.performance object?(a) 1(b) 4(c) 2(d) 3 |
|
Answer» The correct choice is (c) 2 Easy explanation: The Window interface’s performance property returns a Performance object, which can be used to gather performance information about the current document. There are totally 2 properties associated with the window.performance and they are: navigation type. |
|
| 152. |
What does it indicate when the type attribute of the navigation object is set to 2?(a) Navigation by moving back through history(b) Navigation by moving forward through history(c) Navigation by moving back & forward through history(d) Navigation by moving in favorites |
|
Answer» The correct choice is (c) Navigation by moving back & forward through history The best I can explain: The navigator object contains information about the browser. When the type attribute of the navigation object is set to 2, it means that the navigation is done by moving back or forward through history. |
|
| 153. |
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 time |
|
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. |
|
| 154. |
What is the purpose of the window.location object in JavaScript?(a) Get the URL and redirect(b) Get the location of the cursor(c) Get the path to the next page(d) Get the location & path of the next page |
|
Answer» The correct choice is (a) Get the URL and redirect Explanation: The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The parameter location specifies the agent location, speed and browser to use for the test, formatted as location.browser:location. |
|
| 155. |
The main purpose of a “Live Wire” in NetScape is to ________(a) Create linkage between client side and server side(b) Permit server side, JavaScript code, to connect to RDBMS(c) Support only non relational database(d) To interpret JavaScript code |
|
Answer» Right choice is (b) Permit server side, JavaScript code, to connect to RDBMS Best explanation: A Live Wire database driver also supports a number of non-relational databases. |
|
| 156. |
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 synchronously |
|
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. |
|
| 157. |
What is the return type of the script tag?(a) File I/O(b) Minify JavaScript(c) HTTP Request(d) Gzip encoded |
|
Answer» Correct option is (c) HTTP Request For explanation: The script tag sends the HTTP Request to the Minify. Minify reads the JavaScript file in, minifies it and when it responds it sets the accept encoding HTTP header to gzip, deflate. |
|
| 158. |
A JavaScript program developed on a Unix Machine ________(a) will throw errors and exceptions(b) must be restricted to a Unix Machine only(c) will work perfectly well on a Windows Machine(d) will be displayed as a JavaScript text on the browser |
|
Answer» Right answer is (c) will work perfectly well on a Windows Machine To elaborate: JavaScript can be executed on different operating systems therefore the program developed on UNIX will work perfectly fine on windows also. |
|
| 159. |
Which is the method that removes the current document from the browsing history before loading the new document?(a) modify()(b) assign()(c) replace()(d) remove() |
|
Answer» Right answer is (c) replace() Best explanation: The replace() removes the current document from the browsing history before loading the new document. The difference between assign method and replace(), is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the “back” button to navigate back to the original document. |
|
| 160. |
How to save chart as a Window metafile?(a) metafile()(b) win.metafile()(c) file()(d) metawin() |
|
Answer» The correct answer is (b) win.metafile() For explanation I would say: Metafile is a piece of graphical information stored in a format that can be exchanged between different systems or software. The method win.metafile([filename]) is used to save chart as a Window metafile. |
|
| 161. |
Which is the method used to save chart as a ps file?(a) ps()(b) postscript()(c) script()(d) post(script) |
|
Answer» Correct option is (b) postscript() The best explanation: postscript starts the graphics device driver for producing PostScript graphics. The syntax for the method to save chart as a ps file is : postscript([filename]). |
|
| 162. |
The properties() method is a ________(a) Enumerable method(b) Non-enumerable method(c) Operational method(d) calling method |
|
Answer» The correct answer is (b) Non-enumerable method To explain: The properties() is a method to get information of the properties of a particular object. properties() method is a non-enumerable method. |
|
| 163. |
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 tag |
|
Answer» Right choice is (a) After window.onload event The explanation: Lazy loading is a kind of loading in which we don’t need our JavaScript code to be available as soon as the page loads. When we don’t need our JavaScript code to be available as soon as the page loads, we can script-load our external JavaScript after the window.onload event. |
|
| 164. |
Which exception does the Iterators throw from their next() method when there are no more values to iterate, that work on finite collections?(a) Exit Iteration(b) Abort Iteration(c) Abort(d) Stop Iteration |
|
Answer» The correct answer is (d) Stop Iteration The best explanation: Iterators that work on finite collections throw Stop Iteration from their next() method when there are no more values to iterate. Stop Iteration is a property of the global object in JavaScript 1.7. Its value is an ordinary object (with no properties of its own) that is reserved for this special purpose of terminating iterations. Note, in particular,that Stop Iteration is not a constructor function like TypeError() or RangeError(). |
|
| 165. |
The property of JSON() method is __________(a) it can be invoked manually as object.JSON()(b) it will be automatically invoked by the compiler(c) it is invoked automatically by the JSON.stringify() method(d) it cannot be invoked in any form |
|
Answer» The correct choice is (c) it is invoked automatically by the JSON.stringify() method Explanation: A common use of JSON is to exchange data to/from a web server. When sending data to a web server, the data has to be a string. In that case json.strigify() is used to convert a javascript object into a string. |
|
| 166. |
Which event is fired when a document and all of its external resources are fully loaded and displayed to the user?(a) Window(b) Load(c) Element(d) Handler |
|
Answer» Correct option is (b) Load Easiest explanation: The load event is the most important of these events: it is fired when a document and all of its external resources (such as images) are fully loaded and displayed to the user. |
|
| 167. |
The behaviour of the instances present of a class inside a method is defined by __________(a) Method(b) Classes(c) Interfaces(d) Classes and Interfaces |
|
Answer» The correct choice is (b) Classes Explanation: Objects of the class are also known as instances of the class. The behaviour of the instance of a class is defined by the class and is shared by all instances. |
|
| 168. |
Which of the following is possible to be referenced in external JavaScript?(a) CPP(b) Cs(c) PHP(d) Python |
|
Answer» The correct answer is (c) PHP To explain I would say: PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. One of the lesser known sides of external JavaScript is the ability to reference a PHP file instead of the familiar .js file. |
|
| 169. |
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 curser |
|
Answer» The correct answer is (b) How the user navigated To explain I would say: The navigation tells how the user navigated to the page. |
|
| 170. |
What does the application layer handle?(a) Top-level communication(b) Bottom-level communication(c) Both Top-level and Bottom-level communication(d) Middle-level communication |
|
Answer» Right option is (a) Top-level communication The explanation is: An application layer is an abstraction layer that specifies the shared communications protocols and interface methods used by hosts in a communications network. The Application layer handles the top-level communication that the client and servers use, like HTTP and SMTP for email clients. |
|
| 171. |
Which layer is used to handle the HTTP requests?(a) Network Layer(b) Transport Layer(c) Application Layer(d) Presentation Layer |
|
Answer» Right option is (a) Network Layer The explanation: HTTP is a protocol which allows the fetching of resources, such as HTML documents. It is the foundation of any data exchange on the Web and a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. The network layer is used to handle the HTTP requests. |
|
| 172. |
Which tag can handle mouse events in Netscape?(a) img(b) a(c) br(d) src |
|
Answer» Right option is (a) img The best explanation: Netscape is a brand name associated with the development of the Netscape web browser. The img element can handle mouse events in Netscape. |
|
| 173. |
Which attribute is used to specify that the script is executed when the page has finished parsing? (only for external scripts)(a) parse(b) a sync(c) defer(d) type |
|
Answer» Right option is (c) defer The best explanation: The defer attribute is a Boolean attribute. When present, it specifies that the script is executed when the page has finished parsing. |
|
| 174. |
What will be the radix value if the string begins with 0x?(a) 13(b) 14(c) 15(d) 16 |
|
Answer» The correct choice is (d) 16 To explain I would say: If the string begins with 0x, then the radix value will be 16. If the string begins with “0”, the radix is 8 (octal). If the string begins with any other value, the radix is 10 (decimal). |
|
| 175. |
The script tag must be placed in __________(a) the head tag(b) the head or body(c) the title or head(d) after the body tag |
|
Answer» Correct answer is (b) the head or body To explain: If the script tag is placed after the body tag, then, it will not be evaluated at all. Also, it is always recommended and effective to use the script snippet in the tag. |
|
| 176. |
How do we debug a script?(a) Use of JavaScript Validator(b) Use of JavaScript Debugger(c) Use of JavaScript Validator & Debugger(d) Use of javascript interpreter |
|
Answer» The correct answer is (c) Use of JavaScript Validator & Debugger Explanation: Both the JavaScript Validator and the JavaScript Debugger can be used to debug a script. The debugger statement stops the execution of JavaScript, and calls (if available) the debugging function. |
|
| 177. |
What is it called when we make a mistake in the script?(a) Error(b) Bug(c) Mistake(d) Debug |
|
Answer» Right option is (b) Bug To elaborate: A bug in a programming language refers to a set of code which results in an error in compilation. A mistake in a script is referred to as a bug. |
|
| 178. |
What does the pushState() method do?(a) Removes the state(b) Adds new state(c) Replaces the state(d) Change the state |
|
Answer» Right option is (b) Adds new state The best I can explain: When a web app enters a new state, it calls history.pushState() to add that state to the browsing history. |
|
| 179. |
What is the return type of the remote server?(a) HTTP Response(b) HTTP Request(c) Get Request(d) Post request |
|
Answer» The correct option is (a) HTTP Response To explain I would say: The remote server finds the resource and returns it in an HTTP Response, the status of which is 200 to indicate a good response. 400 status code is used to indicate a bad request. |
|
| 180. |
Which layer is used to handle the network addressing and routing?(a) Network Access Layer(b) Internet Layer(c) Transport Layer(d) Presentation Layer |
|
Answer» Right choice is (b) Internet Layer The explanation: The internet layer is a group of internetworking methods, protocols, and specifications in the Internet protocol suite that are used to transport network packets from the originating host across network boundaries. The Internet layer handles network addressing and routing, getting IP and MAC addresses. |
|
| 181. |
Where does the external process save the result of the test?(a) Normal file(b) Flat file(c) Folder(d) .exe file |
|
Answer» Right choice is (b) Flat file Best explanation: A flat file consists of a single table of data. It allows the user to specify data attributes, such as columns and data types table by table, and stores those attributes separate from applications. The external process, say savePerfData should in turn save the results of the test in a flat file. |
|
| 182. |
What is the result when the showPerformanceMetrics() is called before loading the remote script?(a) Throws an exception(b) Throws an error(c) It will load by itself(d) Throws an exception and It will load by itself |
|
Answer» Correct answer is (b) Throws an error The best I can explain: perflogger.showPerformanceMetrics() tells the user about the performance parameters of the script loading. If you try to make the call to perfLogger.showPerformanceMetrics() and the script hasn’t just loaded but also executed, then you will get an error. |
|
| 183. |
What does the subexpression /java(script)?/ result in?(a) It matches “java” followed by the optional “script”(b) It matches “java” followed by any number of “script”(c) It matches “java” followed by a minimum of one “script”(d) It matches “java” followed by a single “script” |
|
Answer» Right choice is (a) It matches “java” followed by the optional “script” For explanation: paranthesis () check for the optional presence of the argument in the string. subexpression /java(script)?/ matches “java” followed by the optional “script”. |
|
| 184. |
How does the handshake help the server?(a) Acknowledge(b) Accept the attempt(c) Both Acknowledge and Accept the attempt(d) Asynchronize |
|
Answer» Correct option is (c) Both Acknowledge and Accept the attempt The explanation is: The handshake allows the server to acknowledge and accept the attempt. The handshake consists of a Synchronize, Synchronize-Acknowledge, and Acknowledge message to be passed between the browser and the remote server. |
|
| 185. |
What will be the result when non greedy repetition is used on the pattern /a+?b/?(a) Matches the letter b preceded by the fewest number of a’s possible(b) Matches the letter b preceded by any number of a(c) Matches letter a preceded by letter b, in the stack order(d) Matches letter a present in the string |
|
Answer» The correct option is (a) Matches the letter b preceded by the fewest number of a’s possible The best explanation: Using non greedy repetition may not always produce the results you expect. /a+?b/ matches the letter b preceded by the fewest number of a’s possible. |
|
| 186. |
The class that represents the regular expressions is ________(a) RegExpObj(b) RegExpClass(c) RegExp(d) StringExp |
|
Answer» Correct answer is (c) RegExp The explanation is: Regular expression is an object that describes a pattern of characters. The JavaScript RegExp class represents regular expressions, and both string and RegExp define methods that use regular expressions. |
|
| 187. |
Which status code indicates that the server could not find the resource requested?(a) 200(b) 404(c) 500(d) 566 |
|
Answer» The correct option is (b) 404 The explanation: The HTTP 404, 404 Not Found, and 404 error message is a Hypertext Transfer Protocol (HTTP) standard response code, in computer network communications, to indicate that the client was able to communicate with a given server, but the server could not find what was requested. |
|
| 188. |
Which of the following property indicate the total size of the heap?(a) heapSize(b) totalHeapSize(c) totalJsHeapSize(d) totalHeap |
|
Answer» The correct answer is (c) totalJsHeapSize To explain I would say: usedJsHeapSize stores an object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values. |
|
| 189. |
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 required |
|
Answer» Correct answer is (a) Amount of memory used To explain I would say: usedJsHeapSize returns an object of type ObjectObject. An object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values. The usedJsHeapSize property is the amount of memory that all of the current objects in the heap are using. |
|
| 190. |
What does /[^(]* regular expression indicate?(a) Match one or more characters that are not open parenthesis(b) Match zero or more characters that are open parenthesis(c) Match zero or more characters that are not open parenthesis(d) Match one or more characters that are open parenthesis |
|
Answer» Correct choice is (c) Match zero or more characters that are not open parenthesis To explain I would say: The [^…] character class is used to match or draw any one character not between the brackets. One should always be careful while using * and ? as repetition characters as they may match zero instances of whatever precedes them, they are allowed to match nothing. |
|
| 191. |
The Crockford’s subset does not include which function in JavaScript?(a) eval()(b) coeval()(c) equal()(d) equivalent() |
|
Answer» Correct option is (a) eval() Explanation: The Crockford’s subset does not include the with and continue statements or the eval() function. It defines functions using function definition expressions only and does not include the function definition statement. |
|
| 192. |
Which HTML element is used to include images?(a) image(b) img(c) src(d) sourcing |
|
Answer» Right answer is (b) img To explain I would say: Web pages include images using the HTML img element. src tag is used to include the image link. |
|
| 193. |
Which of the following is the default positioning elements with CSS?(a) relative(b) static(c) absolute(d) fixed |
|
Answer» The correct option is (b) static Easy explanation: static is the default value and specifies that the element is positioned according to the normal flow of document content (for most Western languages, this is left to right and top to bottom). |
|
| 194. |
What is the purpose of a return statement in a function?(a) Returns the value and continues executing rest of the statements, if any(b) Returns the value and stops the program(c) Returns the value and stops executing the function(d) Stops executing the function and returns the value |
|
Answer» Right choice is (d) Stops executing the function and returns the value The best I can explain: The return stops the execution of the function when it is encountered within the function. It returns the value to the statement where the function is called. |
|
| 195. |
The primary purpose of the array map() function is that it __________(a) maps the elements of another array into itself(b) passes each element of the array and returns the necessary mapped elements(c) passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function(d) pass the elements of the array into another array |
|
Answer» Correct option is (c) passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function Best explanation: map() is a predefined function in javascript used for mapping the array elements to be used for some other purpose. The map() method passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function. |
|
| 196. |
What does the status code 500 indicate?(a) Error in request(b) Error in response(c) Error in server(d) Successful |
|
Answer» Correct choice is (a) Error in request Best explanation: The 500 status code, or Internal Server Error, means that server cannot process the request for an unknown reason. Sometimes this code will appear when more specific 5xx errors are more appropriate. |
|
| 197. |
Which of the following elements are used to include audio?(a) audio(b) video(c) svg(d) aud |
|
Answer» The correct answer is (a) audio To explain: The audio tag is used to include audio in the HTML document. The audio tag includes method like play(), pause() etc. |
|
| 198. |
Which is a possible way of finding all the img elements in the document?(a) document(images)(b) document.images[](c) document(img)(d) doc(img) |
|
Answer» The correct answer is (b) document.images[] For explanation: The best suited option is document.image[] to find all img elements in the document.[index] is used to specify the index of which img tag is to be selected. |
|
| 199. |
What is the purpose of the transport layer?(a) TCP Communication takes place(b) UDP Communication takes place(c) Both TCP and UDP Communication takes place(d) IP communication |
|
Answer» The correct option is (c) Both TCP and UDP Communication takes place Explanation: The transport layer is the layer in the open system interconnection (OSI) model responsible for end-to-end communication over a network. The Transport layer is where our TCP (or UDP) communication takes place. |
|
| 200. |
Which of the following attributes are common to both audio and video?(a) enter(b) control(c) controls(d) add |
|
Answer» The correct option is (c) controls For explanation I would say: Both audio and video support a controls attribute. When present, it specifies that audio controls should be displayed. Both audio and video support a controls attribute. |
|