Skip to:

C/C++ & TCP skills test

Introduction

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

Part 1

A customer has recently moved a server application from a Solaris host to a Linux host. After this move they discover that a client application now only receives a partial reply from the server.

The owner of the server application claims that the server writes all the data. No evidence is provided but there is no reason not to believe this statement.

The expected length of the reply is 11333 bytes. The client only receives 2940 bytes.

Strangely this only seems to affect some hosts. The customer tells you that the Windows version of the client application, built from the same source, sees the full reply, for example.

Questions

  1. Can you suggest what the problem might be?

  2. What is the significance (if any) of the 2940 bytes?

  3. How might the customer investigate the problem further?

  4. Can you suggest changes at this stage that might solve the problem?

Part 2

The customer has sent you the relevant sections of their application, socket library and a packet trace. The packet trace was obtained using the snoop command on the Solaris host that runs the server application.

After adding a second recv() to try and read more data they find they read another 2940 bytes and then get a "Connection reset by peer" error.

Questions

  1. What does "Connection reset by peer" mean? Why is it necessary?

  2. Can you suggest what the problem might be?

  3. How many bugs can you find in the given source?

  4. How many bugs can you infer in the server?

 

Company Registration