What can I expect when I do a computer science major?

What to expect in the future when trying to search for computer science jobs?

  • I am majoring in computer science. I'm currently enrolled in my 3rd semester in a C++ course. So I have a little under a year and a half of experience in C++. My teacher says two of her graduate students just landed jobs at a reputable computer company. She says for their interview, they had them go up to a white board and explain how they would reverse a link list using a stack. I would never be able to do that.. When I write computer programs, I spend hours just trying to understand what my assignment is asking.. Hell, if they went up and asked me to explain something as simple as dynamic arrays or something, I think I'd be screwed.. AND I'VE BEEN DOING THIS FOR A YEAR AND A HALF!

  • Answer:

    Those types of tests don't really demonstrate how well you can program. They can usually be worked out fairly easily on the spot. Here's one way you might do it: #include <stddef.h> struct elem { void *data; struct elem *next; }; static size_t countelems(struct elem *head) { size_t size = 1; while ((head = head->next) != 0) size++; return size; } struct elem *revlist(struct elem *head) { struct elem *stack[countelems(head)]; size_t index = 0; struct elem *p; for (p = head; p; p = p->next) stack[index++] = p; head = stack[--index]; head->next = stack[index - 1]; while (index-- > 1) { p = stack[index]; p = p->next = stack[index - 1]; } p = stack[index]; p->next = 0; return head; } I wouldn't worry much, it seems like you just have to become a bit more familiar with data structures.

Andrew at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Those types of tests don't really demonstrate how well you can program. They can usually be worked out fairly easily on the spot. Here's one way you might do it: #include <stddef.h> struct elem {         void *data;         struct elem *next; }; static size_t countelems(struct elem *head) {         size_t size = 1;         while ((head = head->next) != 0)                 size++;         return size; } struct elem *revlist(struct elem *head) {         struct elem *stack[countelems(head)];         size_t index = 0;         struct elem *p;         for (p = head; p; p = p->next)                 stack[index++] = p;         head = stack[--index];         head->next = stack[index - 1];         while (index-- > 1) {                 p = stack[index];                 p = p->next = stack[index - 1];         }         p = stack[index];         p->next = 0;         return head; } I wouldn't worry much, it seems like you just have to become a bit more familiar with data structures.

henni

You may run into all kinds of different interviewers and interview questions. Here are some real ones: Why are manhole covers round (any other shape falls through hole when one person tries to put it in place). This was a real question from a friend's Microsoft interview. You have a chicken, a fox and a bag of grain that you need to cross the river with them in your canoe. You can only take one item at a time. How do you move the animals and grain to the other side without leaving the grain with the chicken or the fox with the chicken. (after you tell them the answer they ask you to explain that in a mathmatical expression). This was a real question from another friend's Microsoft interview. Don't get to worried about this. You never can tell how easy or difficult the interview will be. Best Wishes!

Richard L

You may run into all kinds of different interviewers and interview questions. Here are some real ones: Why are manhole covers round (any other shape falls through hole when one person tries to put it in place). This was a real question from a friend's Microsoft interview. You have a chicken, a fox and a bag of grain that you need to cross the river with them in your canoe. You can only take one item at a time. How do you move the animals and grain to the other side without leaving the grain with the chicken or the fox with the chicken. (after you tell them the answer they ask you to explain that in a mathmatical expression). This was a real question from another friend's Microsoft interview. Don't get to worried about this. You never can tell how easy or difficult the interview will be. Best Wishes!

Richard L

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.