Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38834

Re: Interview question - better solution for MergePurgeAndReverseOrder()

X-Received by 2002:ac8:1bce:: with SMTP id m14mr4454014qtk.53.1553890824001; Fri, 29 Mar 2019 13:20:24 -0700 (PDT)
X-Received by 2002:a25:bd04:: with SMTP id f4mr35380909ybk.153.1553890823696; Fri, 29 Mar 2019 13:20:23 -0700 (PDT)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!t9no2024538qtn.0!news-out.google.com!i54ni1381qte.0!nntp.google.com!t9no2024524qtn.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Fri, 29 Mar 2019 13:20:23 -0700 (PDT)
In-Reply-To <q7lbvc$152e$1@gioia.aioe.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=50.78.95.177; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host 50.78.95.177
References <q7lbvc$152e$1@gioia.aioe.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <9089289e-c140-4a3c-9480-b2ada51ffa22@googlegroups.com> (permalink)
Subject Re: Interview question - better solution for MergePurgeAndReverseOrder()
From Eric Douglas <e.d.programmer@gmail.com>
Injection-Date Fri, 29 Mar 2019 20:20:23 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 37
Xref csiph.com comp.lang.java.programmer:38834

Show key headers only | View raw


On Friday, March 29, 2019 at 11:01:13 AM UTC-4, Graeme Geldenhuys wrote:
> Hi,
> 
> I recently attended a Java developer interview and had to implement the
> MergePurgeAndReverseSort() method. I managed to complete it and
> afterwards wrote some unit tests to confirm that it works. But is there
> a better way to implement it, or did I do an okay job about it.
> 
> I can post the unit tests too if that might help.
> 
> Any feedback would be very much appreciated.
> 
> Regards,
>   Graeme
> 
> 
Define better.  Are you concerned with appearance or performance?
I'd be thrilled to find a candidate who can write normalized readable code that produces correct output.
Consider redundancy and re-usability.  Could the method you're writing be used elsewhere?  Are you writing the same code in 2 places, where both will need to be updated if it ever changes?

Whether performance matters depends on your volume of data.  Shaving off nanoseconds might matter when you're executing it a billion times, though hardware has also gotten cheaper.  The problems we had getting reports to finish in an 8 hour nightly window 20 years ago shouldn't be an issue today.  These days it seems to be more about the user experience and impatience, can they wait 1 second instead of 5.

I'd envy the company that can afford to find the programmer that can write perfect code from the start.  Most should be happy if you know the basics and can learn and adapt quickly.  I wonder how closely your test relates to the code you'd actually be working on.  At my job we tend to hire kids fresh out of college, I just give them a fizzbuzz test.  Actual coding involves "what is this data?" ie it's a corporation which owns multiple companies, you're processing gift certificate redemptions, can you match them to the issuance?

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Interview question - better solution for MergePurgeAndReverseOrder() Graeme Geldenhuys <graemeg@example.net> - 2019-03-29 15:01 +0000
  Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-03-29 11:19 -0400
    Re: Interview question - better solution for MergePurgeAndReverseOrder() Graeme Geldenhuys <graemeg@example.net> - 2019-03-29 16:42 +0000
      Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-03-29 13:47 -0400
        Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-03-29 13:53 -0400
        Re: Interview question - better solution for MergePurgeAndReverseOrder() Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-03-29 19:42 +0100
  Re: Interview question - better solution for MergePurgeAndReverseOrder() Graeme Geldenhuys <graemeg@example.net> - 2019-03-29 16:53 +0000
    Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Douglas <e.d.programmer@gmail.com> - 2019-03-29 10:19 -0700
    Re: Interview question - better solution for MergePurgeAndReverseOrder() Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2019-03-30 11:23 +0200
      Re: Interview question - better solution for MergePurgeAndReverseOrder() Graeme Geldenhuys <graemeg@example.net> - 2019-03-30 11:16 +0000
  Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Douglas <e.d.programmer@gmail.com> - 2019-03-29 13:20 -0700
    Re: Interview question - better solution for MergePurgeAndReverseOrder() Graeme Geldenhuys <graemeg@example.net> - 2019-03-30 11:21 +0000
      Re: Interview question - better solution for MergePurgeAndReverseOrder() Eric Douglas <e.d.programmer@gmail.com> - 2019-04-01 04:56 -0700
  Re: Interview question - better solution for MergePurgeAndReverseOrder() bursejan@gmail.com - 2019-03-29 15:40 -0700

csiph-web