1/1007
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
By convention in Java, all classes start with...
A)
an underscore
B)
a number
C)
a lowercase letter
D)
a capital letter
D) a capital letter
What is the motto of Java?
A)
Write once, run anywhere.
B)
Platform-independent.
C)
Run once, write anywhere.
D)
Better than C++
A) Write once, run anywhere.
Java is platform-dependent
False
The following access modifier allows any other piece of code to access the variable or method
Public
Which Java IDE will be used in the class and by the graders?
A)
Eclipse
B)
BlueJ
C)
IntelliJ
D)
NetBeans
A) Eclipse
Where are files stored in a computer system?
A)
Volatile memory
B)
Non-volatile memory
C)
Cache
D)
Main memory
B) Non-volatile memory
With SQL, how do you select all the records from a table names "Persons" where the value of the column "FirstName" is "Peter"?
SELECT * FROM Persons WHERE FirstName='Peter'
How are Java objects allocated?
A)
All Java objects are statically-allocated.
B)
All Java objects are dynamically-allocated.
C)
Java doesn't have objects but just primitive variable types.
D)
Java gives the programmer the ability to allocate objects either dynamically or statically.
B) All Java objects are dynamically-allocated.
Which of the following is the correct way of serializing an object?
A)
ObjectOutputStream out = new ObjectOutputStream(newFileOutputStream("output.ser"));
out.writeObject(new int[]{1,2,3});
B)
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("output.ser"));
out.writeBytes(new int[]{1,2,3});
C)
FileOutputStream out = new FileOutputStream("output.ser");
out.writeObject(new int[]{1,2,3});
D)
FileOutputStream out = new FileOutputStream("output.ser");
out.write(new int[]{1,2,3});
A) ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("output.ser"));
out.writeBytes(new int[]{1,2,3});
Server hardware is typically more robust and expensive than other hardware, but a server can physically be any computer.
What are the solutions to the cross-domain issue for resources such as JavaScript of JSON?
A) Use a server "proxy"
B) Use CORS, if available
C) Access exclusively resources in the same domain
D) All of the above
D) All of the above
A) Use a server "proxy"
B) Use CORS, if available
C) Access exclusively resources in the same domain
Which of the following is true?
A)
If a method only exists in the child and you have an instance of a parent, you can still call the method from the child.
B)
An object with the compile-time type of a parent can take on the form of a child at runtime.
C)
Both A and B
D)
Neither A nor B
B) An object with the compile-time type of a parent can take on the form of a child at runtime.
A parent class is also known as what?
A)
Child class
B)
Upper class
C)
Senior class
D)
Base class
D) Base class
Which of the following is true about Buffers used in non-blocking APIs introduced in NIO/NIO.2?
Write data into a buffer using the buffer's wrap() method and the channel write() method
Which of the following is true about Java inheritance?
A)
Java does not support inheritance.
B)
Java supports single inheritance.
C)
Java supports multiple inheritance.
D)
Java supports single and multiple inheritance.
B) Java supports single inheritance.
What type of inheritance does Java support?
A)
Java does not support inheritance
B)
Multi-Dimensional
C)
Multiple
D)
Single
D) Single
Which of the following statements regarding Thread Priorities in the JVM is true?
A)
High priority threads will always execute before threads with lower priority.
B)
Threads are scheduled in order from highest priority to lowest priority.
C)
When the JVM decides on the next thread to execute from the ready state, it follows a probabilistic algorithm.
D)
None of the above
C) When the JVM decides on the next thread to execute from the ready state, it follows a probabilistic algorithm.
Which of the following is not a common cause of starvation?
- Threads waiting their turn run the risk of potentially losing pieces of data as memory is overwritten
Java enables you to acquire Locks explicitly, which give you more control for coordinating
Threads
From the ready state, to which states can a given thread move directly to?
Running
All thread states can transition to the Ready state except for:
Dead state
What is not an advantage of multithreading?
A)
Testing/debugging is usually relatively straightforward, in comparison to other approaches
B)
The independent nature of threads means other threads are not affected if an exception occurs in one
C)
It doesn't block the user from performing other tasks
D)
One can save time by performing many tasks togethe
A) Testing/debugging is usually relatively straightforward, in comparison to other approaches
A thread with a priority of 10 will run before a thread with a priority of 1.
A)
This is always true
B)
This is never true
C)
This is sometimes true
D)
None of the above
C) This is sometimes true
What is the major difference between jQuery AJAX and XMLHttpRequest (XHR)
A) jQuery does not support all browsers while XHR does
B) jQuery is Google's reimplentation of XHR from scratch for improved usability and efficiency
C) jQuery is optimized for asynchronous use cases while XHR is not
D) There is no major difference aside from syntactical sugar
D) There is no major difference aside from syntactical sugar
Which of the following is false, on the topic of differences between processes and threads?
A)
Processes are independent, threads are a subset of a process
B)
Processes have different address space in memory, whereas threads contain a shared address space
C)
Communication between processes is slower and more costly in comparison to communication between threads
D)
Context switching is faster between processes in comparison to threads
D) Context switching is faster between processes in comparison to threads
If thread is a Thread object, calling thread.sleep(10) will cause the thread to sleep for ________
A)
approximately 10 milliseconds (could be more, could be less)
B)
exactly 10 milliseconds
C)
at least 10 milliseconds
D)
at most 10 milliseconds
C) at least 10 milliseconds
How does a thread obtain the lock for an object?
A)
When a thread enters a synchronized block of code, it obtains the lock for that object
B)
ExecutorService delivers locks to threads in its Thread Pool fairly using methods (FIFO, Round Robin, etc) that are optimized and prevent starvation.
C)
Threads executing a synchronized block of code will pass the lock to the next thread. Effectively, the current thread will go to the Wait State.
D)
Java is thread-safe and the JVM will handle race conditions by giving the lock to the thread in the Running State
A) When a thread enters a synchronized block of code, it obtains the lock for that object
What does calling Executor.newFixedThreadPool(3) do?
Creates a thread pool that reuses a fixed number of threads. At any point, a maximum of 3 threads will be alive
A monitor is an object with _____ exclusion and synchronization capabilities.
A)
multi-threaded
B)
mutual
C)
conflicting
D)
parallel
B) mutual
In what class is monitor functionality implemented?
A)
Unit class
B)
Object class
C)
Sync Class
D)
Lock class
B) Object class
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
A monitor...
A)
cannot be created.
B)
must extend the monitor class.
C)
must implement the monitor interface.
D)
can be any object.
D) can be any object.
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.
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.
Why is a performance increase not guaranteed for parallel computing?
A)
Parallel computing adds functionality and does not increase performance.
B)
Network delays cause performance bottlenecking.
C)
Modern-day CPUs have sufficient single-core performance.
D)
Forking and joining has their own overhead.
D) Forking and joining has their own overhead.
Select the correct statement from the following options.
A)
Parallelizing code always speeds it up.
B)
If you fork more threads than your CPU's, the threads will execute concurrently.
C)
Forking a task causes no overhead.
D)
All of the above.
B
What is the producer/consumer problem, and why is it important?
A)
Producers withdraw items, consumers insert items, and this is an example of parallel programming.
B)
Producers insert items, consumers withdraw items, and this is an example of concurrent programming.
C)
Producers withdraw items, consumers insert items, and this is an example of concurrent programming.
D)
Producers insert items, consumers withdraw items, and this is an example of parallel programming.
B
Which of the following is NOT true about semaphores?
A)
A thread can release permits on a semaphore even without having them.
B)
Semaphores can restrict the number of threads that access a shared resource.
C)
Only one permit is available on a semaphore.
D)
The number of permits available on a semaphore is specified at creation.
C (Only one permit is available on a semaphore.)
Question asking not true
Which of the following is true about subnets?
a)
In order to achieve subnetting, we take away bits form the host in both IPv4 and IPv6
b)
A subnet mask can be written as "/# of zeros"
c)
A subnet mask will consist of of all 1's followed by all 0's.
d)
In IPv6 the subnet bits are 65-128
c) A subnet mask will consist of of all 1's followed by all 0's.
When you instantiate your non-static class instance members, where are they created in memory?
Heap
Which of the following are true when you are designing test cases?
A)
Choose inputs that force the system to generate all error messages.
B)
Repeat the same input or series of inputs numerous times.
C)
Force invalid outputs to be generated.
D)
All of the above.
D
Is 172.21.101.211 a public IP Address or a private IP Address?
A)
Public
B)
Private
C)
Both
D)
Neither
B --> class B
Which of the following is NOT a reserved port for well known applications?
a)
143
b)
443
c)
20
d)
1024
d
Which of the following statements regarding software engineering is correct?
A)
An increase in testing costs will bring down the cost of software maintenance.
B)
Pair programming with junior programmers can decrease the overall cost of a software product.
C)
Software project cost estimation is not known until the technical specifications are written.
D)
All of the above
B or D IDK
Which does a client application need to connect to a server application?
A)
IP Address
B)
Socket
C)
Port
D)
All of the above
D
What's the purpose of NAT (network address translation)?
A)
It solves the problem that IPv6 has run out of available addresses.
B)
It connects the port number to the DNS server.
C)
It replaces the private IP address with the public IP address on outgoing request.
D)
It determines the IPv4 address class.
C: It replaces the private IP address with the public IP address on outgoing request.
Which does a client application need to connect to a server application?
A)
IP Address
B)
Socket
C)
Port
D)
All of the above
D
What's the purpose of NAT (network address translation)
A)
It connects the port number to the dns server
B)
It determines the IP address class
C)
It solves the problem that ipv6 has run out of available addresses
D)
It replaces the private IP address with the public IP address on outgoing request
D
Which of the following ranges of port numbers refers to ports that are registered and can be used by any application?
a)
Ports from 1024-49151
b)
Ports from 0-1023
c)
Ports from 49152-65535
d)
None of these ranges
a) Ports from 1024-49151
What is a socket?
A)
Socket is the IP address of the server.
B)
Socket is the combination of the IP address and port number needed by the client.
C)
Socket is the IP address of the client.
D)
Socket is the port number of the client and server connection.
B) Socket is the combination of the IP address and port number needed by the client.
How would we create a socket connecting to port 6789 of the loopback address?
Socket s = new Socket("127.0.0.1", 6789);
Which of the followings are needed for a socket to connect to a server application?
A. IP address of the server;
B. the port on which the server application is listening;
C. IP address of the client;
D. client's port number.
A and B
Suppose you wrote server code that will send messages out to all clients. The clients are single-line monitors that will display your received message without processing it.
The problem is that, when the clients are receiving messages, they receive a newline with it and it wipes the original message.
In your server code, you've written "pw.println(str); pw.flush();" where pw is an instance of a PrinterWriter object that writes to an output stream.
What is a correct way to fix this (so that a newline is not sent)?
1)
Rewrite the first quoted server-code line as "pw.println(str.replace("\n", ""));"
2)
After writing "pw.println(str)", fill the buffer with white-space characters so that flush() can not insert a newline character
3)
Rewrite the first quoted server-code line as "pw.print(str);"
4)
The string must be reprocessed by the client to remove the newline character
3) Rewrite the first quoted server-code line as "pw.print(str);"
Which keyword is used to declare a subclass?
- Extends
Which of the following is not a way to declare a String names s, with the value "ucla sucks"?
String s = ['u', 'c', 'l', 'a',' ', 's', 'u', 'c', 'k', 's'];
What does a client application need to connect to a server application?
A)
IP Address
B)
Socket
C)
Port
D)
All of the above
D
Which of the following statements regarding networking is/are true?
A)
Ports allow us to uniquely identify networked programs running on a single computer.
B)
Private IP Addresses can communicate outside local networks.
C)
Multiple computers on the same network can share the same IP address.
D)
All of the Above
A) Ports allow us to uniquely identify networked programs running on a single computer.
What's the purpose of NAT (network address translation)?
A)
It solves the problem that IPv6 has run out of available addresses.
B)
It connects the port number to the DNS server.
C)
It replaces the private IP address with the public IP address on outgoing request.
D)
It determines the IPv4 address class.
It replaces the private IP address with the public IP address on outgoing request.
What are the key interfaces to develop a database application with JDBC?
DriverManager, Connection, Statement and ResultSet
Which of the following statements is NOT true about conditions?
A condition is created by instantiating the Condition class.
Given these two tables:
CREATE TABLE Students{ID int(11) primary key not null auto_increment;firstname varchar(50) not null,lastname varchar(50) not null,country varchar(50) not null,};
Which one of these queries are correct to change student with ID 10 country to 'United States' ?
A)
SET Students s, s.country = 'United States'' WHERE s.ID = 10;
B)
You can't update values in SQL you have to deleted the entry and add a new one.
C)
CHANGE Students s, s.country ='United States'' WHERE s.ID = 10;
D)
UPDATE Students s SET s.country ='United States'' WHERE s.ID = 10;
D) UPDATE Students s SET s.country ='United States'' WHERE s.ID = 10;
______ is a key used to link two tables together
A) Primary Key
B) Foreign Key
C) Tertiary key
D) Secondary Key
Foreign Key
What is the effect of a WHERE clause?
conditional cut
What is the effect of changing from SELECT * to SELECT g.Grade?
vertical cut
How could you normalize a table that has a persons name, social security number, date of birth, and list of properties they own?
A)
Make names its own table with the name as the primary key, and the date of birth as a foreign key.
B)
This table is already as normalized as it can be.
C)
Make the property names an array instead of a column
D)
Make the social security number its own table with the social security number as the primary key, and the date of birth and name as columns. Then also make a properties table with a property id, property name, and social security number as the foreign key.
D) Make the social security number its own table with the social security number as the primary key, and the date of birth and name as columns. Then also make a properties table with a property id, property name, and social security number as the foreign key.
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 IF state IS 'California'
B)
SELECT * FROM us_state_info WHERE full_name='California' AND abbreviation='CA'
C)
SELECT full_name, abbreviation FROM us_state_info
D)
SELECT full_name, abbreviation FROM us_state_info WHERE full_name='California'
D) SELECT full_name, abbreviation FROM us_state_info WHERE full_name='California'
What is the purpose of the IFRAME element?
A)
reserve a rectangular region
B)
hyperlink to a site
C)
embed a plug-in
D)
embed a site
D
How do you add CSS to HTML? Choose all that apply
In an external file that is included in an HTML document in the tag
In the
Which of the following is not a front-end web language?
A)
CSS
B)
HTML
C)
JavaScript
D)
Java
D) Java
Which one presents the correct ways for creating CSS selectors?
A)
.classname#idnametagname
B)
.classnameidname#tagname
C)
classname#idname.tagname
D)
#classname.idnametagname
A) SELECT full_name, abbreviation FROM us_state_info WHERE full_name='California'
What is the "novel" idea that Tim Berners-Lee invented?
A)
Hyperlinking
B)
HTML and CSS
C)
Hypercard
D)
Deep Linking
A) Hyperlinking
What does HTML stand for?
A)
Hyper Text Markup Language
B)
Hyper Text Modeling Language
C)
Hypertext Transfer Markup Language
D)
None of the above
A) Hyper Text Markup Language
What is the correct way to make sure a form uses a servlet you created?
A)
Set the name parameter in the url to the name of the servlet.
B)
Set the action attribute of the form to the name of the servlet.
C)
Set the name attribute of the form tag to the name of the servlet.
D)
Set the method attribute to POST in the form tag.
B
Why would you use JavaScript on the front end for form validation?
A)
You can't. Form validation can only happen on the backend.
B)
Because this is the only place you can perform form validation.
C)
Because even though you also have to do it on the backend, JavaScript allows the form validation to happen without reloading the page or even submitting to the server.
D)
Because you have a choice between doing it on the front end or the backend, so sometimes you choose the front end.
C
Where do JavaScript functions belong?
A)
Anywhere in the html file
B)
In an external html file
C)
in the tag
D)
in the tag
D
Which of the following are true about Java servlets?
A)
Servlets can process data through doGet(), doPost(), and service().
B)
Servlets are compiled and executed on the server, but then generate client-side code to send back to the browser.
C)
Servlets are Java classes that can serve dynamic web content.
D)
All of the above.
D
Which of the following are true about AJAX:
AJAX uses JavaScript and HTML DOM to display the data
AJAX stands for Asynchronous JavaScript and XML
AJAX Json object offers two methods: parse() and stringify
AJAX allows for just part of a apage to be reloaded with direct access to the server
What function can be used to get a single HTML element from the page?
A)
getElementsByName()
B)
getElement()
C)
getElementByClassName()
D)
getElementById()
D
WebSocket is best suited for...
A)
Dynamically sending and receiving messages
B)
Putting on a sock
C)
Loading web content without refreshing
D)
Streaming multimedia content
A
Which statement below is false?
A)
Updates to a page made via AJAX will not be displayed until the client's window is refreshed
B)
AJAX applications can transport data as JSON text
C)
AJAX stands for Asynchronous JavaScript And XML
D)
AJAX uses a browser built-in XMLHttpRequest object
A
What code is embedded in JSON.parse() ?
A)
evaluate()
B)
XMLHttpRequest.status
C)
JSON.stringify()
D)
eval()
XMLHttpRequest.status
eval()
IDK
What is the purpose of JSON.parse()
A) Avoid Javascript code injection
B) Ensure that the Ajax response in "valid" JSON
C) Convert JSON text string into a JavaScript object
D) All of the above
D) All of the above
A) Avoid Javascript code injection
B) Ensure that the Ajax response in "valid" JSON
C) Convert JSON text string into a JavaScript object
Why does AJAX exist?
A)
To reload part of a page without refreshing the entire page.
B)
To asynchronously send data to the server to validate information.
C)
Both A and B
D)
Neither A nor B
C (A and B)
What are solutions to the cross-domain issue for resources such as JavaScript of JSON?
A)
Use a server "proxy"
B)
Use CORS, if available
C)
Access exclusively resources in the same domain
D)
All of the above
D) All of the above
CORs allows fonts to be retrieved cross domain
True
Docker ...
A)
Allows developers to easily deploy their applications in a sandbox
B)
Allows users to package an application with all its dependencies into customized units
C)
Maximizes software packaging
D)
All of the above
A
Docker:
All of the above
Decouples software from underlying host
Allow extremely higher efficient sharing of resources
Has security issues
The Docker Ecosystem includes:
- All of the above - Service discovery - Storage - build/continuous integration
With Virtual Machines, it is difficult to predict the size of the VM instance.
A) True
B) False
True
In AWS Lambda ...
A)
Functions can be triggered only from HTTP
B)
You never pay for idle time
C)
Auto-Scaling is sometimes Available
D)
All of the above
B
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
Containers ...
A)
Are lightweight
B)
When running on same host, share same Linux kernel
C)
Are portable
D)
All of the above
D
Which of the following is NOT an access modifier in Java?
Imported
A Java constructor must share the name of the class.
Always
Where are files stored in a computer system?
Non-volatile memory
What is the difference between the next() and nextLine() methods in the Scanner class?
next() reads up until the first space, whereas nextLine() reads an entire line
A package in Java is similar to what C++ concept?
Namespace
What is the motto of Java?
Write once, run anywhere.
How are Java objects allocated?
All Java objects are dynamically-allocated.
By convention in Java, all classes start with...
A capital letter
__________ of an object operate on the data that is part of the object or data that is passed into the method (and usually on both).
Methods