Open Side Menu Go to the Top

01-31-2015 , 09:24 AM
Quote:
Originally Posted by suzzer99
But when I think about it - he drew out the N x N grid exactly as described. So I know he understood the problem, and was visualizing it. He just got completely lost trying to create an array within an array.
I don't write a ton of javascript and I don't offhand know for sure the syntax for instantiating such a thing.

I just looked it up and for n x n you have to create an array and then iterate over it creating new arrays to put in it? Seems a bit lol. I'd have done it like that eventually if being interviewed, but I would have been certain there was a simpler way to do it and that I was going to look like a moron.

In a lot of languages, for instance C#, you can create actual 2D arrays:

Quote:
int[,] arr = int[n,n];
So I'm not sure I'd call arrays of arrays "fundamentals". They're a data structure only useful in some languages.

I looked up your original posts about it and if you're talking about the guy who created two 1D arrays and was populating them, then yeah, lol at that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
01-31-2015 , 10:09 AM
Quote:
Originally Posted by ChrisV

So I'm not sure I'd call arrays of arrays "fundamentals". They're a data structure only useful in some languages.
How would you do it in other languages? It's super simple in javascript.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 10:25 AM
So I've just started job searching on sites like Monster, indeed, etc. Which companies ads should I avoid? There doesn't seem to be a "master list" of job recruitment agencies to avoid. The only way you know to avoid them is if you already have the name. The list of names I've come up with so far is short... a list of 2: CyberCoders and Robert Half. When I put in a job title of "web developer" on Monster, somewhere in the range of 50-75% of the job postings were by CyberCoders (what I assume to be fake job postings since they seem to be pretty famous for that).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 10:51 AM
Quote:
Originally Posted by Fubster
yes, i am providing the algorithms/analytical approach. i guess what this entire exchange has taught me is that i'm better off just hiring a contractor to do it, and i can take care of the details on my own.
Fair enough.

Quote:
not anymore they aren't but i get what you're saying. i actually built an event driven low latency trading platform (in c++! gasp) based on equity that ended up just sitting around collecting dust. to be fair, it wasn't nearly as complex as it sounds, it was basically just something that took in a datastream and then rifled off FIX orders based on user input before a news event. most of the work was already done for me by the stream and platform providers. honestly, my biggest hurdle in this whole thing is knowing where to start. i have such little experience working on big projects without some sort of hand-holding that i would 100% for sure **** it all up right from the beginning and have to start from scratch like five times before i got something that wasn't terrible.
Seems to me, FWIW, that you have a "big picture" idea and you want to refine it to the point where you can feel confident in proceeding with code development. If so, this is more in the realm of developing an architecture in my view. For instance you mentioned multi-threading in another post. How do you know you need that? Maybe multi-processing would be better? Could you possibly model algorithm's in Python and then implement them in C++? How will data flow through the system in an efficient manner? Maybe some off the shelf software could be used. I am just throwing out things to consider FWIW. Akin to architecting what the stream and platform providers did.

