Giter Site home page Giter Site logo

intj's Introduction

Original Text of the Assignment

Walla! Backend Engineers Test Assignment

Heya, In order to evaluate your skills as a backend Web engineer, we would like you to take this short development assignment, at your own free time.

General Guidelines:

  1. Please provide
    • working code.
    • a brief design document explaining what you did.
    • a link to a server where your code can be tested.
  2. Feel free to search the Web for inspiration, but please do not copy code from anywhere, keep it 100% yours.
  3. Use Python as your language of implementation. Micro​ Frameworks and utility libraries are allowed, but not a full blown MVC.

The Test Assignment:

You are to design and implement the API and server side modules for a simplified twitter like social updates site, and a simple AJAX client for it. The application contains users; Each user can post short text messages, follow other users, and get a feed of the latest updates from the users he is following. You can also get a global feed for all the users.

  1. Implement an HTTP based (ReSTful in the loose sense of the term) API that exposes the following calls (no need for authentication, choose the format you like):
    • CreateUser(UserName)
    • PostMessage(UserId, MessageText)
    • Follow(FollowingUser, FollowedUser)
    • Unfollow(FollwingUser, UnfollowedUser)
    • GetFeed(ForUserId) Note the aggregate feed of the users this user is following!
    • GetGlobalFeed()
  2. Please create an ajax based HTML page for this API:
    • Interface ​ It should support getting the messages from the followed users per user Id, with real time updates, and the ability to post messages. You do not need to implement following/unfollowing. No styling required.
    • Implementation Use of toolkits (jQuery, Zepto, bootstrap..) is fine, but no frameworks plz (Angular, Backbone..). No need for mobile adaption. Strive for efficiency and readability.

Good Luck! The Walla! Backend Engineering Team

What Needs to Be Done

Install and test Tornado

  • State “DONE” from “TODO” [2013-10-02 Wed 08:20]
    This was the easy part.

Was suggested during the interview

Make sure MySQL binding is up-to-date

  • State “CANCELED” from “TODO” [2013-10-02 Wed 08:21]
    I’ll be using neo4j, that’s decided.

I have some vague memories of it being problematic to install, perhaps it required mysql-devel package? Can setuptools install RPM / DEB?

Maybe try py2neo

  • State “DONE” from “TODO” [2013-10-02 Wed 08:21]
    Yup.

Just for the sake of experiment? There are couple of videos to watch. If I can get it to run easily, I’d probably use that.

Figure out what Apache httpd module to use

  • State “CANCELED” from “TODO” [2013-10-04 Fri 19:08]
    Using nginx, so no need for Apache modules

There is some controversy about WSGI / FSGI / mode_python Need to make sure I’m not using some outdated / unsupported library.

Brush up on Tweeter Bootstrap

  • State “DONE” from “TODO” [2013-10-04 Fri 19:09]
    Welp, using it now.

This is most likely candidate for the GUI. Need to see what components are already there, and what’s missing (unlikely).

Find out what most people use for unit testing

We’ll see what Stackoverflow has to say…

Ropemacs was giving me headache lately

  • State “DONE” from “TODO” [2013-10-04 Fri 19:09]
    Been okay so far.

See if the stupid thing still works. Maybe we shall do w/o it. There was some other package… Probably elpy or some such, maybe it makes sense to check it out.

Start a GitHub repo (and fix the setup)

  • State “DONE” from “TODO” [2013-10-02 Wed 08:21]
    Looks like it also can now display Org files markup, so no need to export to Markdown

Not today.

Serve pages only within session

Now pages assume the user is inside session, but break wen it is not the case. Need to redirect to login, when not in session.

Fix input field width in login

It must be using some default value, different in different browsers. Must set it to something.

Add tab navigator ot profile page

This is to switch between own profile, personal feed, collective feed.

Add error reporting in login UI

Errors are reported from server, but not displayed in the client.

Implement following / unfollowing

We already have a way to populate the content, not much remains to be done.

Implement get_feed

Again, we already have the content, just write the aggreate functions and be done with it.

Installation

All instructions are given for Fedora Core 18, but should be similar for Debian-like distributions. Substitute apt-get for yum where appropriate.

First, install nginx server:

sudo yum install nginx

Next, download and set up neo4j from: neo4j, follow the installation instructions.

Stop (if started) nginx server:

nginx -s stop

Start nginx server with custom configuration file found in nginx.conf by running:

nginx -c /path/to/nginx.conf

Run setup.py:

sudo python ./setup.py

Check that main.py has execute permission, if not do:

chmod +x ./main.py

Now you should be able to launch the Tornado server:

./main.py &

Site Map

The site consists of the following pages:

/login

This is where users log in or register.

/social-network

This is the page where users read each other feeds, change their profile info, view their own feeds and write new articles.

/profile

This page displays the user’s profile (the currently logged in user or the one given by the user_id verb following next in the URI. Users can also follow and unfollow the profile owner from this page.

/article

This is the page where users read single articles. Articles are given by the article_id verb following next in the URI.

Project Description

Right now I’m thinking about making it into a nomic game. The basic idea would be that by posting users may, in general, score points. More so, if someone comments on their posts, or if they themselves comment. But it would be also possible to loose points due to bad posts or comments. Sort of karma, just like there is one on the StackExchange sites.

I’m definitely going with py2neo, especially because it uses tornado. It’s not as efficient as SQL (at the moment), but who cares?

Nodes and relations I will need

Nodes

  • User#{ "id": int, "name": string, "password": string }
  • Post#{ "id": int, "text" : string, "score": int }
  • Comment#{ "id": int, "text" : string, "score": int} This is basically a reduced version of Post.

Relations

  • $user \; \boldsymbol{Follows(privately)} \; user$
  • $user \; \boldsymbol{FollowedBy(privately)} \; user$
  • $post \; \boldsymbol{PostedBy(privately)} \; user$
  • $user \; \boldsymbol{AuthorOf} \; post
  • $user \; \boldsymbol{Rates(points)} \; post$
  • $comment \; \boldsymbol{InResponseTo} \; comment$

intj's People

Contributors

wvxvw avatar

Watchers

 avatar James Cloos avatar  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.