acbellini
Ever since I started working, even before joining the core team, I had continuous work, barely two weeks off between two projects as I was moving and I could use a break. For me it worked very well, I stopped worrying about the next client and if they would pay, I stopped waking up at 5 am and coming back home at 8pm for 7 hours of teaching and seven of commuting, I stopped taking crappy projects and started working with Silicon Valley startups, I got rid of onsite meetings and started traveling. I know you may think this is just company talk, but I wouldn't be working for Toptal if I didn't love the way it changed my life!
If you are a developer say in Croatia, where we have a large community, the average wage of your fellow citizens is around €750, or $860
If you make $30/hour and you work full time, your monthly wage is a little over $4.800, five or six times what your neighbour makes. You've got a lot of slack there. If you live in Zurich, with $4.800 you cannot even pay the bills or rental. I'm not even mentioning what it takes to live in the Bay Area.
So, a good part of it is just being competitive. Another side of it is that clients know the cost of living where you are, and they will not pay your average iOS developer living in Croatia the same as they would pay her if she lived in San Francisco.
The goal there is to maximise the chances of a developer being hired.
Disclaimer: I work as a Director of Engineering at Toptal and I've held a few hundreds of those live interviews myself.
There is a very well documented screening process, that requires surely a bit of your time to go through, just as any other application to any company you'd like to work with. In my career I've interviewed with several European and U.S. companies, and the more the company is cool, the more they will test you, Toptal does just the same. Three steps out of four of the process are live interviews. I took my testing in August 2013, it took less than a couple of weeks and in total I spent a couple of days' worth of my time. It's definitely been worth it.
The algorithms I got tested on were of the same difficulty of the ones detailed in many books that prepare you for coding interviews, the same ones you'd go through if you were applying for Facebook or Google or other similar companies, nothing out of the ordinary in the tech world.
You can ultimately set your rate as you like, but recruiters will give you advice so that you can be in line with the market: I have about 20 years of professional experience and I live in Italy, my rate takes both those factors in consideration, and I am more than happy about it. If you have very niche skills, and as such ask for a high rate, Toptal will allow it, but then it will be harder for you to get hired. But you're not doing the price war with unqualified developers that ask for $5/hour, that's not how it works! Simply, if you have several patents and say your rate is $100/hour, and you want to apply for a 1 week Wordpress theme gig, it will not work out, but that's just common sense.
After several months of working as a developer, I joined the recruiter team, and I can witness that Toptal developers are all qualified and smart: for as experienced as I may be, I am surely not the one with the most years. I have spoken with Toptalers that worked at Apple and then NEXT in the 80's, researchers that work at CERN, creators of famous frameworks, that's who you are competing with, especially if your rate is above the market average. It's your call in the end.
All in all the experience is very personal, very human, the projects are great and, as long as you work well, are reasonable with your rate and have skills that are in demand, you will hardly be without work.
Anyway, you just got right the point that I was trying to make, a trie is definitely not a general purpouse data structure, but for the specific case (limited number of elements, many common prefixes etc) it performs very well. As for the point of returning the original object, it suffices to store the original object in end-word nodes. I didn't do that in this code because it would have added unnecessary code, since the problem was really just membership and prefixes.
In the specific case, hashtable wouldn't have worked, since it's not sorted and it doesn't solve the original problem.