education
Oral examinations — C/Unix
Filed Under:
In the process of sorting through archives and old stuff, I found a collection of sticky notes that colleagues and I used five years ago to evaluate students at EPITA. These were oral examinations with no computer, only pen and paper or whiteboard. As I am recycling the paper, here is the transcript for archival.
- each page of the Unix User Manual belongs to one of its sections. Give the title of each of the first three sections.
- given two C++ strings
s1ands2representing two large numbers expressed in baseb(each character is a digit), write an algorithm that returns the sum (as a C++ string of digits) expressed also in baseb. - what is the canonical mode for a terminal? Explain.
SIGKILLandSIGSEGVexcluded, give the name of 5 signals, their meaning and their use(s).%d,%iand%xexcluded, give 5 distinctprintfformat conversion specifiers.- give 6
gccoptions and explain them. Only the options properly explained are accepted. - give the library function names and data types involved in reading a Unix directory.
- given a
makemacro named SRC defined to an arbitrary list of Texinfo file names (e.g.SRC = foo.texi bar.texi ...), write aMakefilewhich creates PostScript and PDF output for these sources, using commandstexi2dvi,texi2pdfanddvips. - given a 2D character array (dimensions
WandH) with each cell set toXorO, representing respectively ground and water (it's a map), write an algorithm which takes the coordinates of two points and which returns true if and only if one can swim from one point to the other. - write an algorithm which takes two strings as input and returns true/false according to whether the two strings are anagrams of each other (e.g.
abc/bca -> true,aab/bba -> false). - given an array of zeros and ones, write an algorithm that returns the index in the array which maximizes the sum of the number of zeros on the left and the number of ones on the right (e.g.
001101 -> 2). - given the expression
printf(1["foo"]), comment. - given a sorted integer sequence
sand an integern, write an algorithm which returns the value inswhich is closest ton. - write an algorithm which takes a string representing an arithmetic expression as input and which returns true if and only if parentheses are properly balanced.
- write an algorithm which takes a character string as input and returns the character with the most occurrences.
- given a 2D character array (dimensions
WandH) with each cell set toXorO, representing respectively ground and water (it's a map), write an algorithm which returns the sum of the lengths of the coasts. Each cell side counts for 1. - given a directed graph structure
G, an operatorVwhich for a given graph returns the set of nodes, and an operatorTwhich for a given nodenreturns the set of nodes accessible fromn, write an algorithm which takes a graph as input and returns true if and only if the graph contains cycles. - to establish a connection with a client, a TCP server on Unix must call four library functions; give their name and the call order.