Open Side Menu Go to the Top

12-11-2013 , 11:18 PM
you gave no points for his first answer because he put quotes around the table name?


Last edited by tyler_cracker; 12-11-2013 at 11:18 PM. Reason: how certain are you, my dear dave, that this syntax is not accepted by some sql engine somewhere?
** 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 **
12-11-2013 , 11:20 PM
how to get into every class ever, by xhad (tyler_cracker, ed.):

Quote:
Originally Posted by Xhad
check the online signup tool every day (assuming there is one) and go to the first day of class even if you're not in by then. Keep showing up. Professors often have a few discretionary slots on this stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-11-2013 , 11:24 PM
Quote:
Originally Posted by tyler_cracker
you gave no points for his first answer because he put quotes around the table name?

Mentally, I gave him a 1/2 point for syntactic considerations (his familiarity is apparently MySQL), which is why I didn't end it right there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-11-2013 , 11:29 PM
perfect fizzbuzz screen
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-11-2013 , 11:52 PM
Quote:
Originally Posted by gaming_mouse
perfect fizzbuzz screen
agree with this, fwiw
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 01:09 AM
Quote:
Originally Posted by tyler_cracker
how to get into every class ever, by xhad (tyler_cracker, ed.):
Works for most of life as well.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 02:42 AM
Not getting the 3rd sql query question is pretty bad..
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 09:52 AM
Quote:
Originally Posted by jmakinmecrzy
my java final was 100 questions and just had a lot of tracing and "what's wrong with this code" type questions. I hate those because I always rely on the compiler when I'm actually doing programming to catch that sort of ****.
Well in "real world" assignments you will very often have to do this. Tracking down a defect that has been reported, code reviews, etc.


Quote:
tracing questions were easy, then she started using a lot of terminology I wasn't totally solid on because we never went into detail too much about pointers and memory allocation and stuff like that. Bunch of deep copy/shallow copy questions which were weird because we also never went over that stuff.
Unfortunatly some profs do this kind of thing. I do have empathy for you on this.

Quote:
Then I kept finding typos all over the place which changed the answer to the question, so I never really knew if she made a typo on purpose or by accident so I kept having to call her over to check.

TIL i much, much prefer a practical test than a multiple choice test for programming. **** multiple choice.
Well chalk it off as another learning experience. In the long run your results on this test won't matter too much in your career.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:07 AM
That's what I don't get about programming jobs. How can someone possibly list a resume like that and then not be able to answer those questions?

The guy probably made like $80,000+ last year too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:16 AM
I'd fail miserably at doing stuff if I wasn't provided with a search engine... but my memory for syntax is pretty bad.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:27 AM
Quote:
Originally Posted by Shoe Lace
That's what I don't get about programming jobs. How can someone possibly list a resume like that and then not be able to answer those questions?

The guy probably made like $80,000+ last year too.
See what Larry posted a few days ago about the person hired without having to write any SQL. If nobody is checking this stuff then of course people are going to lie about it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:28 AM
Quote:
Originally Posted by Nchabazam
I'd fail miserably at doing stuff if I wasn't provided with a search engine... but my memory for syntax is pretty bad.
This

A lot of interviews have that "exam type" questions. In theory that is ok but in practice it has problems. An obvious one is most developers develop code on a workstation not a whiteboard.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:31 AM
Quote:
Originally Posted by Nchabazam
I'd fail miserably at doing stuff if I wasn't provided with a search engine... but my memory for syntax is pretty bad.
When I interview people with a coding question I always say that I want as close to real syntax as possible but that I'm not concerned about little details like if they can't remember if a list method is called "size" or "length" and that I realize some things are harder when not using a real development environment.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:37 AM
Ya, I mean if question is some pseudo code "how would you roughly go about this" then that's fine. If it's "write some SQL query with perfect syntax off the top of your head" meh.

I also don't know much vanilla SQL, and for some reason am too lazy to learn it. If I ever need to write some custom query stackoverflow or this forum can help me quickly enough. I do know how to avoid massive N+1 chains even though I'm stuck in ORM land.

That being said, if anyone ever wants to trade some rails/angular tutoring for SQL skills, I'd be down

