Two Plus Two Poker Forums Interview Test Questions Problems, Solutions, Links, Discussion
 Register FAQ Search Today's Posts Mark Forums Read TwoPlusTwo.com

 Notices

 10-01-2016, 01:26 PM #176 Prickly Pear enthusiast     Join Date: Aug 2016 Posts: 60 Re: Interview Test Questions Problems, Solutions, Links, Discussion I'm starting to think hackerrank is garbage. All the questions and answers seem to have been written by non english speakers. The "editorial" section which explains the solution is only available after you have found the solution and they're hardly coherent and often not the best answer. For example the solution to the bribe problem posted by the guy who wrote it was to use some weird bubble sort, Spoiler: Code: ```t = int(raw_input()) for _ in range(t): n = int(raw_input()) arr = map(int, raw_input().split()) org = range(n+1) pos = range(n+1) cnt = [0]*(n + 1) ans = 0 invalid = 0 for i in xrange(n - 1, -1, -1): if invalid: break oldp = pos[arr[i]] #Get position in original array newp = i + 1 while oldp != newp: ans = ans + 1 cnt[org[oldp + 1]] += 1 if cnt[org[oldp + 1]] > 2: invalid = 1 break org[oldp], org[oldp+1] = org[oldp+1], org[oldp] pos[org[oldp]] = oldp pos[org[oldp + 1]] = oldp+1 oldp = oldp + 1 if invalid: ans = "Too chaotic" print ans``` exercism.io seems far superior but the problems aren't hard enough (though maybe more realistic for most job interviews that aren't for google/amazon etc). Anyone use something other than hackerrank? Ideally like exercism where you can view everyones solutions so you don't have to google the problem and read some indian's programming blog to check if your approach was the best.
 10-01-2016, 01:49 PM #177 gaming_mouse Carpal \'Tunnel     Join Date: Oct 2004 Location: taking notes on u (see profile) Posts: 13,782 Re: Interview Test Questions Problems, Solutions, Links, Discussion I've probably done like 10 or so of the medium/hard ones on http://www.codewars.com/ and thought they were pretty good. I think project euler problems can be counted on to have the most vetting and have so many solutions that you will always see excellent ones that are shorter than yours. There are so many of these sites nowadays though... I haven't tried anywhere close to all of them.
 10-01-2016, 02:03 PM #178 Victor Carpal \'Tunnel     Join Date: Jul 2003 Posts: 60,098 Re: Interview Test Questions Problems, Solutions, Links, Discussion +1 to gaming mouse on codewars and projecteuler. ive done 27 eulers fwiw. interviewcake is pretty good but boy do they love linked lists.
 10-01-2016, 02:20 PM #179 RustyBrooks Carpal \'Tunnel     Join Date: Feb 2006 Location: Austin, TX Posts: 23,896 Re: Interview Test Questions Problems, Solutions, Links, Discussion I am getting this a lot on codewars: Code: `The server attempted to execute your code but there was an issue with the request. This should be a rare issue. Please try running your code again. If the issue persists, please contact us`
 10-01-2016, 02:22 PM #180 RustyBrooks Carpal \'Tunnel     Join Date: Feb 2006 Location: Austin, TX Posts: 23,896 Re: Interview Test Questions Problems, Solutions, Links, Discussion In fact it seems to do this every time I try to submit my code.
10-01-2016, 02:43 PM   #181
suzzer99
Carpal \'Tunnel

Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,687
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by gaming_mouse I've probably done like 10 or so of the medium/hard ones on http://www.codewars.com/ and thought they were pretty good. I think project euler problems can be counted on to have the most vetting and have so many solutions that you will always see excellent ones that are shorter than yours. There are so many of these sites nowadays though... I haven't tried anywhere close to all of them.
I used to work with Jake Hoffner, one of the founders. Very smart guy. Glad to see people using it!

10-01-2016, 02:46 PM   #182
suzzer99
Carpal \'Tunnel

Join Date: Nov 2005
Location: on top of the bell curve
Posts: 87,687
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by RustyBrooks I am getting this a lot on codewars: Code: `The server attempted to execute your code but there was an issue with the request. This should be a rare issue. Please try running your code again. If the issue persists, please contact us`
Quote:
 Originally Posted by RustyBrooks In fact it seems to do this every time I try to submit my code.
