Garmin Interview Question: "Technical challenge" - with ... | Glassdoor

Interview Question

Avionics Software Engineer Interview Olathe, KS

"Technical challenge" - with two anxious interviewers

  staring at you across a table provide code / pseudo code of how to reverse a linked list in five minutes or less with them showing visible frustration if you weren't ready for this. No other questions about C or C++, just do you remember data structures class from 20 years ago which you haven't had reason to use since.

Interview Answer

4 Answers


Study up on data structures!

Interview Candidate on Oct 11, 2012

If I had to respond instantaneously, I'd probably have just said something about iterating over the list, pushing the elements onto a stack, then popping them off the stack and building a new list. Any recursive solution to this problem would probably be equivalent to this one unless it did something really weird (the call stack would implicitly be used as the stack that I used explicitly here).

However, you could also do this in constant space by just reversing the links themselves.

guy on Dec 19, 2012

A typical function without additional memory allocation would be:
// Let Arg represent the struct type of node of linked list
Arg *reverse(Arg *list){

  Arg *new_list = NULL;
  while (list) {

    Arg* next = list->next;
    list->next = new_list;
    new_list = list;
    list = next;
  return new_list;

Shishir on Feb 13, 2013

Put you in a completely artificial programming environment that has no relation to how a developer actually works at their place and will evaluate you based on that. The obvious thing to do is study lots of interview questions, practice solving them with a white board and perhaps doing things on paper.

As far as myself I actually code on a workstation and develop code incrementally where I run tests ASAP on a small portion. Of course reversing a linked list is a small task. Still evaluating your code in a completely artificial, non programming environment is ridiculous. Yet many, many companies do exactly that. I have had to provide coding samples via online sources and that works much better. There isn't a shred of evidence that operating in this mode provides companies with the best hires. It's an exercise in intellectual laziness. Really how a company interviews you reveals a lot about how the company views their employees and how you will be treated as an employee.

Ridiculous How Companies Do This on Nov 3, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.