Favorite Technical Interview Questions?

That's the problem with the necro-revival-threads, somebody (aka @John_Phoenix) inevitably ends up responding to a very old post.

:ROFL: Time, what is that? A mere trivial designation created by silly humans to get to the office at a particular point in our solar systems rotation.

Then again I've been known to sling some xslt in js... And yes, I do need to put new tyres on the Delorian.
 
Interview question:

1) How would you detect if a ray in 3-space intersected a triangle?
2) Can you do it without a divide?
2b) Why would you want to avoid the divide?
3) How would you make this fast?
 
Trick question.

You cannot fill a pointer with random data. A pointer is a variable which contains the address in memory of another variable . You can change the address of the pointer , but you cannot fill it with anything other than an address.

Although this answer is obtuse , it points out the fragile nature of technical questions in interviews and how they have to be carefully worded.

A pointer is thus merely an address in memory. You can increment it too using the ++ operator (as I have done before but years later came to bite me in the arse when the pointer got incremented past the end of an array when I ported the code from embedded to Linux).

A pointer is an abstraction that hides you having to know that you are referencing an awful address in memory yes (something like $0204D2F0). In C you assign to a pointer, a variable or a struct. Impossible to assign random data to it, or even a known value (I tried to do this once)
 
Interview question:

1) How would you detect if a ray in 3-space intersected a triangle?
2) Can you do it without a divide?
2b) Why would you want to avoid the divide?
3) How would you make this fast?
3) offload to an rtx2080 gpu? :D
 
Interview question:

1) How would you detect if a ray in 3-space intersected a triangle?
2) Can you do it without a divide?
2b) Why would you want to avoid the divide?
3) How would you make this fast?

"I used to know but I can tell you after a few Google searches." ... what I'm worried may be my answer for most interview questions lately.
 
A pointer is an abstraction that hides you having to know that you are referencing an awful address in memory yes (something like $0204D2F0). In C you assign to a pointer, a variable or a struct. Impossible to assign random data to it, or even a known value (I tried to do this once)

Umm...
*(intptr_t*)&ptr = rand();
Or
voidptr = (void*)(intptr_t)randomVal;

Or memcpy, memmove, or for loop over char* cast, etc.
 
Last edited:
Simple questions I asked before and gave the candidates a laptop :

1. What is my domain name?
2. What is my public IP?
3. What is the IP of my DHCP server?
 
Umm...
*(intptr_t*)&ptr = rand();
Or
voidptr = (void*)(intptr_t)randomVal;

Or memcpy, memmove, or for loop over char* cast, etc.
Why do that.. its dangerous.
I would never do that...
Hence why my argument these days is.. I will do what is necessary, and what works reliably.. not what the mathematicians and OOP fanboys want me to do..
 
Why do that.. its dangerous.
I would never do that...
Hence why my argument these days is.. I will do what is necessary, and what works reliably.. not what the mathematicians and OOP fanboys want me to do..

Nobody would do that, except to a test a systems resilience to bad code. The question is what would happen if you (or someone else) did do it in order to see if you understand what would happen.
 
Man looking back at my opinion on this in 2013. How much I have changed :p

Doing tons of interviews these days and I don't interview at all like I thought was best back then
 
Man looking back at my opinion on this in 2013. How much I have changed :p

Doing tons of interviews these days and I don't interview at all like I thought was best back then

How have your interviews changed? Are you hiring for the same types of roles?
 
Considering this thread is a bit of mixed bag; I guess it's should be ok to throw in a few Functional Programming questions (from easy to difficult):
  • What's the difference between a Monoid and Semigroup?
    • Including a typical example of each
  • What's the difference between a Functor and a CoFunctor,
    • Including a typical example of each.
  • What is a Natural Transformation?
  • What is the difference between a Free algebra and a standard algebra e.g. Monad vs. Free Monad?
  • What is typical use case for Free Applicative Functor, and in what situations would this typically be preferred to a Free Monad.
  • What is the intrinsic value of the Yoneda Lemma with respect to Profunctor Optics.
 
Party mode! To be answered while listening to some Daft Punk, Basement Jaxx or Leftfield.

For Js/css/dom on the frontend (browser)

1. Draw a picture :) Explaining the browser event loop when the user clicks a button.

2. Explain in your own words, how the browser gets from an html file to a live dom. Style points will be awarded.

3. Name your favourite type of coffee, the milk:sugar:caffeine ratio you prefer and how many cups (of coffee) you have in a day. ( I actually asked this as a icebreaker question)

4. Write a prototype function that converts hex color with alpha to rgba (you have 15 minutes or 1 cup of warm coffee)
 
Last edited:
Considering this thread is a bit of mixed bag; I guess it's should be ok to throw in a few Functional Programming questions (from easy to difficult):
  • What's the difference between a Monoid and Semigroup?
    • Including a typical example of each
  • What's the difference between a Functor and a CoFunctor,
    • Including a typical example of each.
  • What is a Natural Transformation?
  • What is the difference between a Free algebra and a standard algebra e.g. Monad vs. Free Monad?
  • What is typical use case for Free Applicative Functor, and in what situations would this typically be preferred to a Free Monad.
  • What is the intrinsic value of the Yoneda Lemma with respect to Profunctor Optics.
Cheeses Crust this just cut the copper between my ears.
 
Screw you guys.

I have read through this thread out of interest. No wonder the RPL framework requires 8 years before they will even consider diploma exemption. Alas, I shall continue learning.

Thanks to this thread I have vested myself in C and mathematics pertaining to Computer Science.

Once I am of the means, I will go ahead and study CS.

You guys can really put the fear God into a n00b
 
Cheeses Crust this just cut the copper between my ears.
Sorry... ;) it's very strongly tied to mathematics; hence the terminology is a bit alien; once you put that aside most of the base concepts e.g. (monoid, semigroup and functor) are quite easy to learn.

monoid.png

Most of the concepts like (Binary Operations / Associativity / Commutativity) can be considered to be high school topics, except for functor and cofunctor (or mathematical duality in general).
FYI Many European high school curriculums in comparison do however cover some base category theory / abstract algebra concepts.

Meaning the first set of questions should be fairly easy to answer for anyone with prior experience with FP; in respect to the basics it's not really that much different to questions that test prior knowledge of OOP patterns for OO programmers.

The last series of questions relate to fairly recent areas of research; so even for FP programmers this can be considered fairly new stuff, for example:
If you google; "Yoneda Lemma Profunctor Optics"; you'll generally find most of the references are from the last 2 years, and the top link is to a Oxford research paper published in September 2018; however the math however behind e.g. "Yoneda Lemma" derives from research in 90's, whereas the topic of functional optics, is generally derived from research done in the last 2 decades.
 
Last edited:
Just ask Java newbies (and j2ee guys) about static, pass by and immutability and then give them sample code to hang themselves on. Beside 1 person, after over 150+ interviews I’ve yet to find a single other person (I suspect the one got prepped) to get all three right.. I’d guess and say avg get 0.75 right out of the 3. Yes that means most don’t even get 1 right.

Have to wonder what they teach in university these days as jvm & understanding how memory management works is crucial building blocks.
 
Top
Sign up to the MyBroadband newsletter
X