If you're just trying to test their raw knowledge of iPhone coding...
Start them with the standard C reverse a string test. If they can't do that to 90% accuracy, they're not a C programmer (typos and out-by-one errors only count as errors if the applicant can't correct them with hinting). It's the standard test and any good C programmer has done it 3 times before in interviews and won't hesitate.
Maybe ask them to sketch out code for a tableView:cellForRowAtIndexPath: method constructing a UITableViewCell with a text label and disclosure indicator. This is hands down the most commonly implemented construction on the iPhone. They don't need to memorize the names of the methods or constants but all the steps should be there.
Accurate solution is:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"MyDisclosureCell";
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil)
{
cell =
[[[UITableViewCell alloc]
initWithFrame:CGRectZero
reuseIdentifier:cellIdentifier]
autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
// Configure the cell
cell.text = label;
return cell;
}
Important steps are: get an identifier (unique for this row-type), dequeue, conditional if doesn't exist, construct, set accessoryType (this is optionally outside conditional), set label, return.