Giter VIP home page Giter VIP logo

scalaoflife's Introduction

alt text

Scala Programming

Congradulations, you have passed the first step in interviewing with us. The next phase will be to take short exercises in programming.

In this exercise we would like you to exprience with Scala programming language which is a functional programming language.

Follow the instructions of the exam below, and produce the given results in Scala. You may use Pull requests from your Git account or send it to us back on e-mail

Please take your time, the exam is not hard and we don't need the result. We need to see how you code.

The first you have to do is install "SBT" [http://www.scala-sbt.org] on your machine.
The second is implement Scala code and test.

There's some Scala information here: http://www.scala-lang.org/documentation/getting-started.html


Exam

1. Create diamond shape follow by "n". (n is odd value only)
val d3 = DiamondShape(3)
d3.printDiamond() 
----------------------------------------------------------------
  +
+ + +
  +


val d5 = DiamondShape(5)
d5.printDiamond()
----------------------------------------------------------------
    +
  + + +
+ + + + +
  + + +
    +
Create butterfly shape follow by "n". (n is even value only)
val b2 = ButterflyShape(2)
b2.printButterfly() 
----------------------------------------------------------------
+       +
+ + - + +
+       +


val b4 = ButterflyShape(4)
b4.printButterfly()
----------------------------------------------------------------
+               +
+ +           + +
+ + +       + + +
+ + + + - + + + +
+ + +       + + +
+ +           + +
+               +

Software Library

  1. SBT
  • JDK 1.7 up
  • GIT
 > sbt compile
 
 > sbt test
 

All material herein © 2005 – 2014 Agoda Company Pte. Ltd., All Rights Reserved.
AGODA ® is a registered trademark of AGIP LLC, used under license by Agoda Company Pte. Ltd.
Agoda is part ofPriceline (NASDAQ:PCLN)

scalaoflife's People

Contributors

fixxer avatar hagaypeleg avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.