Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

learning java



I've considered learning Java in order to seek employment as a
programmer.  I have been programming in C and other languages for
years, though I have (almost) no professional experience that I can
put on a resume.  [As a sysadmin, most of my programming tasks have
been relatively small and very secondary to what I was doing.]  However
at the time I was looking, there were a lot of Java job postings that
seemed as though you had a fair shot of getting hired if you could
talk sensibly about writing code in Java...  So, I find this topic
interesting.  But I have a couple of questions about your questions:

On Thu, Apr 29, 2004 at 12:37:29PM -0400, Duane Morin wrote:
> * Can you tell me what constitutes a well-formed XML file?  (Since I got 
> so much arugment over the 'triviality' of this question I changed it to 
> drawing a bad XML file on paper and asking people to tell me why it is a 
> bad XML file)

Isn't XML seperate and distinct from Java?  What's one got to do with
the other?  Presumably the applications you're working with make a lot
of use of XML?  If so, would you consider hiring someone with no
experience working with XML?

> * Given a primitive such as an int or long, write some real code to count 
> the number of bits that are set.  This is one of my favorite questions, 
> because there are a variety of creative ways to go about it just from a 
> problem solving perspective, and you can also talk about different ways to 
> optimize it (for size/speed).  Sure, the problem as described is trivial, 

I agree that this problem is trival, but I find it a bit curious.  The
obvious (to me) way to do this is to use a bit mask, setting each of
the bits in succession, to test which bits are set, counting as you
go.  But this strikes me as mainly an academic problem... While I've
written many segments of code to test various bits, I've never
actually come across a need to count those that are set.  Is there a
practical use for this problem?

I'm also curious about what some of the other suggested solutions were...  

> * I have a list of several million strings, but I know that there are only 
> about 100k unique ones.  I want to make myself a frequency table that 
> tells me how often each string occurred.  Write me a data structure to do 
> it.  Everybody makes a hashmap, which is fine, but most people end up 
> creating several million Integer objects when it can be done by only 
> creating 100k.

Not knowing Java, I couldn't write the code to do it; but the obvious
solution seems to be to create a hash with the string as a key, and
the frequency would be the value.  I'm having trouble imagining an
approach which would produce 1M hash objects and provide a correct
answer...  What's the deal?

> * Crawl all the HREFs out of a given HTML file.

Here I would definitely apply the Google defense...  ;-)

> * How would you implement an LRU cache?

By looking it up in Tannenbaum?  ;-)  Or google...  This, like some of
the others, strikes me as a bit of a specialized application to ask in
an interview.  I'm not a professional programmer, but it strikes me
that those who write caching code often do so, and hence will be able
to answer this question easily; those who don't won't.  It strikes me
that one could potentially work as a programmer for years and years
without ever having an occasion to implement a caching algorithm...

I'm not trying to pick on you or start a flame war, but I'm curious
about your reasoning for asking this particular question.  LRU caches
seem particularly of interest to people writing database code or
operating system code, and not much else.  [I would argue that the
cache for a web browser is a kind of database, even if the web browser
is very different from a DBMS package.] 

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20040430/90862e86/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org