Hacker Newsnew | past | comments | ask | show | jobs | submit | akp__'s commentslogin

b _exit.c: 32

This guy is my hero.


I have interviewed with Amazon somewhat recently.

The NDA was very short (I'm not a lawyer, but it didn't seem nearly complicated enough to warrant needing a lawyer to read it) and the recruiters gave us time to look over it. There was nothing ridiculous in it and it was only to cover the interview process.

As far as I remember it was just stuff like "don't share details about what goes on in our interviews with others" which is pretty reasonable.


Ugh, just looking at that graph makes me feel anxious.


I'm no expert here, just curious. I've seen this brought up a couple times now: what's wrong with void pointers? How else would you do this in C? If you wanted abstractions to help with pointer lifetimes wouldn't you just be better off using C++?


The limitation with void pointers is that it can only inline values <= the size of a pointer. If you have something larger then you need to allocate it separately which may have cache efficiency issues.

The main alternative, other than hardcoding an element type, is to use macros and pass the element type in the definition.

Sometimes you just don't have the option of a C++ compiler. Also, and this was a situation I was in recently, I needed a collection in a small area of my C code so it really didn't warrant a toolset change.


Void pointers mean no type safety, preventing a lot of potential compiler optimizations and static analysis checks. 99% of the time the right thing to do is just create a new type:

  typedef struct Strref_t {
    char* str;
    size_t ref;
  } Strref;
There, just pass a pointer of that type around.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: