Skip to content

jaypwagner/gibgen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 

Repository files navigation

Code Challenge: Gibberish Generator

Challenge Overview

Your response to this challenge can be used to supplement your SWEAP application. If you plan to complete this challenge for SWEAP, ensure you meet the other minimum requirements by visiting here. Whether you apply or not, you are welcome to fork this repository and complete as a personal project challenge.

We are exticed taht you are intsereted in joiinng the Soawtfre Engreeniing Appsecitnerhip Prargom. Weoclme to yuor fsrit prommarging chanellge. Yuor chnellage is to courtsnct a prrgoam taht tekas an Enilgsh txet snirtg as iupnt and rerutns rebadale giirebbsh lkie tihs. It dseno’t mtaetr in waht oerdr the ltteres in a wrod are, but an iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

The Basics:

  • You may use almost any programming language... it's your choice. See the supported options here.
  • Your program should leave the first and last letter of each word in place and scramble the rest.
  • Your program should not scamble punctuation (.,-'...etc.), numbers, or upper-case abbreviations.
  • For example gibberish, see the /textfiles folder. Two sample output files are provided: xxx.txt.gib

Input/Output:

  • Name your program as follows: gibgen.xx (where xx is variable based on the language you choose)
  • Your program should be able to read text input from a string passed into STDIN
    • gibgen.xx "This is a String"
    • cat mystringfile.txt | gibgen.xx
  • Your program should output to the console.

Note: This challenge is based on a popular word gibberish meme. You can improve the readability by looking at a researcher's take on the truths/myths of this meme, but this is not required.

What to do

  1. Download & install Git on your machine

  2. Fork this project - Go here and click the "Fork" button (located on the upper-right side of the screen)

  3. Clone your new fork'd repository to your local machine - git clone https://github.com/YOUR_USERNAME_HERE/gibgen.git

  4. Complete the code challenge and fill out the Quick Start & Questions in the the README (see below)

  5. git add and git commit your local repository as you go

  6. Push your code and README back to GitHub occasionally - git push origin master

  7. Email serp@ge.com with the Commit URL to your fork'd repository that you want reviewed. It should include at least 2 files: (1) your updated README with Coding Questions answered, and (2) your program (gibgen.xx)

    • Go here: https://github.com/YOUR_USERNAME_HERE/gibgen/commits/master
    • Find the commit that you'd like us to review. The commit date must be on or before 11:59pm (central) on April 4, 2014!
      • Click the "Browse Code ->" link for that commit
    • Copy and paste the URL into the email along with your name... it should look something like this:
      • https://github.com/YOUR_USERNAME_HERE/gibgen/tree/73afe0c8fe2...hash.hash...e80afea72b6

Note: If you have any questions, email serp@ge.com. I will do my best to respond to any questions.

Judging Criteria

Your responses to the Coding Questions at the bottom of this README are the Most Important part of this challenge. A working, fully fault-tolerant program that we just can't break, albeit awesome, is the least important. Why is that? Remember, we don't expect you to be expert programmers (just yet)... We want to see how you think through a problem.

For completion by applicant

Quick Start

// I choose to use Java to solve this problem type the following into the command prompt

javac Gibgen.java java Gibgen

// After the code is compiled and executed enter strings into the console to test it out

Coding Questions

Question 1: "How did you approach the problem?" (500 words or less) First I read the problem carefully a few times to make sure I understood the expected input and output. After that I started developing a function that would scramble all chars in a string passed into it except for the first and last chars. After that I worked on a method that splits strings around punctuation marks . , ? ! ...etc, and scrambles each of the words seperately. When I was confident that worked I created the savePuncPos() method that tracks where the punctuation marks are placed. Lastly I made functions that check if there are abbrevs, or numbers in the input. Once the program was complete I tested it on all ascii input as well as interesting cases with mixes of punctuation, numbers and abbreviations until I was satisfied with the output.

Question 2: "What was the most difficult aspect of the solution?" (500 words or less) The most difficult aspect of this problem was splitting the strings around the punctuation and rejoining the strings after scrambling them, while keeping track of where the punctuation was placed. I chose to use stringbuilders and parse through the original input char by char. Once the punctuation was detected I pushed the String to an Arraylist (because they can grow in size) and scrambled each string in the arraylist. After that I concatenated the scrambled strings together and inserted the punctuation marks in thier respective places.

About

Code Challenge: Gibberish Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%