Here is something that unfortunately cost me a job as a front end "engineer" at Facebook. It's so simple and I fucking cringe when I think about it but they had me on a phone interview and wanted to do a live coding session, so the guy on interview could see what I was typing in real time. He asked me to code a function that would "walk the DOM", so a recursive function that would return all DOM elements below a particular element. Not that hard and something that I had coded more than once back around 2005 when I was getting started in web dev and before jQuery and similar libs were so common place. Trouble is since then I had grown to rely more and more on libs like jQuery because I didn't have time to fuss with raw js when working against inconsistent DOM APIs, not to mention every project I worked on was always on a tight deadline, so I choked on the phone trying to code this function because I hadn't coded something like that in a while. He was not impressed.
All of this was AFTER I had completed some programming task for them as a test on my own time. It was a pretty difficult scheduling problem but I kept working at it until I had a reusable elegant solution and I completed it well within their allotted time limit. That all meant nothing to them as soon as they saw that I was getting frustrated with writing a function I hadn't needed for years in less than 30 seconds. I asked them if they really avoided using jQuery in their code base. They said they avoid it because it's heavy on bandwidth... they avoid using the massive productivity boost to developers because it's heavy on bandwidth. I don't even believe that to be true. I think they were just feeding me a line in order to justify forcing me to code something using the raw DOM API.
So what is the lesson here? FUCK FACEBOOK!
No, the real lesson is to not grow too dependent on libraries, but this is largely dependent on the culture of the shop you happen to work in. In my experience, most places understand that libraries are designed to save time and energy that would be better spent building applications instead of writing a million and one workarounds for browser bugs, but you never know when the situation is going to call for lower level browser specific javascript APIs.
Not a typical programming job. But for a Embedded software engineer position (think Assembly and Hardware Description) I was asked to design a multiplexer with XNORS.
Given two sets (as arrays), write a function that takes both as inputs and returns an array of the union of the arrays.
Given two sets, write a function that takes both as inputs and returns and array of the intersection of the arrays. Order doesn't matter.
Given stubs of a class (our example is a class that handles browser functionality, which has method stubs like back(), forward(), etc), what tests could you provide to test core and edge case functionality. No code is expected to be written in this exercise.
When I hire, I typically tell the person to go on to Project Euler solve whatever problems he wants at any level he wants and send me what he has in a week's time.
It's pretty easy to look at the submissions and get an idea of what skill level the guy is at.
A couple of good size porjects. One was code a ball clock, and show the stage of the ball after N iterations (http://www.idle-tyme.com/). Another, was code a bulding (or building) with elevators, picking up people and showing traces - one difficulty was pick up people if you happen to be going past them while an existing elevator is moving. Or how would you code a app that looks up words while punching them using a phone 10 digit pad.
Understand recursion and pointers, and completely ace a data structures / algorithms class; having a decent grasp of combinatorics is very helpful, too. The coding challenges I give in interviews are almost always something like "here's a trivial game, write an algorithm to solve it optimally", which usually involves recursion, some sort of simple data structure, and combinations. Strong candidates solve these in about an hour (we allow 1.5 hours).
Make a relationship graph similar to LinkedIn. Write a code to get how close person B is to person A from that graph. (15 min to half hour)
Follow up: What are some of the things you should worry about when traversing?
You have a large logs of different events. Given that it has a column of time, IP address, description, and event type, write a code that checks for three sequential events from a same IP address. (15 min to half hour)
Follow up: How would you improve the logging system to allow for easier classification of "sequential events?"
Given a set of substitution cipher text, write a code to decrypt it in language of your choice. (Gives you an hour to do this with a laptop)
For an April Fools joke, you are to design and code a password login front-end that takes in a password that is case insensitive and lets users login for a case sensitive user password. Assume there is no API call limit for login. (One hour, white board)
Generally I noticed a lot of recent interview questions that I got is regarding graph and tree traversal. There are some recursion questions as well.
15 comments
2 u/fun_loving_terminal 30 Jul 2015 21:35
Here is something that unfortunately cost me a job as a front end "engineer" at Facebook. It's so simple and I fucking cringe when I think about it but they had me on a phone interview and wanted to do a live coding session, so the guy on interview could see what I was typing in real time. He asked me to code a function that would "walk the DOM", so a recursive function that would return all DOM elements below a particular element. Not that hard and something that I had coded more than once back around 2005 when I was getting started in web dev and before jQuery and similar libs were so common place. Trouble is since then I had grown to rely more and more on libs like jQuery because I didn't have time to fuss with raw js when working against inconsistent DOM APIs, not to mention every project I worked on was always on a tight deadline, so I choked on the phone trying to code this function because I hadn't coded something like that in a while. He was not impressed.
All of this was AFTER I had completed some programming task for them as a test on my own time. It was a pretty difficult scheduling problem but I kept working at it until I had a reusable elegant solution and I completed it well within their allotted time limit. That all meant nothing to them as soon as they saw that I was getting frustrated with writing a function I hadn't needed for years in less than 30 seconds. I asked them if they really avoided using jQuery in their code base. They said they avoid it because it's heavy on bandwidth... they avoid using the massive productivity boost to developers because it's heavy on bandwidth. I don't even believe that to be true. I think they were just feeding me a line in order to justify forcing me to code something using the raw DOM API.
So what is the lesson here? FUCK FACEBOOK!
No, the real lesson is to not grow too dependent on libraries, but this is largely dependent on the culture of the shop you happen to work in. In my experience, most places understand that libraries are designed to save time and energy that would be better spent building applications instead of writing a million and one workarounds for browser bugs, but you never know when the situation is going to call for lower level browser specific javascript APIs.
2 u/TyrellCorp 30 Jul 2015 21:37
No free code. My examples speak for themselves.
You guys are getting used.
1 u/NewtAgain 30 Jul 2015 21:16
Not a typical programming job. But for a Embedded software engineer position (think Assembly and Hardware Description) I was asked to design a multiplexer with XNORS.
1 u/a_of_s_t 30 Jul 2015 21:57
Here's some questions we asked:
Given two sets (as arrays), write a function that takes both as inputs and returns an array of the union of the arrays.
Given two sets, write a function that takes both as inputs and returns and array of the intersection of the arrays. Order doesn't matter.
Given stubs of a class (our example is a class that handles browser functionality, which has method stubs like back(), forward(), etc), what tests could you provide to test core and edge case functionality. No code is expected to be written in this exercise.
1 u/Master_Foo 02 Aug 2015 14:36
When I hire, I typically tell the person to go on to Project Euler solve whatever problems he wants at any level he wants and send me what he has in a week's time.
It's pretty easy to look at the submissions and get an idea of what skill level the guy is at.
0 u/ancientgoat 30 Jul 2015 21:26
A couple of good size porjects. One was code a ball clock, and show the stage of the ball after N iterations (http://www.idle-tyme.com/). Another, was code a bulding (or building) with elevators, picking up people and showing traces - one difficulty was pick up people if you happen to be going past them while an existing elevator is moving. Or how would you code a app that looks up words while punching them using a phone 10 digit pad.
0 u/bufferoverflow 31 Jul 2015 14:22
Understand recursion and pointers, and completely ace a data structures / algorithms class; having a decent grasp of combinatorics is very helpful, too. The coding challenges I give in interviews are almost always something like "here's a trivial game, write an algorithm to solve it optimally", which usually involves recursion, some sort of simple data structure, and combinations. Strong candidates solve these in about an hour (we allow 1.5 hours).
0 u/dchem 01 Aug 2015 23:50
Here are some that I got just in last year:
Make a relationship graph similar to LinkedIn. Write a code to get how close person B is to person A from that graph. (15 min to half hour) Follow up: What are some of the things you should worry about when traversing?
You have a large logs of different events. Given that it has a column of time, IP address, description, and event type, write a code that checks for three sequential events from a same IP address. (15 min to half hour) Follow up: How would you improve the logging system to allow for easier classification of "sequential events?"
Given a set of substitution cipher text, write a code to decrypt it in language of your choice. (Gives you an hour to do this with a laptop)
For an April Fools joke, you are to design and code a password login front-end that takes in a password that is case insensitive and lets users login for a case sensitive user password. Assume there is no API call limit for login. (One hour, white board)
Generally I noticed a lot of recent interview questions that I got is regarding graph and tree traversal. There are some recursion questions as well.