I sent this to Jake on FB.

 10-01-2016, 05:51 PM #183 OmgGlutten! Pooh-Bah   Join Date: Aug 2016 Posts: 4,189 Re: Interview Test Questions Problems, Solutions, Links, Discussion I go to hackerrank and i am totally lost, have no starting point. where do you go to actually learn how to do that stuff? like, i just want the text book that shows this is the question, this is the answer, this is how it is solved. this is what this does. I am learning ruby-on-rails/css/html5/jquery right now.
10-01-2016, 08:15 PM   #184
Prickly Pear
enthusiast

Join Date: Aug 2016
Posts: 60
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by OmgGlutten! I am learning ruby-on-rails/css/html5/jquery right now.
go to exercism.io and download the ruby problems. They come with unit tests that sort of guide you to the solution. You can also submit non working solutions and then look over everyone else's answers to learn what works.

hackerrank is a site for elite indian programmers competing over h1b visa positions at amazon. I wouln't bother with it until you're learning algorithms and data structures.

 10-02-2016, 03:07 AM #185 Barrin6 Carpal \'Tunnel     Join Date: Dec 2005 Location: beyond legal blindness Posts: 6,834 Re: Interview Test Questions Problems, Solutions, Links, Discussion Hmm never tried codewars. I have been doing codefights for a bit when I'm bored of leetcode. The codefights is still has a lot of bugs but I think it has great potential. You can do quick match fights against similar ranked people and you race to solve coding problems. I recommend giving it a try especially if you are trying to break the monotony.
 10-11-2016, 03:02 AM #186 Barrin6 Carpal \'Tunnel     Join Date: Dec 2005 Location: beyond legal blindness Posts: 6,834 Re: Interview Test Questions Problems, Solutions, Links, Discussion Got an invite for a hackerrank test from a high frequency trading firm. One of the questions was disguised as a subset-sum problem: Given an array of numbers.. find the minimal number of elements such that the sum of those elements is between L and H, where L<= H. So for example [4,1,3,5] L = 7 H = 10 return 2
 11-26-2016, 03:00 PM #187 Prickly Pear enthusiast     Join Date: Aug 2016 Posts: 60 Re: Interview Test Questions Problems, Solutions, Links, Discussion I came across an interesting problem. You are given a string of digits, '1145'. You need to find the number of possible string representations of this number given the following rules. 1 -> a 2 -> b 3 -> c .... 11 -> k ... 26 -> z so for the input, '1145' you can map the first 1 to 'a' or you can take '11' as a single number that maps to 'k'. ie 1145 -> aade, kde, ane so the output would be 3
 11-27-2016, 05:24 AM #188 Barrin6 Carpal \'Tunnel     Join Date: Dec 2005 Location: beyond legal blindness Posts: 6,834 Re: Interview Test Questions Problems, Solutions, Links, Discussion I think I did I have done that problem before. It's a DP problem and someone I know was asked this by facebook
 11-27-2016, 05:59 AM #189 Bantam222 veteran     Join Date: Aug 2006 Location: Seattle Posts: 2,373 Re: Interview Test Questions Problems, Solutions, Links, Discussion Haven't had time to read this thread yet but I will add: Buying the book cracking the coding interview had been by far the best ROI investment I have ever made in my life (both money invested and time invested) Source: I am a dev at Microsoft
11-27-2016, 07:44 AM   #190
Carpal \'Tunnel

Join Date: Sep 2002
Location: Russian Troll
Posts: 21,292
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by Bantam222 Haven't had time to read this thread yet but I will add: Buying the book cracking the coding interview had been by far the best ROI investment I have ever made in my life (both money invested and time invested) Source: I am a dev at Microsoft
Yes and practice putting the solutions on a white board.

 12-01-2016, 04:19 PM #191 daveT S.A.G.E. Master     Join Date: Jun 2005 Location: La La Land Posts: 22,805 Re: Interview Test Questions Problems, Solutions, Links, Discussion Had an interesting question that stumped be pretty hard. "What is one thing you think a Python developer should know." You can replace Python with whatever other language you want. It stumped me because I thought it was a little over judgmental. I've met all sort of programmers who don't know about some idea X that I'd figure they ought to know about, and that's okay, I suppose. I said write function, but I guess writing properly semantic, non C-like code would have been a better minimum bar.
 12-01-2016, 09:40 PM #192 RustyBrooks Carpal \'Tunnel     Join Date: Feb 2006 Location: Austin, TX Posts: 23,896 Re: Interview Test Questions Problems, Solutions, Links, Discussion I can't decide if I hate that question or not. I have a lot of trouble with the "one thing" part, it's kind of like "what's your favorite movie" which I can't not even come close to answering. I've seen thousands of movies and I love hundreds. I doubt I could even make a top 10 without changing my mind 20 times and still wouldn't be satisfied with it. Maybe an interesting counter question would be "what is a feature of python that developers should NOT use"
