This is taken from a real world situation faced by our engineers. There are no right and wrong answers - it isn't that sort of test. Simply read what follows and answer the questions at the end in as much detail as you can.
Refer to whatever books, web sites, people you wish to and include such references in your answer. You aren't required to know everything! Being able to use available resources effectively is an important skill!
There is no time limit. There are no exam conditions. If you can answer the questions in 10 minutes you obviously know plenty (and are a fast typist!). If it takes several weeks you probably learnt a lot in the process. Regardless of the time taken you should be prepared to discuss your answers in depth during an interview!
Answers should be emailed, along with CV (or resumé) and covering note to jobs@eris-associates.co.uk
A certain hardware manufacturer builds a "lights out" or "remote console" service processor into their servers. It is possible to connect to the service processor using SSL and interact with it via a web browser. It is also possible to issue commands by sending an XML document. The result is returned as another XML document.
As the service processor runs independently of the main system and regardless of whether the main system is powered on or not this provides a value means of accessing system configuration and health information and of power cycling the server if it hangs. Therefore we developed a suite of Perl scripts for interacting with the service processor.
We connect to the service processor's SSL port using the IO::Socket::SSL Perl module. Since only basic SSL features are used this is straight forward:
$sock = new IO::Socket::SSL->new(
PeerAddr => $host,
SSL_cipher_list => "ALL"
);
The XML documents used for commands are stored as lists of lines. We select the relevant list for the required command, make some parameter substitutions and then simply write it to the socket we obtained earlier.
If we write the lines using this code:
for my $line (@lines) {
print $sock $line, "\r\n";
}
we get the response, "405 Method Not Allowed".
However, if we write the lines using this code:
for my $line (@lines) {
print $sock $line . "\r\n";
}
it works and a XML document is returned as expected.
Describe the protocols which take part in the communication between the client and the service processor, giving details of their layering and interactions. Remember to mention any ancillary protocols that might be used during set up of the connection but do not necessarily take part in the connection itself.
Explain the difference between the two code fragments used to write commands to the socket. Describe, in detail, what Perl does in executing this code.
With reference to your answers to 1 and 2 suggest reasons why the service processor may see a difference between the two code fragments and why it may fail on the first.
Given only the broad overview of the requirements above write a complete Perl script that will read an XML command document from a file, substitute __X__ with the value for X specified on the command line (X can be any alphanumeric string), send it to the service processor and output the result. (There is no need to try and parse the result!)