Or I'm pretty good at LHE, if you want to learn a dying game.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 10:56 AM
Quote:
Originally Posted by Nchabazam
Ya, I mean if question is some pseudo code "how would you roughly go about this" then that's fine. If it's "write some SQL query with perfect syntax off the top of your head" meh.
There's a pretty big spectrum between these two points.

I'm of the opinion that you should be able to write pretty close to real syntax for any language you claim to know well for any standard interview-type question (using basic control flow and data structures, no external libraries or anything). If you need to use Google to figure out how to do that, then I don't think you know that language. In Dave's example, I think the quotes aren't a big deal, but if I found anybody that said they knew SQL and couldn't answer those three questions quickly and with close syntax - they're not getting hired.

Even worse, if you need to do that for your supposedly strongest language (we always let the candidate pick their own language for the programming questions) then I'm not going to hire you because I don't think you're going to be very productive constantly googling stuff, and I don't think you have a very deep experience if you haven't got the basics ingrained.

Edit: Also, knowing ORMs isn't knowing SQL. So if all of your experience is with ORMs put those down as what you know and leave SQL off your resume.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 11:33 AM
Nchabazam,

Yeah I agree with that but in your case you probably would have explained your previous experience with the ORMs you use/used right?

I guess in the end it depends on what the job will consist of. I'd wouldn't mind someone with a lot of ORM experience / proven history but can't answer #2 working on a job that requires being able to create a nice data model from written documentation given to you by someone who spoke to a client.

There's also a ton of questions the guy could have asked the interviewer before answering to prove his knowledge even if he didn't know the syntax.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 11:41 AM
Ya, you're right. The reality is if I had to write something in ruby/rails for an interview question, I'd likely not screw up the syntax, or would make a small mistake that I could easily find once the compiler bricked or w/e.

And ya, I'd never claim to be an expert in SQL. I can do 99% of stuff I'd ever need to do with ActiveRecord (rails ORM).

Shoe: This is how I solved my problem. The scan line I was just about to ask at since I was failing at googling, but it splits at commas unless the comma is wrapped in a double quote. Create a bunch of new objects with identical attributes, delete the old values, then save.

I'm going to have to replace the FileType.to_csv with the generated strings because I'm going to run this migration on a server where that data won't exist, but this seems like an easy enough way to go about it.