12-02-2016, 12:14 PM   #193
Carpal \'Tunnel

Join Date: Sep 2002
Location: Russian Troll
Posts: 21,292
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by daveT Had an interesting question that stumped be pretty hard. "What is one thing you think a Python developer should know." You can replace Python with whatever other language you want. It stumped me because I thought it was a little over judgmental. I've met all sort of programmers who don't know about some idea X that I'd figure they ought to know about, and that's okay, I suppose. I said write function, but I guess writing properly semantic, non C-like code would have been a better minimum bar.
Not a good question. First of all the lowest common denominator for anyone who refers to themselves as a Python developer is different than the lowest common denominator for a senior type developer. Second of all there is more than one thing. The question implies to me some sort of hierarchy stemming from one basic thing. It is a poor way to view competency in a language.

 12-02-2016, 05:15 PM #194 daveT S.A.G.E. Master     Join Date: Jun 2005 Location: La La Land Posts: 22,805 Re: Interview Test Questions Problems, Solutions, Links, Discussion That's what I was thinking about as well. The way a person used Python as a Django developer, a scientist, or a DevOps is going to be very different. I wouldn't expect a Django developer to be a master of I/O and Pandas, but I'd expect other kinds of programmers to be fluent in these things. I almost said run a python script from the command line, but then I figured there would be people who could reasonably program Python using some IDE who would never know how to do that either. I was also asked a similar question on SQL. I said you should know data integrity, since that is the precise reason for SQL to exist. All other knowledge is pretty worthless without that under control. I don't think they liked either of my answers.
12-02-2016, 06:56 PM   #195
Carpal \'Tunnel

Join Date: Sep 2002
Location: Russian Troll
Posts: 21,292
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by daveT That's what I was thinking about as well. The way a person used Python as a Django developer, a scientist, or a DevOps is going to be very different. I wouldn't expect a Django developer to be a master of I/O and Pandas, but I'd expect other kinds of programmers to be fluent in these things. I almost said run a python script from the command line, but then I figured there would be people who could reasonably program Python using some IDE who would never know how to do that either. I was also asked a similar question on SQL. I said you should know data integrity, since that is the precise reason for SQL to exist. All other knowledge is pretty worthless without that under control. I don't think they liked either of my answers.
I think this is a good post.

 12-02-2016, 08:32 PM #196 Sholar Carpal \'Tunnel     Join Date: Jul 2007 Posts: 6,349 Re: Interview Test Questions Problems, Solutions, Links, Discussion Yeah, I think the best answer is basically what you put in that post. In either case, it's probably best to first state what you're actually answering. E.g. to start with "well, an interesting language feature that people don't typically get exposed to when first learning it is generator functions". At least that way the interviewer knows how you interpreted that rather vague prompt.
 12-02-2016, 08:42 PM #197 RustyBrooks Carpal \'Tunnel     Join Date: Feb 2006 Location: Austin, TX Posts: 23,896 Re: Interview Test Questions Problems, Solutions, Links, Discussion I have to say I "learned" about generators early into python but I think it was a year minimum before I really understood them and then a year later I was still figuring out things I hadn't really understood about them. I'm not 100% confident I know everything about them.
 12-03-2016, 06:43 PM #198 daveT S.A.G.E. Master     Join Date: Jun 2005 Location: La La Land Posts: 22,805 Re: Interview Test Questions Problems, Solutions, Links, Discussion For sure. Anything form the Standard Lib is a good candidate as well. I could argue all day that I'd never want to work next to developer who doesn't know what hmac is, but I know that is a futile exercise, and I could reasonably talk to people who don't know what it is, and don't even need to know what it is. Generators is an interesting topic though. I've taken some tests where the requirement is use all generators. I can do them, but at some point, it feels over zealous, especially when those one-liners become 150 characters long. And also, as we once both found out, there is a difference between 2 and 3 with generators. I don't know v2 flavors at all.
12-03-2016, 06:50 PM   #199
RustyBrooks
Carpal \'Tunnel

