Server Side And Client Side Scripting — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Server Side And Client Side Scripting — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What are the events generated by the Node objects called?
Correct Answer: Option B — emitters
Detailed Academic Explanation:
Node objects that generate events (known as event emitters) define an on() method for registering handlers.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the function used to remove all handlers for name events?
Correct Answer: Option D — removeAllListeners(name)
Detailed Academic Explanation:
The removeAllListeners(name) is used to remove all handlers from name events represented as : emitter.removeAllListeners(name)
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function is a synonym for on()?
Correct Answer: Option A — addListener()
Detailed Academic Explanation:
The on() method is used for registering handlers. addListener() is a synonym for on().
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is an event emitter?
Correct Answer: Option B — process
Detailed Academic Explanation:
The process object is an event emitter. The Node defines other important globals under the process namespaces that contain properties of that object like version, argv, env, pid,getuid(), cwd(), chdir() and exit().
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
When do uncaught exceptions generate events?
Correct Answer: Option A — When handlers are registered
Detailed Academic Explanation:
Uncaught exceptions generate events, if any handlers are registered. Otherwise, the exception just makes Node print an error and exit. process . on (" uncaughtException " , function ( e ) { console . log ( Exception, e ); }) ;
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which among the following POSIX signals generate events?
Correct Answer: Option C — SIGINT
Detailed Academic Explanation:
The SIGINT is a POSIX signal that generates event.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the method used to pause “data” events?
Correct Answer: Option A — s.pause()
Detailed Academic Explanation:
The above code snippet is used to pause data events, for throttling uploads, e.g.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
When the “end” event fires on EOF when no more data will arrive, which function is called?
Correct Answer: Option B — s.on("end",f)
Detailed Academic Explanation:
The above code snippet gets “end” event fired on EOF when no more data will arrive.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the return value of the write() method when the Node cannot write the data immediately and has to buffer it internally?
Correct Answer: Option D — False
Detailed Academic Explanation:
The write() method never blocks. If Node cannot write the data immediately and has to buffer it internally, the write() method returns false.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Rhino is originated by
Correct Answer: Option B — Mozilla
Detailed Academic Explanation:
Rhino is free software from Mozilla.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are global functions that are not part of core JavaScript?
Correct Answer: Option A — spawn(f)
Detailed Academic Explanation:
The spawn(f) runs f() or loads and executes file f in a new thread.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following reads the textual contents of a URL and returns as a string?
Correct Answer: Option D — readUrl(url)
Detailed Academic Explanation:
Rhino defines a handful of important global functions that are not part of core JavaScript in which readUrl(url) reads the textual contents of a URL and return as a string.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which Rhino command quits Rhino environment?
Correct Answer: Option C — quit()
Detailed Academic Explanation:
The quit() command makes Rhino exit.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is a more formal way of importing packages and classes as JavaScript objects?
Correct Answer: Option B — importClass(java.util.*)
Detailed Academic Explanation:
Because packages and classes are represented as JavaScript objects, you can assign themto variables to give them shorter names. But you can also more formally import them, if you want to: importClass ( java . util . HashMap ) ; // Same as : var HashMap = java.util.HashMap
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Consider the following code snippet var f = new java . io . File ( "/tmp/test" ) ; var out = new java . io . FileWriter ( f ) ; out instanceof java.io.Reader What will be the output for the above code snippet?
Correct Answer: Option D — False
Detailed Academic Explanation:
The output for the above code snippet is false as it is a writer and not a Reader.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does Rhino do when the getter and setter methods exist?
Correct Answer: Option A — It becomes JavaScript properties
Detailed Academic Explanation:
Rhino allows JavaScript code to query and set the static fields of Java classes and the instance fields of Java objects. Java classes often avoid defining public fields in favor of getter and setter methods. When getter and setter methods exist, Rhino exposes them as JavaScript properties.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The JavaScript classes can be instantiated using _____ operator?
Correct Answer: Option B — new
Detailed Academic Explanation:
Just like the JavaScript classes use new operator to instantiate, so does the Java classes.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The new Java arrays can be created into a JavaScript programs using which of the following classes?
Correct Answer: Option D — java.lang.reflect.Array
Detailed Academic Explanation:
There is no natural JavaScript syntax that Rhino can extend to allow JavaScript programs to create new Java arrays, so you have to do that using the java.lang.reflect.Array class.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is a fast C++ based JavaScript interpreter?
Correct Answer: Option A — Node
Detailed Academic Explanation:
Node is a fast C++-based JavaScript interpreter with bindings to the low-level Unix APIs for working with processes, files, network sockets, etc., and also to HTTP client and server APIs.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Why does the Node rely on event handlers?
Correct Answer: Option B — APIs are asynchronous
Detailed Academic Explanation:
Because the APIs are asynchronous, Node relies on event handlers, which are often implemented using nested functions and closures.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the command to run the node programs?
Correct Answer: Option C — node program.js
Detailed Academic Explanation:
The node programs can be run with the command: node program.js
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the alternative command used in Node for load()?
Correct Answer: Option D — require()
Detailed Academic Explanation:
Use require() instead of load(). It loads and executes (only once) the named module, returning an object that contains its exported symbols.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the command used for debugging output in Node?
Correct Answer: Option B — console.log(…)
Detailed Academic Explanation:
Node defines console.log() for debugging output like browsers do.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the code to print hello one second from now?
The above code snippet says hello one second from now.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Among the below given functions, Node supports which of the following client-side timer functions?
Correct Answer: Option D — clearTimeout()
Detailed Academic Explanation:
Node supports the client-side timer functions set setTimeout() , setInterval() , clearTimeout() , and clearInterval() .
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The necessary globals of a node are defined under which namespace?
Correct Answer: Option C — process
Detailed Academic Explanation:
Node defines other important globals under the process namespace.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Why does Node not block while waiting for operations to complete?
Correct Answer: Option B — Asynchronous
Detailed Academic Explanation:
Because Node’s functions and methods are asynchronous, they do not block while waiting for operations to complete.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is the method used for registering handlers?
Correct Answer: Option A — on()
Detailed Academic Explanation:
Node objects that generate events (known as event emitters) define an on() method for registering handlers.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The main purpose of JavaScript in web browser is to
Correct Answer: Option A — Creating animations and other visual effects
Detailed Academic Explanation:
JavaScript can help to facilitate that experience, for example by: 1. Creating animations and other visual effects to subtly guide a user and help with page navigation 2. Sorting the columns of a table to make it easier for a user to find what she needs 3. Hiding certain content and revealing details progressively as the user “drills down” into that content
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
A JavaScript program can traverse and manipulate document content through
Correct Answer: Option C — Both Element and Document Object
Detailed Academic Explanation:
A JavaScript program can traverse and manipulate document content through the Document object and the Element objects it contains. It can alter the presentation of that content by scripting CSS styles and classes.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The behaviour of the document elements can be defined by
Correct Answer: Option B — Registering appropriate event handlers
Detailed Academic Explanation:
The JavaScript program can define the behavior of document elements by registering appropriate event handlers.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The service(s) that enables networking through scripted HTTP requests is
Correct Answer: Option C — XMLHttpRequest
Detailed Academic Explanation:
The best known advanced services is the XMLHttpRequest object, which enables networking through scripted HTTP requests.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The HTML5 specification includes
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
The HTML5 specification (which, at the time of this writing, is still in draft form) and related specifications are defining a number of other important APIs for web apps. These include the data storage and graphics APIs.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following are not advanced services?
Correct Answer: Option D — None of the mentioned
Detailed Academic Explanation:
All the above mentioned are advanced services.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
JavaScript code between a pair of “script” tags are called
Correct Answer: Option D — Inline
Detailed Academic Explanation:
Inline code are those that are writeen between a pair of “script” tags.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Client-side JavaScript code is embedded within HTML documents in
Correct Answer: Option C — A URL that uses the special javascript:protocol
Detailed Academic Explanation:
The Client-side JavaScript code is embedded within HTML documents in four ways : 1. Inline, between a pair of “script” tags 2. From an external file specified by the src attribute of a “script” tag 3. In an HTML event handler attribute, such as onclick or onmouseover 4. In a URL that uses the special javascript: protocol.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the programming philosophy that argues that content and behaviour should as much as possible be kept separate?
Correct Answer: Option A — Unobtrusive JavaScript
Detailed Academic Explanation:
A programming philosophy known as unobtrusive JavaScript argues that content (HTML) and behavior (JavaScript code) should as much as possible be kept separate. According to this programming philosophy, JavaScript is best embedded in HTML documents using “script” elements with src attributes.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following communicates with server-side CGI scripts through HTML form submissions and can be written without the use of JavaScript?
Correct Answer: Option B — Interactive Web Pages
Detailed Academic Explanation:
nteractive web pages that communicate with server-side CGI scripts through HTML form submissions were the original “web application” and can be written without the use of JavaScript.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a way of embedding Client-side JavaScript code within HTML documents?
Correct Answer: Option B — External file specified by the src attribute of a “script” tag
Detailed Academic Explanation:
The Client-side JavaScript code is embedded within HTML documents in four ways : 1. Inline, between a pair of “script” tags 2. From an external file specified by the src attribute of a “script” tag 3. In an HTML event handler attribute, such as onclick or onmouseover 4. In a URL that uses the special javascript: protocol.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
When does JavaScript code appear inline within an HTML file?
Correct Answer: Option A — Between the “script” tag
Detailed Academic Explanation:
JavaScript code can appear inline within an HTML file between the “script” tags.
💡Key Conceptual Anchor:Server Side And Client Side Scripting
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.