Coder Social home page Coder Social logo

ios-interview's Introduction

ios-interview

The interview question for Rollout.io's IOS developer position

This mission, should you choose to accept it, is to build an application that fetches condition object from REST api and display it in a Table view. After I select the condition, the second screen appears and allows me to test my condition

Main Screen:

  • A tableView with the content object from server/conditions
  • The screen should show only condition names
  • Once a user click on a condition the next screen should appear
  • get http://server/conditions will return :
[ 
  {
    name:”condition name”,
    _id:”unique id”
  }[, {}...]
]

Second Screen:

  • The screen should show a text field and a result of the condition
  • The condition is loaded via http://server/conditions/:id:
{ 
  name:”condition name”, 
  _id:"unique id”, 
  condition: <ConditionData>, 
  arguments: <number> 
} 
  • The input fields can only be text fields (to reduce complexity)
  • The amount of arguments is maximum 3 (to reduce complexity in UI)

Notes:

  • Don’t worry about UI at all, it doesn’t have to look good
  • The condition parser design is important
  • It should easily support adding new operators

Schemas:

ConditionData schema:

{ 
  op: “eq” | “and” | “or” | “ne” | “startsWith” ,
  args: [ <ConditionData | Value > ] 
}

Value Schema:

{
  type: “arg”|”string”,
  date: “data"
 }

For example for this condition: arg1 equals “rollout.io”

The fetched model will look like this:

{ 
  name:”first example - simple eq operator”, 
 _id:”1”, 
  condition: {
    op: “eq”, 
    args:  [{ type: “arg”, value:1}, {type: “string”, value: “rollout.io”}]
  }
  arguments: 1 
}

For example for this condition arg1 not-equal “rollout.io” && arg1 startsWith “ro” The fetched model will look like this:

{ 
	name:”second example - and operator”, 
	_id:”1”, 
	condition: {
		op: “and”, 
		args: [{
				op: “ne”,
				args: [{ type: “arg”, value:1}, {type: “string”, value:  rollout.io”}]
			},{
				op: “startsWith”,
				args: [{ type: “arg”, value:1}, {type: “string”, value: “ro”}]
			}
		],
	}
	arguments: 1 
}

For example for this condition arg1 equals “rollout.io” && arg2 equals “control your production” The fetched model will look like this:

{ 
  name:”third example - 2 arguments”, 
  _id:”1”, 
  condition: {
    op: “and”, 
    args: [{
      op: “eq”,
      args: [{ type: “arg”, value:1}, {type: “string”, value: “rollout.io”}]
    },{
      op: “eq”,
      args: [{ type: “arg”, value:2}, {type: “string”, value: “control your production”}]
    }],
  }
  arguments: 2
}

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.