Join Date: Feb 2006
Location: Austin, TX
Posts: 23,896
Re: Interview Test Questions Problems, Solutions, Links, Discussion

Quote:
 Originally Posted by daveT And also, as we once both found out, there is a difference between 2 and 3 with generators. I don't know v2 flavors at all.
And I don't know the 3 flavors at all either.

I actually think python slightly screwed up with generators, but I'm not sure. I've finally decided that when writing utility libraries, returning a generator could be considered hostile unless there's a really good reason for it, or the caller has a *really* clear way to know that's what they'll get.

 02-08-2017, 03:41 PM #200 PJo336 THRILLHOUSE!     Join Date: Mar 2007 Posts: 21,654 Re: Interview Test Questions Problems, Solutions, Links, Discussion Maybe this doesnt apply to the actual use of this thread, but I have done a project for a company and we are going to do an hour long review of it. Obviously Im sure there will be lots of "I did it this way because I was thinking about X" and "Why did you not do this Y?" but any pointers on preparation or perhaps "gotchas" anyone can think of? Any angles to kind of review before hand?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Links to Popular Forums     News, Views, and Gossip     Beginners Questions     Marketplace & Staking     Casino & Cardroom Poker     Internet Poker     NL Strategy Forums     Poker Goals & Challenges     Las Vegas Lifestyle     Sporting Events     Politics     Other Other Topics Two Plus Two     About the Forums     Two Plus Two Magazine Forum     The Two Plus Two Bonus Program     Two Plus Two Pokercast     The Best of Two Plus Two Marketplace & Staking     Commercial Marketplace     General Marketplace     Staking - Offering Stakes     Staking         Staking - Offering Stakes         Staking - Seeking Stakes         Staking - Selling Shares - Online         Staking - Selling Shares - Live         Staking Rails         Transaction Feedback & Disputes     Transaction Feedback & Disputes Coaching & Training     Coaching Advice     Cash Game Poker Coach Listings     Tournament/SNG Poker Coach Listings Poker News & Discussion     News, Views, and Gossip     Poker Goals & Challenges     Poker Beats, Brags, and Variance     That's What She Said!     Poker Legislation & PPA Discussion hosted by Rich Muny     Twitch - Watch and Discuss Live Online Poker     Televised Poker General Poker Strategy     Beginners Questions     Books and Publications     Poker Tells/Behavior, hosted by: Zachary Elwood     Poker Theory     Psychology No Limit Hold'em Strategy     Medium-High Stakes PL/NL     Micro-Small Stakes PL/NL     Medium-High Stakes Full Ring     Micro-Small Stakes Full Ring     Heads Up NL     Live Low-stakes NL Limit Texas Hold'em Strategy     Mid-High Stakes Limit     Micro-Small Stakes Limit Tournament Poker Strategy     STT Strategy     Heads Up SNG and Spin and Gos     Mid-High Stakes MTT     Small Stakes MTT     MTT Community     Tournament Events Other Poker Strategy     High Stakes PL Omaha     Small Stakes PL Omaha     Omaha/8     Stud     Draw and Other Poker Live Poker     Casino & Cardroom Poker         Venues & Communities         Regional Communities     Venues & Communities     Tournament Events         WPT.com     Home Poker     Cash Strategy     Tournament Strategy Internet Poker     Internet Poker         nj.partypoker.com         Global Poker         MPN – Microgaming Poker Network         Big Ugly Poker     Commercial Software     Software         Commercial Software         Free Software General Gambling     Backgammon Forum hosted by Bill Robertie.     Probability     Sports Betting     Other Gambling Games 2+2 Communities     Other Other Topics         OOTV         Game of Thrones     The Lounge: Discussion+Review     EDF     Las Vegas Lifestyle     BBV4Life         omg omg omg     House of Blogs Sports and Games     Sporting Events         Single-Team Season Threads         Fantasy Sports     Fantasy Sports, sponsored by Draftboard.com         Sporting Events     Wrestling     Golf     Chess and Other Board Games     Video Games         League of Legends         Hearthstone     Puzzles and Other Games Other Topics     Politics     History     Business, Finance, and Investing     Science, Math, and Philosophy     Religion, God, and Theology     Travel     Health and Fitness     Laughs or Links!     Computer Technical Help     Programming International Forums     Deutsch         BBV [German]     Français     Two Plus Two en Español

All times are GMT -4. The time now is 09:45 PM.

 Contact Us - Two Plus Two Publishing LLC - Privacy Statement - Top