Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

04-18-2017 , 11:35 AM
You can practice on https://leetcode.com/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-18-2017 , 05:20 PM
leetcode has a bunch of dynamic programming problems listed as medium difficulty

Am I the only one who finds those problems extremely difficult? I have a hard time understanding the solutions once they're presented to me let alone solving them on my own.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-18-2017 , 05:29 PM
I did everything on interview cake on a white board. He gives hints and explanations, works pretty well. You can get most for free off the Facebook page posts
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-18-2017 , 09:31 PM
Quote:
Originally Posted by kerowo
Find a friend or professor who will interview you to get used to answering questions about yourself and your experience. There must be a list of common white board questions on the internets that you can practice with.
Quote:
Originally Posted by jjshabado
Actually do the practice white board questions on a piece of paper or whiteboard though. If you're going to have to do it in the interview, it's good to practice and get use to the awkwardness.
Quote:
Originally Posted by kerowo
Yeah, if you don't have experience talking out ideas to people now would be a good time to practice that too.
I think these are great ideas. I think most people struggle with the issue of white boarding and being on the spot.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 10:13 AM
I hate name and shaming, but _ _ _ _ _ was easily the most low-ball I ever heard about from a recruiter contact.

- Relo to San Jose w/ no assistance.

- Do DBA work for multiple db instances. The list is very long for this stuff, and add in some Linux admin stuff. I'm guessing they have genuine big data, so very real problems here.

- ETL, etc.

- Write stored procedures, secure back-end code for programmers to connect to, etc.

- Swap 24 hr on-call shifts every few weeks.

- 3 to 6 month contract.

I know the numbers that are tossed around here for far less. I will only say that you should divide your number by 4 and you are still over-shooting.

It didn't matter since I wasn't able to do all of that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 10:31 AM
Quote:
Originally Posted by whb
So just for ****s and giggles after listening to you fine gentlemen I am halfway through this 10 week program. I can say that my level of learning due to immersion and direct guidance is exponentially more than what it would have been doing the slow self study route. None of this comes from other students though. I am still honestly very thoroughly shocked as to what exactly is going on through their mind when they signed up for the course. I am also still very much wondering how the school comes in and makes an effort to maintain a certain benchmark performance from each student when at times the teaching staff is essentially handing over answers to certain students. Of the few gems from my cohort:

1. man introduces himself "hey guys I am a web developer for five+ years looking to better understand newer technologies." Great! I think this guy will be a source of knowledge only to find out he has a hard time starting up the terminal (even at 5 weeks in), inspecting HTML and JS files, and other random things which 5 years in makes you wonder what exactly were you working/selling to clients.
2. A self proclaimed "nerd" who after 5 weeks in still has to ask what pwd does (after being told daily what the command does). This man is always stalling with the prior week's homework questions, perpetually interrupting class and making snarky remarks like he knew the answer to his question after he is given an answer.

I have more horrid examples of people paying over $10k for this service yet appear to not give a flying f*** as to them putting any effort into it. There's maybe one woman honestly trying and constantly coding and trying to put her best foot forward to better understand this. That and wtf is agile for if your "blockers" are a combination of ("too tired to do homework", "this is all going to fast", "I went out with friends last night so I'm behind"). At the end of the week the school is actively trying to better itself and get feedback and I always feel terrible about pointing out the obvious pain points. During the agile "retrospection" sessions I clearly point out that one purposely lazy student shouldn't stall the class at the sacrifice the other student's time. I really wonder how it is that they will be able to give their stamp of approval to over half the class considering many still have a hard time doing a simple loop.

Btw, I'm no boy genius and I barely touched a computer in the last 10 years of my life but damn it's simply amazing what anyone is able to accomplish if you just try just a little bit.
Thanks for this insider summary - I've long suspected a lot of boot camps or DeVry-type courses were like this. Keeping that $10k/student revenue stream going >>>>> everything else.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 10:51 AM
The one I'm at apparently has a 15% acceptance rate (which I'm not sure I believe, but its been repeated by people in my class so i guess?), and I had absolutely no idea how one person was in it. This person just had absolutely no chance. Fortunately for them and the class they dropped out last week. We lost 2 out of 20 people, the other one was solid tho and definitely average, I think the person just freaked out at how difficult some stuff was and how independent you are expected to be.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 10:59 AM
When they drop out are they still on the hook for full tuition?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 11:03 AM
That's the scam at DeVry, I avoided it by being an overachiever!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 11:23 AM
Just the % of the course they completed. So last week was 1/4 of the way through the 15k.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 12:58 PM
A quick SQL question - specifically mysql maybe.

I have a huge table, and I want to generate counts of things that match a query, grouped by subtype. Like, say
select type, count(*) from mytable where (query)

This is WAY slower than it should be, partly because query contains a lot of things that can not be indexed. But really what I want to know is "are there results for each type", i.e. I am not concerned with the real number. I want to know if it's, like, less than 10 or more than 10.

Is there a way to do this? If it was just one count I wanted I'd do
select count(*) from table where (query) limit 11
and this would usually be super fast

I guess what I kind of want is a limit on each count. Preferably without having to break it out into N queries (one for each type).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 02:01 PM
I think you can do something like

Code:
SELECT type, "dummy" FROM mytable WHERE ... GROUP BY type;
You'll get one row for each type that exists. How fast it's going to be is going to depend on your where clause I think, but with no where clause it will be fast as long as there is an index on type.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 02:22 PM
Quote:
Originally Posted by well named
I think you can do something like

Code:
SELECT type, "dummy" FROM mytable WHERE ... GROUP BY type;
You'll get one row for each type that exists. How fast it's going to be is going to depend on your where clause I think, but with no where clause it will be fast as long as there is an index on type.
I was about to say the same thing

