The Object Management Group (OMG) was founded on the year:
The specification for CORBA 2.0 was released by the OMG on the year:
- 1995
- 1990
- 2000
- 1989
- This is a trick question: the COBRA 2.0 specification was released by Microsoft.
Which one of the following lists represents the order in which
these technologies were introduced by Microsoft, where the first
one is the earliest and the last one is the most recent.
- OLE, COM, ActiveX, DCOM
- ActiveX, OLE, COM, DCOM
- OLE, COM, DCOM, ActiveX
- ActiveX, COM, DCOM, OLE
- COM, DCOM, OLE, ActiveX
ActiveX was known as COM at one point, but then Microsoft decided that ActiveX would refer only
to visual components.
The four layers for the TCP/IP stack are, in order from top to bottom:
- Application, Transport, Internet, Host-to-Network
- System, Session, IP, Host-to-Network
- Application, IP, Transport, Host-to-Network
- Application, Operating System, Device Drivers, Host-to-Network
- Application, TCP, UDP, IP, Network
Transport is TCP/UDP, Internet is IP.
Which one of these statements about TCP and UDP is true?
- TCP guarantees that all packets are received and are in order, while UDP does neither.
- TCP guarantees that all packets are received, while UDP guarantees that they are in order.
- UDP guarantees that all packets are received, while TCP guarantees that they are in order.
- TCP is like FTP, while UDP is like MDP.
- Both TCP and UDP are faster than IP.
There is no such thing as MDP. TCP and IP are layered on top of IP, so they cannot be faster.
HTTP servers usual listen on port
You know, as in www.sillycompany.com:80
DNS stands for:
- Domain Name System
- Distributed Naming Scheme
- Distributed Network Standard
- Differential Naming System
- Divergent Networking Schemes
This is too easy!
The difference between a class B and a class C address is that:
- Class C only leave the last number free, while
Class B leave the last two numbers free, as in 199.1.2.* and
199.1.*.*, respectively.
- Class B only leave the last number free, while
Class C leave the last two numbers free, as in 199.1.2.* and
199.1.*.*, respectively.
- Class C are of the form *.net, while class B are of the
form *.com
- Class B are of the form *.net, while class C are of the
form *.com
- Class C use four numbers, as in 129.1.2.2, while class B
use five, as in 129.1.2.3.4
Do not confuse IP numbers with domain names.
A firewall service:
- Blocks IP packets based on their
source/destination addresses.
- Works at the application layer.
- Forces every application to connect to the firewall
service before going outside the network.
- Usually applies an extremely complicated set of rules to
determine whether a packet comes from a trusted source or not.
- Can cache Internet objects.
Most of the other choices refer to a proxy service, not
to be confused with a firewall.
From the choices below, pick the best example of a 3-tier system.
- A web browser, and a web server that is connect
to a database server running on another machine.
- A web browser running an applet, and a web server.
- A web server running Java servlets, and a web browser.
- A Java program running on the Java Virtual Machine which
then runs on Microsoft Windows.
- A Java program that uses sockets to communicate with
two other servers.
Java servlets run on the same machine as the server (2-tier).
The main standards-setting bodies for Internet protocols are:
- IETF and W3C
- W3C and Microsoft
- IEEE and W3C
- Sun, Microsoft, and IBM
- ISO and IEEE
ISO and IEEE are standards-setting bodies, but not so
much for the Internet.
If you type the URL
ftp://www.sc.edu:index.html@file1/help
into a good web
browser, the browser will:
- Try to fetch, using ftp, a file called "help" from a
machine called "file1" using username "www.sc.edu" and
password "index.html".
- Try to fetch, using ftp, a file called "index.html" from a
machine called "www.sc.edu".
- Return an error because the URL is malformed.
- Try to fetch, using ftp, a file called "file1/help" from a
machine called "www.sc.edu" using username "index.html".
- Try to fetch, using ftp, a file called "index.html" from a
machine called "file1" using username "index.html".
Tricky, ah?
If a server running an http server receives a GET command, the
first thing it returns is:
- The http version number and a response code.
- The requested file.
- \r\n\r\n
- The MIME type of the contents that it will return.
- The length of the file, then the file.
After you issue a GET command to an http server and receive
a response from the server:
- The connection is closed.
- If the response was an error code, you can resend a new
command on the open socket.
- You have to send /r/n/r/n/ to indicate that your command
is done.
- The server will send /r/n/r/n after the file contents, at
which point you can close the connection.
- You have to send /r/n/r/n and then close the connection.
The answer is only true for HTTP 1.0, but all the other
ones are wrong for all versions of HTTP.
An important difference between HTTP 1.0 and HTTP 1.1 is:
- That 1.1 does not require the connection to be
closed after one command.
- That 1.1 was developed by the W3C while 1.0 was never
sanctioned.
- That 1.1 implemented cgi-bin functionality.
- That 1.1 implemented the POST method.
- That 1.1 supports many new MIME types.
This allows for faster browsing since the connection does
not have to be re-established for each image on a page.
The Common Gateway Interface allows web servers to:
- Run a program when they receive a particular
URL, instead of just returning a file's contents.
- Forward requests to other web servers.
- Execute Java servlets.
- Use a statefull protocol.
- Provide secure access to the server's files using the
Secure Socket Layer protocol.
Thats CGI!
The correct Java notation for chaining a
BufferedInputStream
around a given
FileInputStream fin
is:
BufferedInputStream bin = new BufferedInputStream(fin);
BufferedInputStream bin = new FileInputStream(fin);
BufferedInputStream bin = BufferedInputStream.chain(fin);
BufferedInputStream bin = fin.getBufferedInputStream()
BufferedInputStream bin = FileInputStream
The Java PrintStream
is a good stream to wrap around
a Socket
because:
- It is not good because it ends lines
with \n in some architectures and \r\n in others.
- Because it buffers data, thereby making the TCP connection
faster.
- Because it writes the data in a buffer and only sends it
when the other side requests it.
- Because its easier to use.
- Because its an agreed-upon coding standard.
The difference between the OutputStreamWriter
and
the OutputStream
class hierarchies lies in the fact
that:
OutputStreamWriter
works with many
character sets, not just ASCII.
OutputStreamWriter
buffers data.
OutputStreamWriter
output is
machine-dependent, so it ends lines with /n in some architectures
and /r/c in others.
OutputStreamWriter
has methods for
controlling the speed of the output.
- There is no
OutputStreamWriter
class!
The correct way to create a new InetAddress
object
that points to www.sc.edu is:
java.net.InetAddress adr = java.net.InetAddress.getByName("www.sc.edu")
java.net.InetAddress adr = new java.net.InetAddress("www.sc.edu")
java.net.InetAddress adr =
java.net.InetAddress.getByLocation("www.sc.edu")
java.net.InetAddress adr = new java.net.InetAddress.getByName("www.sc.edu")
java.net.InetAddress adr = new java.net.InetAddress.getByLocation("www.sc.edu")
The URL
class in java uses which design pattern for
generating new URL
objects?
- Strategy
- Factory
- Algorithm
- Adapter
- Composer
In order to fetch a file pointed to by some URL held in
String myurl
, you need to:
URL u = new URL(myurl); InputStream in =
u.openStream()
, then start reading from in
- Open a socket to the given machine and send a GET
command with the appropriate filename (as given by
myurl
).
URLConnection u = new URLConnection(myurl);
InputStream in = u.openStream()
, then start reading from
in
URL u = new URL(myurl);
, then start reading
from u
InputStream in = new InputStream(myurl);
,
then start reading from in
If you are writing an application where two machines communicate
with each other using a socket, then:
- One of them must implement a server socket and the
other one a client socket.
- Both machines can use the same source code, as long they
are told which one is opening the socket first.
- Both machines can use the same source code.
- Both machines need to implement client capabilities, and
one of them needs to implement server capabilities.
- One of them must implement the HTTP protocol.
The main class used in Java for Socket connections is:
Socket
SocketStream
StreamSocket
SocketWriter
StreamWriter
Which one of the following is something you can not
change about the way a TCP socket works, using Java.
- The time between retries for sending a packet
that was lost.
- Whether packets are sent immediately or whether we wait
for an acknowledge of receipt for the previous packet.
- The time to wait, if any, to send outstanding packets
after a socket has been closed.
- The time to block waiting for an incoming packet.
- The size of the receiving buffer.
On Java, a ServerSocket
waits for a connection
using the method:
accept()
- There is no such thing as a
ServerSocket
,
there is only Socket
.
wait()
read()
bind()
You accept a connection.
Using Java, you can bind a server socket to a port by using:
- The constructor.
bind()
read()
accept()
- Server sockets are not bound to a port.
If a Java program using a server socket is expecting a lot of
connections, each one of which will take a long time to handle,
the programmer should:
- Make the program spawn a new thread to handle
each new connection.
- Increase the size of the waiting queue.
- Use a
BufferedOutputStream
.
- Make sure to return an error code.
- Close connections that are taking too long.
Increasing the waiting queue only helps a little bit.
In Java, if you wanted to encrypt the data that you are sending
over a socket, you would need to (pick the best choice):
- Use the socket factory that returns SSL sockets.
- Link with some vendor's cryptography library.
- Implement your own version of the RSA algorithm.
- Implement your own version of the RC4 algorithm.
- Implement your own version of the Cipher algorithm.
The typical, and probably best, way to handle the encryption of
a conversation between two parties is to:
- Use public key encryption to exchange a secret
key then use secret key encryption for the rest of the conversation.
- Use public key encryption.
- Use secret key encryption.
- Use secret key encryption to exchange a secret
key then use public key encryption for the rest of the conversation.
- Use the RSA algorithm.
In public key encryption: (pick the one that is true)
- Everyone has a pair of keys. If one encrypts
something with one key it can only be decrypted with the other one
in the pair.
- Everyone has one key they use to encrypt and decrypt
messages
- One uses the private key to encrypt messages and the public
key is used to decrypt them.
- One uses the public key to sign messages and others use
the private key is used to verify the signature.
- There is very little security.
If you are implementing a "chat" program, and you want to
encrypt the conversation, you probably should not:
- Use a block encryption algorithm.
- Implement it in Java.
- Use TCP sockets.
- Give the users encryption keys.
- Close the socket after the conversation is over.
Because it needs at least 64 bits before it can encrypt
the data.
The standard procedure for communicating using UDP, in Java,
involves (pick the best):
- Opening a
DatagramSocket
and
either sending or receiving data on it.
- Using a
UDPServerSocket
on the server, which
listens on a port, and a UDPClientSocket
on the client.
- The server must bind to a port, the client can then
connect to it.
- Sending packets with
DatagramSocket
and
receiving them on a Socket
- Creating a
DatagramPacket
and sending it on a regular
Socket
.
In Java, the code for sending a UDP message String msg =
"Hello"
to InetAddress ia
at port 4848 is:
DatagramPacket dp = new
DatagramPacket(msg, msg.length, ia, 4848); DatagramSocket socket =
new DatagramSocket(); socket.send(dp);
DatagramPacket dp = new
DatagramPacket(msg, msg.length, ia, 4848); Socket socket =
new DatagramSocket(); socket.send(dp);
DatagramSocket socket =
new DatagramSocket(); socket.send(msg);
DatagramSocket socket =
new DatagramSocket(); socket.send(msg, msg.length, ia, 4848)
DatagramPacket dp = new
DatagramPacket(msg, msg.length, ia, 4848); dp.send(dp);
If you are planning to implement a program which will use the
SMTP protocol, the most authoritative document on the protocol
can be found in:
- One of the IETF's RFCs.
- The W3C website.
- The Microsoft website.
- The Sun website.
- A book on HTTP.
A Java Socket
is an abstraction for communicating using:
- The TCP protocol.
- The UDP protocol.
- The IP protocol.
- A broadcast medium.
- The Ethernet.
TCP is a better answer than IP.
The MIME type of data returned by a webserver is determined by:
- The header information in the reply.
- The last three letters of the file after the period (e.g.,
.gif)
- This is a trick question, MIME is communications
protocol.
- This is a trick question, MIME is a protocol for e-commerce.
- The type of data returned.
MIME was originally developed as a way to exchange
multimedia email.
Most machines on the Internet use the SMTP protocol to exchange
email. If you are not receiving email sent to you it could be because:
- The firewall you are behind is blocking the
SMTP port.
- A virus is deleting the email in transit.
- Your webserver is down.
- You are using SSL.
- The SMTP network is using UDP.
Yeah, or maybe nobody wants to talk to you ;-)
Sockets are:
- An abstraction for communications built on top of TCP/IP.
- Available only in Java.
- A Microsoft invention.
- An abstraction for communications built on top of HTTP.
- Permanent connections.
Tooooo easy.
On January 2001 Microsoft's websites could not be reached
because of a DNS misconfiguration, which meant that:
- People were unable to find the IP number for www.microsoft.com.
- The webservers could not be reached in any way from the
rest of the Internet.
- A denial of service attack prevented the webservers from responding.
- TCP packets from the webservers were being routed to the
wrong machines.
- TCP packets from browsers could not reach the webservers
because they were being routed in a loop.
The DoS attack came later, check it out.