Work in HR or Recruiting?
Garmin
www.garmin.com Olathe, KS 5000+ Employees
Work in HR? Complete Your Profile

104 interview experiences Back to all Garmin Interview Questions & Reviews

Interview Question for Avionics Software Engineer at Garmin:
Oct 11, 2012

"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.


Add Tags [?]

See more for this Garmin Avionics Software Engineer Interview

Helpful Question?  
Yes | No
Inappropriate?

Answers & Comments (3)

Oct 11, 2012

by Interview Candidate:

Study up on data structures!
Helpful Answer?  
Yes | No
Inappropriate?

Dec 19, 2012

by guy:

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.
Helpful Answer?  
Yes | No
Inappropriate?

Feb 13, 2013

by Shishir:

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;
  }
Helpful Answer?  
Yes | No
Inappropriate?

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.