I don't think you are out to rip anyone off.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 11:11 AM
Quote:
Originally Posted by Craggoo
So I've just started job searching on sites like Monster, indeed, etc. Which companies ads should I avoid? There doesn't seem to be a "master list" of job recruitment agencies to avoid. The only way you know to avoid them is if you already have the name. The list of names I've come up with so far is short... a list of 2: CyberCoders and Robert Half. When I put in a job title of "web developer" on Monster, somewhere in the range of 50-75% of the job postings were by CyberCoders (what I assume to be fake job postings since they seem to be pretty famous for that).
if you are looking for contract work (it doesn't appear that you are) I would do some research on the agency you'd be working through. There are plenty of slime ball ones out there. Others may disagree but principals only is one way to know that you know you are dealing with the company directly. Of course LinkedIn would work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 11:20 AM
Quote:
Originally Posted by suzzer99
....

Ok now I'm back to wondering how this guy could possibly be a good programmer. Maybe he's just really good at learning libraries and getting useful stuff out of them w/o really understanding fundamentals. Is that possible that someone like that could be productive and respected by his peers as a decent programmer?
Stop wondering, competent people flub interviews even if the person is asked to code in a more natural programming environment than on a whiteboard. I have no data to to back this up but I would think that recommendations from developers you know to competent are much more reliable than how someone codes on a whiteboard in an interview in predicting success as an employee.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 11:43 AM
Quote:
Originally Posted by Craggoo
How would you do it in other languages? It's super simple in javascript.
See the C# example I posted. Arrays of arrays can be declared in C#, but they're useless since we have true 2D arrays.

Edit: Should read int[,] arr = new int [n,n]; before someone calls me out on that :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 12:03 PM
A different CyberCoders recruiter sends an email to our [email protected] email monthly.

Are you in the Northeast or is CyberCoders everywhere?

Avoid Robert Half. If you are in Boston area I can suggest the good ones.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:00 PM
Quote:
Originally Posted by Larry Legend
A different CyberCoders recruiter sends an email to our [email protected] email monthly.

Are you in the Northeast or is CyberCoders everywhere?

Avoid Robert Half. If you are in Boston area I can suggest the good ones.
At this point I really don't care what part of the country it is.

As far as I can tell, CyberCoders just mass spam ads for every and any city they know of.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:11 PM
Robert Half has been fine for me (in that they're just as terrible as every other recruiter). Got my last job for me and I wouldn't have got it without them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:14 PM
As far as JS and fizzbuzz I'd prefer to see something like:

Code:
function fizzBuzzResult (num) {
    var result = '';
    if (num % 3 === 0 ) {
        result = 'Fizz';
    }

    if (num % 5 === 0) {
        result += 'Buzz';
    }

    return result;
}

for (var i = 1; i <= 100; i++) {
    console.log(fizzBuzzResult(i));
}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:18 PM
Doesn't print the number for non-multiples of 3 or 5. You could change it to:

Code:
return result || num;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:25 PM
Quote:
Originally Posted by Craggoo
Combining them into a single expression only works if the two numbers are prime numbers.
I think as long as one of them is prime it works. It only fails when both numbers have a common factor – like 4 and 6. If you take out the common factors, then multiply what's left – the single expression works again.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:27 PM
lol forgot that nice work me
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:33 PM
Quote:
Originally Posted by ChrisV
I don't write a ton of javascript and I don't offhand know for sure the syntax for instantiating such a thing.

I just looked it up and for n x n you have to create an array and then iterate over it creating new arrays to put in it? Seems a bit lol. I'd have done it like that eventually if being interviewed, but I would have been certain there was a simpler way to do it and that I was going to look like a moron.

In a lot of languages, for instance C#, you can create actual 2D arrays:

So I'm not sure I'd call arrays of arrays "fundamentals". They're a data structure only useful in some languages.

I looked up your original posts about it and if you're talking about the guy who created two 1D arrays and was populating them, then yeah, lol at that.
Yeah that's the one. The people who work with him swear that guy's a really good programmer. How is that possible?

This was a very low-pressure interview. We're all very friendly. We desperately need good developers, so we had a strong incentive to hire him. It was in the second half hour, so presumably he should've calmed down and gotten less nervous by then.

I'm just honestly curious if it's possible that a good developer could've failed the task of creating a 2D array that badly. If so then I feel like you have to question everything about the current standard process for interviewing programmers. Maybe there's some kind of market inefficiency – where good developers are slipping through the cracks – that could be exploited here.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:39 PM
I realized I never wrote fizz-buzz in Lisp. Here's Clojure:

Code:
(defn make-fizz [x y s]
   (if (= (mod x y) 0)
      s))

(defn fizz-buzz [x]
   (doseq [i (range 1 (+ x 1))
      :let [f (apply str (make-fizz i 3 "fizz")
                                  (make-fizz i 5 "buzz"))]]
     (if (not (empty? f))
          (println f)
          (println i))))
      
(fizz-buzz 100)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 01:47 PM
Quote:
Originally Posted by suzzer99
I think as long as one of them is prime it works. It only fails when both numbers have a common factor – like 4 and 6. If you take out the common factors, then multiply what's left – the single expression works again.
It might be better just to define a isPrime function that returns true if the number inputted is prime. Use that to determine what to do in the first if statement.

If you're not a fan of if-if else-else you could just combine everything into one long ternary statement.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 04:21 PM
Quote:
Originally Posted by Grue
As far as JS and fizzbuzz I'd prefer to see something like:

Code:
function fizzBuzzResult (num) {
    var result = '';
    if (num % 3 === 0 ) {
        result = 'Fizz';
    }

    if (num % 5 === 0) {
        result += 'Buzz';
    }

    return result;
}

for (var i = 1; i <= 100; i++) {
    console.log(fizzBuzzResult(i));
}
Agree with this (except for the error that was pointed out), the divide by 15 thing tilts the **** out of me. Should put it in the "things that shouldn't piss you off, but do" thread. I'm getting really heated right now.

Ruby:

Code:
i = 1
while i < 100
  string = ""
  string << "Fizz" if i % 3 == 0
  string << "Buzz" if i % 5 == 0
  string << i.to_s if string == ""
  puts string
  i += 1
end
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 04:38 PM
Quote:
Originally Posted by Baltimore Jones
the divide by 15 thing tilts the **** out of me.
ew and then you go and use a while loop in ruby instead of iterating over a range?

philistine.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 04:40 PM
A while loop in this case is a bit un ruby.

1.upto(100) do i
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 04:43 PM
Anyone have recommendations for good intro videos for Strala and/or functional programming? We're using it more at work and I'd like to be less dumb about it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 05:02 PM
My first programming interview ever had fizzbuzz, I pretty much wrote Suzzers first approach and expected to get shredded for it not being "pretty" enough, but he went on to tell me most people cant even get a correctly functioning one written, so style wasnt as important.

He also added on to it after you write it by telling you each if condition takes 2 seconds, so optimize it, which is a decent enough addition to a stupid problem. I passed with flying colors apparently and immediately got the job, so yay other people being not so great at programming? I still dont really get how a "programmer" cant throw together anything operational for it, weve already seen quite a few in the last few posts alone. But he shows me every fail, so I guess it is true.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 05:11 PM
javascript

for(var i = 1; i < 101; i++)
{
var ans = (i % 15 == 0) ? "fizzbuzz" : ((i % 3 == 0) ? "fizz" : ((i % 5 == 0) ? "buzz" : (i)));
alert(ans);
}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 05:21 PM
Nested ternaries are so fun to stumble across when trying to parse and debug someone else's code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-31-2015 , 05:22 PM
Quote:
Originally Posted by suzzer99
Yeah that's the one. The people who work with him swear that guy's a really good programmer. How is that possible?

This was a very low-pressure interview. We're all very friendly. We desperately need good developers, so we had a strong incentive to hire him. It was in the second half hour, so presumably he should've calmed down and gotten less nervous by then.

I'm just honestly curious if it's possible that a good developer could've failed the task of creating a 2D array that badly. If so then I feel like you have to question everything about the current standard process for interviewing programmers. Maybe there's some kind of market inefficiency – where good developers are slipping through the cracks – that could be exploited here.
As the resident complete software noob who doesn't appreciate or know the differences between all the various languages, is c++ just super simple to do multi-dimension arrays or something? I can't even comprehend not being able to do such a thing with even a tiny amount of info, so I just assume there must be a language difference I don't understand.

Or I'm not getting what it is suzzer wants.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m