Anyone have thoughts on whether there's anything Racket can/should do
involving Leetcode?
If you're not familiar, Leetcode is a site with bunch of coding
interview problems that huge numbers of CS students and professionals
work through. For doing the problems on the site, there's several
popular programming languages to choose from (Racket and Scheme not
among them). https://leetcode.com/problemset/all/
I just did three of the most popular problems tonight, in Racket/Scheme,
offline. (Incidentally, in the official solutions writeups of all
three, I ended up finding what appears to be one outright incorrect
algorithm, and had nits to pick in each, over the discussion and
sometimes needlessly inefficient coding. And they strangely provide
little-to-no test cases in the official solution writeups I've seen so
far, when I'd say that figuring out good test cases should be a
fundamental part of every solution process.)
One thing I found with my code[1] is that it's probably not good for
*selling* people on Racket. If you don't know a Lisp, and you look at
this Racket/Scheme code as well as the Java or C++ official solution, I
suspect this code looks bulkier and less familiar. Though, for example,
one of their solutions, if you tried to really understand an
optimization they were doing, their coding style actually obscured that,
and the Scheme code could've done that same approach in a way that was
easier to step through exactly what's going on.[2]
Also, I suspect that going to a lot of trouble to publish better
solutions, and crits of the official ones, won't impress many. Although
I saw one of the official solutions go into excessively detailed big-O
analysis, and I suspect most everyone doing Leecode has Intro Algorithms
as an accomplishment they can rightly be proud of, I suspect that the
majority of people just want to survive the all-important whiteboard
hazings, and the self-image/aspiration after that is more "I get it
done". I suspect that Racket will already be assumed to be for
academics, so academic-ing Leetcode problems harder won't change that,
and these contrived whiteboard problems I've seen so far don't really
lend themselves to Racket's relative practical strengths.
I suppose one possibility might be to get Racket or Scheme considered an
official language for Leetcode. Simply having it appear on the menu on
leetcode.com is a boost of credibility. I doubt many employers will
want to see Racket/Scheme in any case right now (and schools I've seen
seem to be targeting a popular language, for internships and whiteboard
interviews), but students and professionals will see it. Maybe: not
being on that list says we're definitely not relevant; being on the list
says we might be. Plus a few "what's this new Racket/Scheme thing?" leads.
Other ideas for involving Racket and Leetcode?
[1] Style-wise, for this exercise, I did pure-functional (which was easy
and efficient for all of the 3 problems thus far), and in only R5RS plus
Racket hashes and my unit testing library, and favoring named-`let`.
FWIW, for the constant factor details, I also assumed a modestly good
compiler, I micro-optimized a bit more than I had to (e.g., avoiding
redundant branching in imagined target code), and I didn't assume
allocations/GC were free.
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/7c80122b-6157-f75e-3994-d5e5d0503f90%40neilvandyke.org.
For more options, visit https://groups.google.com/d/optout.