I think that problem solving skills are more important than syntactical knowledge. A better question would be to ask them how they'd measure network traffic on a unix server. That way, you can drill down on specifics without getting hung up on syntax issues that would be found and corrected during the development process.
"If it's going to run as a one-shot, I'd run netstat using flags to isolate only the information I need and discarding the rest. I'd put a system call in a loop, use split to assign the different name-value pairs to a hash, and print them to STDOUT or to a file as CSV so we can import the data into an Excel spreadsheet or a graphing utility. If it's going to be running as a part of a standard test suite, I'd use a Unix::netstat instead of a system call to save CPU cycles. I could be wrong about the specific module name, but I'm sure that there's a module on CPAN to drive netstat. BTW, if you want to measure CPU and memory and disk i/o as well, sar is probably a better choice than netstat."
At this point, the examiner can determine that the interviewee knows something about unix and its internal monitoring tools, CPAN, hashes, the expense involved in doing repeated system calls, and how to present data. Plus, they have a bead on how to develop a quick-and-dirty tool vs. a productized tool suite. The specific syntax of netstat and split are things that can be checked once coding has begun. It's far more important to see the thought process and system experience than to nitpick over syntax. If you hire them, they'll have the Camel book on their desk anyway, so why freak out over comma placement?
"What do I want? I'm an American. I want more."
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||