Month: July 2017

Beautiful JavaScript Contest Winners

Beautiful JavaScript Contest Winners

The Beautiful JavaScript contest was an amazing event. We got over 500 solutions from our awesome CodeFighter community! It ended up being really hard to narrow our list of favorites down to just three. But after a lot of thought, our judges have chosen the three that they think are the most expressive, readable, and concise – in other words, the most beautiful – as our winners.

The winners

Congratulations to the winners of the Beautiful JavaScript contest! Each of these CodeFighters has won a three-day trip to San Francisco, and will get to come nerd out with us about JavaScript at CodeFights HQ.

See the winner’s solutions section of this post for their full solutions to the challenge secretArchivesLock! We’re going to be posting an in-depth explanation of each winner’s solution, in the winner’s own words, so stay tuned for that in the next few weeks.

Honorable mentions

We also want to acknowledge the following CodeFighters with an honorable mention and a CodeFights gift box!

  • ben_s24: This CodeFighter’s solution was a crowd favorite – commenters on the challenge really liked his solution!
  • hydralisk: Not only did this CodeFighter have a great solution to the challenge, he also reviewed all of the solutions to compile his own list of favorites.
  • jeff_b36: This CodeFighter created an awesome website to help visualize the challenge.

The winner’s solutions

And now the moment you’ve all been waiting for – the winner’s solutions!

arnav_a2’s solution

arnav_a2's Beautiful Javascript Solution

boomx’s solution

boomx's Beautiful JavaScript Solution

marcusekeenan’s solution

marcusekeenan's Beautiful JavaScript Solution

Congratulations to our winners! And everyone who submitted a solution, great work! We really enjoyed reading through all of the creative solutions that you all came up with.

Tell us…

Did you have a favorite solution that didn’t end up being a winner or an honorable mention? Let us know over on the CodeFights Forum!

Introducing the CodeFights Arcade Database World

Introducing the CodeFights Arcade Database World

The ability to access, understand, and manipulate data is extremely important in the current engineering job market. Employers are increasingly listing SQL as a “required skill” in job listings, whether the job is a back-end engineering job or not.

Data scientists, data analysts, researchers, and many others also need to be able to access information that’s stored in relational databases. No matter what your job title is, the ability to dive deep into an organized collection of data to answer questions, uncover patterns, and discover information is incredibly useful!

But unless you already work with a relational database, whether at a job or at school, how do you practice writing efficient and accurate queries?

Database World

At CodeFights, we wanted to give people a fun, easy way to practice writing queries and manipulating data. That’s why we created Database World, our latest addition to the CodeFights Arcade!

Database World has over 80+ tasks spread out over 16 levels. The questions start out easy… But they ramp up in difficulty as you progress. This means you’ll never get bored as you practice!

Database World is a unique way of learning database skills that’s both educational and entertaining. While you write more and more queries, you’ll start to know what to look for and how to pinpoint the information you need. You’ll get faster and have less hesitation. In other words, writing amazing SQL queries will become second nature for you. You’re going to be able to leverage this into being highly competitive in the job market!

Back up – what’s the Arcade?

There are five different worlds in the CodeFights Arcade. Each world has tons of levels and tasks to complete that help you master a particular concept.

  • Start tackling tasks and get familiar with Arcade in the The Intro.
  • Get up to speed on programming fundamentals in The Core.
  • Python World focuses on helping you master programming in Python.
  • Solve graph theory questions in Graphs World.
  • And now, practice your SQL and database skills with Database World!

Get started!

Are you ready to become a database guru? If so, get started on Database World with projectList, the first task in the introductory level!

 

Interview Practice: Graphs, Advanced Trees & RegEx

Interview Practice: Graphs, Advanced Trees & RegEx

We’ve just added three-brand new computer science topics to Interview Practice! Get ready to dive deep on Graphs, Trees: Advanced, and RegEx. We’ve added these topics to our Extra Credit learning plan, which covers all of the topics in Interview Practice. 

Why are these topics so important to know for technical interviews? Read on for a brief introduction to each concept!

Graphs

Graphs Interview Practice TopicA graph is an abstract data structure composed of nodes and the edges between nodes. Graphs are a useful way of demonstrating the relationship between different objects. For instance, did you know that you can represent social networks as graphs? Or that the 6 Degrees of Kevin Bacon game can be modeled as a graph problem? Graph questions are really common in technical interviews. In some cases, the question will be explicitly about graphs, but in other cases the connection is more subtle. Read our tutorial to get up to speed on this topic and to learn how to identify this kind of question. Then practice your skills on graph questions from real technical interviews!

Trees: Advanced

Trees: Advanced Interview Practice TopicA tree is a data structure composed of parent and child nodes. Each node contains a value and a list of references to its child nodes. Tree traversal and tree implementation problems come up a lot in technical interviews. Common use-cases for an interview are: needing to store and do searches on data that is sorted in some way; needing to manage objects that are grouped by an attribute (think computer file systems); or implementing a search strategy like backtracking. You need to be very familiar with how to deal with these kinds of questions! (The tasks in Trees: Advanced ramp up in difficulty from the ones you get in the Trees: Basic category, so make sure you finish those questions before moving on to these ones!)

RegEx

RegEx Interview Practice TopicA regex is a string that encodes a pattern to be searched for (and perhaps replaced). They let you find patterns of text, validate data inputs, and do text replacement operations. A well-written regex can make it easier to solve really tricky interview questions like “Find all of the 10-digit phone numbers in a block of text, where the area code might or might not be surrounded by parentheses and there might or might not be either a space or a dash between the first and second number groupings”. While the specifics of how to implement a regex can vary between languages, the basics are pretty much the same. In the topic tutorial, we cover regex character classes, quantifiers, anchors, and modifiers and how to use them to write a good regex.    

Start now

These topics might not get asked in every interview, but they’re important to know! Read the tutorials about each concept, then solve the real interview tasks to practice your skills and solidify your understanding of the topic. (Learn more about how we’ve updated the Interview Practice experience to make it an even better practice and preparation tool.)

If you’re signed up for the Extra Credit learning plan, these topics have been added to your Interview Practice page already. If you’re signed up for a different learning plan, you can switch over to Extra Credit. Or you can sign up for a customizable Freestyle plan and add these topics!

New supported languages: C, Erlang, Rust, and more!

New supported languages: C, Erlang, Rust, and more!

You asked, and we listened! Over the past few weeks, we’ve added support for 14 more programming languages to the CodeFights platform.

The new languages on CodeFights are:

  • C
  • Clojure
  • CoffeeScript
  • Common Lisp
  • D
  • Elixir
  • Erlang
  • Julia
  • Kotlin
  • Lua
  • Nim
  • Objective-C
  • OCaml
  • Rust

With these additions, we now support 32 coding languages that you can use to solve CodeFights tasks! Being able to select your language of choice means that you can master your primary coding language, practice a language that you’re in the process of learning, or just try one on for size.

See the postscript to this blog post for the entire list of languages that you can use on the platform. Keep in mind that you can’t use some languages to solve some tasks, so if that’s the case you may need to choose a backup language. (For instance, you can’t use Lua to solve a database task, so you’ll need to switch to MySQL.)

We hope that you’ve found a few languages that you’re excited about using! If your preferred language isn’t on our list, you can start a post on the CodeFights Forum to request it. We try to add new supported languages a few times a year based on user requests and language popularity.

Programming Languages Supported on CodeFights

CodeFights Supported Languages

The languages that our platform currently supports are:

Bash, Clojure, CoffeeScript, Common Lisp, C, C++, C#, D, Elixir, Erlang, F#, Go, Haskell, Java, JavaScript (ES6), Julia, Kotlin, Lua, MySQL, Nim, Objective-C, OCaml, Perl, PHP, Python2, Python3, R, Ruby, Rust, Scala, Swift3, and Visual Basic.

Intro to Hash Tables

Intro to Hash Tables

Hash tables are a must-know data structure for technical interviews. They’re used to store unordered collections of (key, value)pairs, in which the key must be unique. Item lookup by key, inserting a new item, or deleting an item are all fast operations – approximately O(1). Because they give you quick and cheap insertion, deletion, and lookups, you’ll be able to use them to solve many different types of interview questions.

When should you use a hash table?

Some common interview questions in which you should probably use a hash table are:

  • When there’s a unique, non-arbitrary identifier that you can use as a key for lookup. (Example: A caller ID function that uses a person’s phone number to retrieve their information.)
  • You need to quickly determine whether an element belongs to a collection. In these cases, you can represent the collection as a hash table with the elements as keys. (Example: A Scrabble checker that determines if a word is valid or not.)
  • You’re solving a problem about invariants. (Example: Checking whether a word has an anagram.)

To get a good basic introduction (or reintroduction) to hash tables and how you can use them, watch our Intro to Hash Tables tutorial video!

(For even more information about hash tables, check out the Hash Tables section in any of our Interview Practice learning plans.)

Practice makes perfect!

When you feel ready to practice on some real interview questions about this data structure, head to Interview Practice on CodeFights. Sign up for one of our technical interview learning plans. (No matter which one you choose, you’ll have access to the hash tables section.) You’ll learn more about them in our hash tables topic overview, and you’ll solve real interview questions about them. All that practice will get you good at recognizing when to use them and how to implement them during technical interviews!

Join the Beautiful JavaScript Challenge!

Join the Beautiful JavaScript Challenge!

Check out the Beautiful JavaScript challenge on CodeFights! You must submit your solution by noon on July 26. See the Official Rules at the end of this post for more details.

At CodeFights, we heart JavaScript. A lot. In fact, we love it so much that our whole stack, front-end and back-end, is JavaScript. Node + React + Meteor FTW!

We know we’re not the only ones who feel this way, and we want to share the JavaScript love. That’s why we’re launching our first-ever Beautiful JavaScript challenge today!

Think of this challenge as a beauty pageant for code. Write your solution in the most elegant JavaScript you can, polish it up, then click Submit. Our panel of judges, the senior engineers here at CodeFights, will be looking for code that’s expressive, readable, and concise. They’re going to choose the three most beautiful solutions to this challenge as the winners!

If you win, you’ll receive an all-inclusive trip to San Francisco, including a round-trip ticket from any city in the U.S. and three nights at a hotel downtown. And of course you’ll get to come hang out with us at CodeFights HQ and nerd out about all things JavaScript and CodeFights!

Excited yet? Yeah, so are we! We can’t wait to see the great solutions that you come up with. Join the Beautiful JavaScript challenge on CodeFights!

Official rules for Beautiful JavaScript:

  • All CodeFighters can solve this challenge, but only people in the U.S. are eligible to win.
  • You must write your solution in JavaScript, obviously!
  • Your solution must be submitted before the contest closes at 12:00 PM Pacific Time on Wednesday, July 26.
  • The three winners will be notified by email and their names will be posted on the CodeFights forum by 5:00 PM Pacific Time on Friday, July 28.