Code:
SELECT type, COUNT(id) FROM mytable WHERE ... GROUP BY type;
seems like what you're looking for
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 03:43 PM
Quote:
Originally Posted by well named
I think you can do something like

Code:
SELECT type, "dummy" FROM mytable WHERE ... GROUP BY type;
You'll get one row for each type that exists. How fast it's going to be is going to depend on your where clause I think, but with no where clause it will be fast as long as there is an index on type.
That will just tell me if there's 0 or 1. I want to know the count of them, up to some arbitrary number N. So, like, 0, 1, 2 ... 10 or more than 10.

I left the group by out of my query, sorry, but yeah, doing a group by on the table is not an option. It's way too large for me to do a full table scan, which is what that would require.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 04:02 PM
Quote:
Originally Posted by RustyBrooks
A quick SQL question - specifically mysql maybe.

I have a huge table, and I want to generate counts of things that match a query, grouped by subtype. Like, say
select type, count(*) from mytable where (query)

This is WAY slower than it should be, partly because query contains a lot of things that can not be indexed. But really what I want to know is "are there results for each type", i.e. I am not concerned with the real number. I want to know if it's, like, less than 10 or more than 10.

Is there a way to do this? If it was just one count I wanted I'd do
select count(*) from table where (query) limit 11
and this would usually be super fast

I guess what I kind of want is a limit on each count. Preferably without having to break it out into N queries (one for each type).
Oh my... why?

Without seeing the query, you may want to consider using a pattern like this (assuming you can't do what was already suggested):

Code:
select col1 ,count(col) cnt
from my_table t1
where exists
    (select *
     from other_table t2
     where t1.col2 = t2.col2)
group by col1
having cnt >= 10; -- you want to know ten, right?
As far as I know, using where exists is universally faster, so should work with MySQL.

But my intuition tells me that you may be best off using pure joins all the way through, like so:

Code:
select col, count(col) cnt
from my_table
join (other_table)
using (col)
join (next_table)
using (col)
etc...
group by col
having cnt >= 10;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 04:03 PM
Quote:
Originally Posted by RustyBrooks
That will just tell me if there's 0 or 1. I want to know the count of them, up to some arbitrary number N. So, like, 0, 1, 2 ... 10 or more than 10.
I see. I misunderstood what you meant here...

Quote:
Originally Posted by RustyBrooks
But really what I want to know is "are there results for each type", i.e. I am not concerned with the real number...
Dave's second example seems like it may be closer to what you want.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 04:24 PM
Let's say for the time being that there aren't other tables. And I feel like maybe I've expressed myself badly. I want to know the count for each type, up to N, as fast as possible. So let's say I have 3 Xs, 29 Ys and 152 Zs. I want
X | 3
Y | 11
Z | 11
(the 11s are because I want to know "more than 10")

Anything that requires me to do a group by on the full table is really kind of a non-starter. There could be 10s of millions of results.

Like the fastest way that I know of, I think, would be to do
(select 'X', count(*) from mytable where type='X' and (query) limit 11)
union
(select 'Y', count(*) from mytable where type='Y' and (query) limit 11)
union
(select 'Z', count(*) from mytable where type='Z' and (query) limit 11)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 04:27 PM
I guess I was hoping there was some semantic like
"select type, count(* up to 11) ... group by type"
where it would stop counting once it hit a threshold.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 04:56 PM
The problem with unions, especially as you don't have CTE's in MySQL, is that you will end up scanning the table 3x for each query. You can circumvent this issue by initializing into a temp table that is far smaller, but something like this should also do the trick, using stop-gap in each subquery:

Code:
select col, count(*)
from tbl t1
where exists
    (select col1
     from tbl t2
     where col = 'a'
     and t1.col = t2.col
     limit 11)
and where exists
    (copy / paste subselect for 'b')
and where exists
    (copy / paste subselect for 'c')
group by col;
-- you don't need the having clause because you already defined it in the subqueries
Probably have to mess around with this a bit to get it really up to speed. You may have to change "and" to "or" if a value does not exist.

Last edited by daveT; 04-19-2017 at 05:02 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 06:43 PM
Couldn't you do something like
select type from table where count(type) > 10;

But you wanted all types, can you short circuit SQL and an OR count(type) <= 10?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 07:54 PM
ugh. I need to IP ban someone from my ubuntu webserver but through nginx reverse proxy to my node/express/passport all IPs are coming as 127.0.0.1, any ideas? Also need to figure out how a passport user is associated to an IP... I'm bad at this.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 08:02 PM
You should be able to add that to the log message in nginx.config, it's been over a year since I did any nginx'ing but I'm pretty sure we were able to get source ip into the log.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 08:18 PM
In your nginx config file add:

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;

then on your box you should see these. node will automagically use this over the proxy ip address if its there.

or you can just block him right on your proxy server:
make sure ngx_http_access_module is installed

then just add

deny {ip address};

to your config file
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-19-2017 , 08:54 PM
For some reason 2p2 loads lighting fast in Argentina, but FB takes forever. You'd think it would be the other way around.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-20-2017 , 04:36 AM
Quote:
Originally Posted by CyberShark93
So, long story short, I've managed to get a final round face to face interview with Cisco for a graduate role, I recognise that opportunities like this are very hard to come by, so I'd really like to do well, they told me that they will be testing me on 'white board stuff', so whats the best way to prepare for these sort of thing in a week? and any advice at all? (this is my first face to face job interview)
So, some follow up, they sent me the schedule, basically I need to be there from 10:00 to 3:30? Which means 5 and a half hours?? How can an interview ever last that long? Has anyone had a marathon interview like this before?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m