201 Exam
In Serverless architectures ... A) There is no compute resource to manage B) Provisioning is done by the users C) Core functionality needs to be imported D) All of the above
A) There is no compute resource to manage
"Content-type" is a required HTTP request header for requests with a "message body" (POST, PUT). A) True B) False
A) True
Serverless architectures and containers are the solutions to money and time problems. A) True B) False
A) True
Which of the following JavaScript statements will remove an element with ID 'navbar' from the document? A) document.getElementById('navbar').remove() B) document.getElementById('navbar').clear() C) del(document.id.navbar) D) remove(document.getElement('navbar').id)
A) document.getElementById('navbar').remove()
Which of these methods wakes up all the threads? A) notify() B) notifyAll() C) wakeAll() D) start()
B) notifyAll()
AWS Lambda Architecture provides ... A) Microservices B) API Management C) No server to manage D) All of the above
D) All of the above
Routers use which two primary algorithms?
Distance Vector Routing and Link State Routing
What happens when you fork more threads than the available number of cores? A) All started threads will execute concurrently B) There will be a compile time error C) There will be a runtime error D) Only a number of threads equal to the number of cores get executed and the remaining threads are killed
A) All started threads will execute concurrently
Which of the following statements is true about annotations in Java servlets? A) Annotations can be used to configure the servlet mapping between servlets classes and URL patterns. B) Using a deployment descriptor (web.xml) without using annotations, typically leads to cleaner and more concise code. C) Annotations are used to define the HTTP request and response types.
A) Annotations can be used to configure the servlet mapping between servlets classes and URL patterns.
Which SQL statements are essential for managing databases? Select all that apply. A) CREATE DATABASE B) ALIGN C) DROP DATABASE D) UPDATE
A) CREATE DATABASE C) DROP DATABASE
What is a key advantage of using containers? A) Containers package applications and their dependencies together B) They require manual configuration for each deployment C) Containers cannot be easily moved between different environments D) Containers couple software with underlying host
A) Containers package applications and their dependencies together
What does the SQL statement "UPDATE Employees SET salary = salary * 1.05 WHERE department = 'Sales';" do? A) Increases the salary of employees in the Sales department by 5%. B) Sets the salary of employees in the Sales department to 1.05. C) The statement is syntactically incorrect. D) Increases the salary of all employees by 5%.
A) Increases the salary of employees in the Sales department by 5%.
Which of the following is true about JavaScript? A) JavaScript can be used in server-side scripting with Node.js B) Disabling JavaScript in browsers enhances the user experience C) JavaScript is exclusively a front-end language D) JavaScript is not object oriented
A) JavaScript can be used in server-side scripting with Node.js
Can I have two primary keys in a table? A) No, there can only be one primary key but it can span multiple columns. B) Yes, but you must edit the SQL config.ini file to enable this feature. C) No, there can only be one primary key spanning exactly one column. D) Yes, there can be multiple primary keys.
A) No, there can only be one primary key but it can span multiple columns.
What is the most important advantage of PREPARED statements? A) Prepared statements help prevent SQL injection attacks. B) Prepared statements are faster than regular SQL statements. C) Prepared statements can be used with simple SQL statements that do not have parameters. D) Prepared statements are easier to write than regular SQL statements.
A) Prepared statements help prevent SQL injection attacks.
Select which of the following are NOT TRUE of Serverless Architectures. Select all that apply. A) Provisioning and scaling handled by the client B) Execution environment provided by the client C) Provide authorization and authentication services D) No compute resource to manage
A) Provisioning and scaling handled by the client B) Execution environment provided by the client
What is the correct way to make sure a form uses a servlet you created? A) Set the action attribute of the form to the name of the servlet. B) Set the method attribute to POST in the form tag. C) Set the name parameter in the url to the name of the servlet. D) Set the name attribute of the form tag to the name of the servlet.
A) Set the action attribute of the form to the name of the servlet.
Select all cases the can result in "starvation". Select all that apply. A) Thread starvation can occur in situations where a thread with a lower priority is unable to gain access to the CPU resources because higher priority threads continuously occupy the CPU. B) Thread starvation can occur when lower priority threads continuously occupy the CPU. C) Thread starvation can occur when higher priority threads are constantly yielding or sleeping. D) Thread starvation can occur when higher priority threads are constantly running without yielding or sleeping, causing lower priority threads to be starved of CPU time.
A) Thread starvation can occur in situations where a thread with a lower priority is unable to gain access to the CPU resources because higher priority threads continuously occupy the CPU. D) Thread starvation can occur when higher priority threads are constantly running without yielding or sleeping, causing lower priority threads to be starved of CPU time.
What is the signature of the method that acts as the entry point into a Java program? A) public static void main(String [] args) B) void main(char *argv[]) C) static void main(String [] args) D) public void main(String [] args)
A) public static void main(String [] args)
In a Java web application, which method is used to retrieve the value of a query parameter passed in the URL? A) request.getParameter B) request.parameter C) request.getAttribute D) request.getSession
A) request.getParameter
Which of these keywords is not a part of exception handling? A) thrown B) finally C) try D) catch
A) thrown
Assume your program is running from the directory /us/java/programs/. If you want to read the file /us/input. txt, all of the following paths would work except... A).././input.txt B)../../input .txt C) /usr/input.txt D) /us/java/../input .txt
A).././input.txt
A server can handle multiple clients by _______ A) ... serving one client at a time B) ... starting a new thread for each client connected to the server C) ... using different ports for different clients
B) ... starting a new thread for each client connected to the server
Examine the following code: Socket socket = new Socket("127.6.5.1", 5000); PrintStream pw = new PrintStream(socket.getOutputStream()); pw.println("It's not just a boulder. Its a rock."); True or false: the above code will, without any additional code after the println, immediately send "It's not just a boulder. It's a rock" to port 5000 at IP address 127.6.5.1. A) True B)False
B) False
HTML Element and HTML Tag are equivalent? A) True B) False
B) False
In Java, parallelizing code by forking multiple threads to complete a task always leads to improved execution speed. A) True B) False
B) False
Java, The synchronized keyword allows multiple threads to execute a method or block of code A) True B) False
B) False
The correct HTML element for the largest heading is H6. A) True B) False
B) False
You can't have a webpage without a seperate CSS file A) True B) False
B) False
The 3 stages of a servlet's life cycle are init(), continue(), destroy(). A) True B) False
B) False (int, service, destroy)
Containers ... A) Require full OS install B) Images can be shared using GitHub-like repositories C) Depend on a specific virtual machine technology D) All of the above
B) Images can be shared using GitHub-like repositories
In java In what class is monitor functionality implemented? A) Unit class B) Object class C) Sync Class D) Lock class
B) Object class
Which of the following is NOT a characteristic of AJAX? A) Asynchronous communication B) Requires the user to install a specific plugin or software C) With AJAX transactions one can update part of a web page without refreshing the entire page D) Can use XML for data interchange
B) Requires the user to install a specific plugin or software
What type of inheritance does Java have? A) Abstract B) Single inheritance C) Multiple inheritance D) Polymorphism
B) Single inheritance
Which statement below is false? A) AJAX uses a browser built-in XMLHttpRequest object B) Updates to a page made via AJAX will not be displayed until the client's window is refreshed C) AJAX stands for Asynchronous JavaScript And XML D) AJAX applications can transport data as JSON text
B) Updates to a page made via AJAX will not be displayed until the client's window is refreshed
<head> <script type = "text/javascript" src="function.js"></script> </head> What is the snippet of code doing? A) linking a JavaScript file with a DOC file B) linking a JavaScript file with an HTML file. C) linking a JavaScript file with a CSS file. D) linking a JavaScript method with a JavaScript external file.
B) linking a JavaScript file with an HTML file.
In java The lock for a synchronized, non-static method is on the _____, and for a synchronized, static method it is on the ___. A) class, class B) object, class C) object, object D) class, object
B) object, class
"localhost" is the pseudo name for the computer your programs are running on. What is it's IP address? A) 127.0.0.7 B) 126.0.0.7 C) 127.0.0.1 D) 10.0.0.1
C) 127.0.0.1
Why is multi-threading useful in network applications? A) To allow clients and a server to run simultaneously. B) To allow the server to serve multiple clients simultaneously. C) All of the above D) None of the above
C) All of the above
Given a table of state names, how would you select only the abbreviation and full-name of California? A) SELECT full_name, abbreviation FROM us_state_info B) SELECT full_name, abbreviation FROM us_state_info IF state IS 'California' C) SELECT full_name, abbreviation FROM us_state_info WHERE full_name='California' D) SELECT * FROM us_state_info WHERE full_name='California' AND abbreviation='CA'
C) SELECT full_name, abbreviation FROM us_state_info WHERE full_name='California'
What is a TRUE statement for CSS? A) CSS is primarily used for server-side scripting B) Very few websites use external CSS style sheets C) The .class rule can be applied to multiple elements. D) CSS cannot be used to style HTML documents
C) The .class rule can be applied to multiple elements.
Which of the following statements is true about Java's finally block? A) The finally block is only executed if an exception is thrown in the try block B) The finally block is only executed if an exception is thrown in the catch block C) The finally block is executed regardless of whether an exception is thrown in the try or catch block D) The finally block is only executed if an exception is not thrown in the try or catch block
C) The finally block is executed regardless of whether an exception is thrown in the try or catch block
In AJAX, what is the purpose of using the fetch() API instead of XMLHttpRequest? A) To exclusively send data to the server. B) To write less code for the same operations. C) To provide a more modern, promise-based approach to making asynchronous requests and handling responses. D) To work exclusively with JSON data.
C) To provide a more modern, promise-based approach to making asynchronous requests and handling responses.
Which of the following is true about CSS Selectors? A) nothing - to refer to the class attribute of an HTML tag # - to refer to the id attribute of an HTML tag . - to refer to the name of an HTML tag B) # - to refer to the class attribute of an HTML tag . - to refer to the id attribute of an HTML tag nothing - to refer to the name of an HTML tag C) . - to refer to the class attribute of an HTML tag nothing - to refer to the id attribute of an HTML tag # - to refer to the name of an HTML tag D) . - to refer to the class attribute of an HTML tag # - to refer to the id attribute of an HTML tag nothing - to refer to the name of an HTML tag
D) . - to refer to the class attribute of an HTML tag # - to refer to the id attribute of an HTML tag nothing - to refer to the name of an HTML tag
AWS API Gateway ... A) Makes it easy for developers to create, publish, maintain, monitor, and secure APIs B) Creates a unified API front end for multiple microservices C) Provides DDoS (Distributed Denial of Service) Protection D) All of the above
D) All of the above
Examples of Backend-as-a-Service (BaaS) are A) NoSQL Databases and BLOB Storage B) Search and IOT C) Machine Learning and Speech to Text D) All of the above
D) All of the above
FaaS ... A) is Function as a Service B) is Custom code C) Runs on ephemeral containers D) All of the above
D) All of the above
What are the main differences between Ajax and the "classic" application model? A) In classic model, the web server responds with CSS and HTML B) In Ajax, the Ajax engine builds the HTML and CSS C) In Ajax, the server sends XML or JSON data D) All of the above
D) All of the above
Which of the following statements regarding semaphores is correct? A) A thread can release permits on a semaphore even without having them. B) A thread must acquire one of the permits of the semaphore before executing code managed by a semaphore. C) The number of permits available on a semaphore is specified at creation. D) All of the above.
D) All of the above.
Which of the following is a key difference between server-side and client-side JavaScript? A) Server-side JavaScript is used for handling client-side events, while client-side JavaScript is used for handling server-side events. B) Client-side JavaScript is used for creating user interface elements, while server-side JavaScript is used for handling the client side logic for those user interface elements. C) Server-side JavaScript can access user interface elements, while client-side JavaScript cannot. D) Server-side JavaScript is executed on the server (like in NodeJS), while client-side JavaScript is executed on the client, the browser.
D) Server-side JavaScript is executed on the server (like in NodeJS), while client-side JavaScript is executed on the client, the browser.
In java, Which thread method do you call if you want to begin a thread's execution? A) Sleep B) Yield C) Run D) Start
D) Start
Which of the following methods dispatches the request to the server when using AJAX? A) new XMLHttpRequest(); B) if (xhttp.responseText.trim().length > 0) { return false; } return true; C) open(method, url, async) D) send();
D) send();
ServerSocket server = new ServerSocket(8000) Socket socket = server.accept() What does server.accept() do? It finishes the current connection. The server lets in the currently waiting client independent of the port. Nothing, it is deprecated. The server uses this statement to listen for client connections.
The server uses this statement to listen for client connections.
Which if the following is true about subnets? a) In order to achieve subnetting we take away bits from the host in IPv4 and IPv6 b) in IPv6 subnet bits are 65-128 c) a subnet mask will consist of all 1s followed by all 0s d) mask can be written as "/# of zeros"
a) In order to achieve subnetting we take away bits from the host in IPv4 and IPv6 c) a subnet mask will consist of all 1s followed by all 0s
Which of the following are needed for a client socket to connect to a server app? a) Ip address of server b) the port on which the server application is listening c) IP address of client d) client's port number
a) Ip address of server b) the port on which the server application is listening
Semaphores are used to control the number of threads that can access a shared resource. a) True b) False
a) True
What are all the essential components for client server communication over a network? Select all the apply a) a socket instance on the client side b) port number of the server c) ip addy of server d) a server socket instance on client side
a) a socket instance on the client side b) port number of the server c) ip addy of server
What is the difference between the next() and nextLine() methods in the Scanner class? a) next() reads up until the first space, whereas nextLine() reads an entire line b) next() will read a line, whereas nextLine() skips a line c) next() will skip a line, whereas nextLine() reads the line d) next() and nextLine() can be used interchangeably
a) next() reads up until the first space, whereas nextLine() reads an entire line
A fully encapsulated class has all of the data declared private and getters and setters must be provided to manipulate each piece of data? a) true b) false
a) true
Which of following is incorrect about Threads with priorities? a) Priorities are from 1 to 10 b) A lower priority thread cannot get executed before a higher priority thread that is in ready state c) Multi threaded programs could lead to deadlock d) The JVM follows a probabilistic algorithm to decide on the next thread to execute
b) A lower priority thread cannot get executed before a higher priority thread that is in ready state
Threads have priorities that the system imposes over them according to the work requested by them. The user does not have the option to set threads' priorities. a) True b) False
b) False
Which of the following is NOT a way to solve the producer/consumer problem? a) Locks b) ForkJoinTask c) Monitor d) Blocking Queue
b) ForkJoinTask
What is the Scanner class in Java? a) The Scanner class scans large texts for specific phrases and words, depending on what the user is looking for b) The Scanner class is used to read input of different primitive data types c) The Scanner class is used to add multiple user inputs into an array, but they must be of primitive types d) The Scanner class 'listens' for input and continually adds user input to a generic array, which can be accessed at any time
b) The Scanner class is used to read input of different primitive data types
Why is multi threading necessary in networking apps? a) blocking user inputs b) allow sending and receiving data simultaneously c) simplify data transfer protocols d) to enhance single client performance
b) allow sending and receiving data simultaneously
Once a thread invokes await() on a condition, the thread will move to the waiting state until _______. Select an option to complete the sentence. a) .finishAll() is called b) .finish() is called c) .signal() is called d) .stop() is called
c) .signal() is called
What is the purpose of Distributed Programming? a) Add functionality to your program. b) There is no purpose. c) Speed up execution of your program by using resources typically on other computers. d) Speed up execution of your program by using redundant resources typically on your computer.
c) Speed up execution of your program by using resources typically on other computers.
A class that implements an interface... a) may implement any number of methods from that interface. b) must implement at least one method from that interface. c) must implement every method of that interface unless it is declared abstract. d)must be abstract.
c) must implement every method of that interface unless it is declared abstract.
What is the motivation for using Generics? a) Shorter code. b) More readable code. c) Faster execution. d) Compile-time type safety.
d) Compile-time type safety.
Most dynamic content is based on a _______ program running and generating the _______ code in real-time. a) front-end, server b) client, server c) client, front-end d) server, front-end
d) server, front-end