Code:
a = FileType.to_csv
b = a.split(/\n/)
attributes = b.delete_at(0).split(',')
new_file_types = []
b.each do |value_row|
  values = value_row.scan( /([^",]+)|"([^"]+)"/ ).flatten.compact
  obj = FileType.new
  values.each_with_index do |val, index|
    obj[attributes[index]] = val
  end
  new_file_types << obj
end

FileType.delete_all

new_file_types.each(&:save)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 11:47 AM
Quote:
Originally Posted by jjshabado
There's a pretty big spectrum between these two points.

I'm of the opinion that you should be able to write pretty close to real syntax for any language you claim to know well for any standard interview-type question (using basic control flow and data structures, no external libraries or anything). If you need to use Google to figure out how to do that, then I don't think you know that language. In Dave's example, I think the quotes aren't a big deal, but if I found anybody that said they knew SQL and couldn't answer those three questions quickly and with close syntax - they're not getting hired.

Even worse, if you need to do that for your supposedly strongest language (we always let the candidate pick their own language for the programming questions) then I'm not going to hire you because I don't think you're going to be very productive constantly googling stuff, and I don't think you have a very deep experience if you haven't got the basics ingrained.

Edit: Also, knowing ORMs isn't knowing SQL. So if all of your experience is with ORMs put those down as what you know and leave SQL off your resume.
nails it
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:11 PM
IMO, and this is not so much based on direct evidence as much as the only possible logical solution, there are a ****load of people who work at companies were the expected pace of work is at least as slow as constantly googling everything. People get by being able to create a very good bookmarks bar with access to information vs actually knowing the information off the top of their head. When they eventually get fired, they just assume they can get a similar type slow paced job and eventually find one.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:17 PM
Nchabazam,

Looks good but I think you can do bulk inserts here to improve the speed by a lot.

When I converted my fake data builder to use bulk inserts it sped up the process by a huge amount. Instead of building a .new object and then .saving it later I just pass an array of hashes directly into .create and it does it in 1 query.

You could probably mess around with it and add in batch support so it only does like 2000 at a time, etc..

Here's an example of how I seed fake data to my development db using bulk inserts, it's wrapped into a rake task.

Code:
    desc "Clear and populate the categories table"
    task categories: :environment do
      Category.delete_all
      ActiveRecord::Base.connection.reset_pk_sequence!("categories")
      categories = []

      rand(3..7).times do
        category_name = Faker::Lorem.words(rand(1..3)).join(" ").capitalize
        category_description = Faker::Lorem.paragraph[0..149]

        categories.push({ name: category_name, description: category_description })
      end

      Category.create!([categories])

      puts "Populated categories table"
    end
Edit: I just realized I should probably be using the shovel operator to add the new categories in. I wrote this task shortly after starting with rails/ruby.

Last edited by Shoe Lace; 12-12-2013 at 12:22 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:24 PM
Those three questions are day one material and the syntax is nearly universal. Anyone who who SQL on a regular basis should know those without thinking. Not knowing these answers is akin to someone forgetting how to assign a variable and call a function in their favorite programming language.

I was totally cool with the guy. As I stated in the OP, he was working on a live database and real data set. He was using PgAdmin and I let him use Google. Yes, I showed him how to use the interface.

I think that anyone who knows SQL should at least know a few joins, sub selects, and aliasing. They should also know the basic data types and know about constraints. He didn't know any of this.

I think at the very least, an applicant should have heard of a trigger. I would go one step further and say they should have written a trigger at some point before putting SQL on a resume. I wouldn't judge a person harshly for not knowing how to wrote one in Postgresql.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:33 PM
dave, you are 100% right
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:34 PM
Quote:
Originally Posted by tyler_cracker
you gave no points for his first answer because he put quotes around the table name?
Quote:
Originally Posted by daveT
Mentally, I gave him a 1/2 point for syntactic considerations (his familiarity is apparently MySQL), which is why I didn't end it right there.
Quote:
Originally Posted by jjshabado
In Dave's example, I think the quotes aren't a big deal,
Quote:
Originally Posted by daveT
Those three questions are day one material and the syntax is nearly universal.
Double quotes are part of the SQL standard AFAIK.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:35 PM
Any node experts out there? I spent 4 hours last night trying to figure out why some properties I was creating on one request were getting tacked on to another request. Turns out it's because I was using underscore's clone method to create these little route-specific module objects I pass along through the request. _.clone only does a shallow copy – so all my child modules had references to (not copies of) a property in my base module that starts as an empty object.

Here's some simplified code representing what's going on:

Code:
var baseModule = {
  prop1: {},
  prop2: 'some string',
  prop3: true,
...
}

(later in app.get middleware)

function doSomething(req, res, next) {
  req.module = _.clone(baseModule)
  req.module.prop1.foo = req.query.someParam; // = "bar"
  console.log(req.module.prop1); // {foo:bar} as expected
...

(still later on a completely different request)

function doSomethingElse(req, res, next) {
  req.module = _.clone(baseModule)
  req.module.prop1.buh = req.query.someParam; // = "sner"
  console.log(req.module.prop1); // {foo:bar, buh:sner} NOT as expected
...
So that's some scary ****. I'm really worried now that somewhere along the line I'm going to point something inside a request to a reference, but 99.99% of the time it will work fine – only when certain conditions are met will one request pollute the other - with very weird behavior that is almost impossible to debug.

Anyone have any general or specific advice for keeping things "request–safe" in node?

Last edited by suzzer99; 12-12-2013 at 12:41 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2013 , 12:47 PM
Quote:
Originally Posted by daveT

I think at the very least, an applicant should have heard of a trigger. I would go one step further and say they should have written a trigger at some point before putting SQL on a resume. I wouldn't judge a person harshly for not knowing how to wrote one in Postgresql.
Triggers are a good example of something I think you have to be careful of.

Any complex language has many different features that are only used for specific use cases. Its quite possible that people that know these languages just may have never come across a time to use them - and not knowing anything about how to implement them doesn't mean they haven't done lots of other advanced things in the language.

On a specific note, I think triggers are almost always bad and so the extent of my knowledge about them is that I probably don't want to use them.
** 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