exotel tech challenge

The Exotel tech challenge

 

Welcome to the Exotel tech challenge.

 

The Exotel tech challenge is a shortcut for you to be a part of the Exotel engineering team. We have 2 challenges listed here. You can pick either of them and mail in your completed solutions (or questions if you have any) to work at exotel dot in. Good luck! ?

Exotel Tech Challenge # 1: An In-Memory Data Store

 

Your challenge is to implement an in-memory data store like Redis, let’s call it ExoRedis.

Your code will be judged primarily on:

 

1. Performance: What we love about Redis is its speed. We want your ExoRedis also to be blazing fast – comparable to Redis!
2. Coding style: How is your code design and structure? Are you using the right abstractions? And in general, cleanliness of code.
3. Correctness (goes without saying!)

You only need to implement only the following commands of Redis:

1. GET
2. SET: Including all the options
3. GETBIT
4. SETBIT
5. ZADD: You may assume single [score member] inserts.
6. ZCARD
7. ZCOUNT: Assume min and max are always inclusive. ie, You do not need to support the ‘(‘ notation for exclusive ranges
8. ZRANGE
9. SAVE

Protocol:

ExoRedis needs to listen on TCP port 15000. Our test code will _only_ connect to this port and issue commands.

 

ExoRedis should implement a protocol that is a subset of the Redis protocol. Take a look at ‘Inline Commands’ section in the above link. As you can see, requests will look very much like your redis-cli commands. Responses are somewhat different though – take a look at the documentation. You can telnet to your Redis server and try it out.

Config:

 

ExoRedis needs to take a file path as an argument

 

– while starting up, it should load the DB from this file.
– during the SAVE command and shutdown (ie, Ctrl-C or SIGINT), it should dump the DB to this file.

A few general notes:

 

1. Your code MUST compile and run on any standard Linux distro.
2. You will need to provide compilation / running instructions.
3. You may use whatever language you want to. Only performance matters!

Exotel Tech Challenge #2: A Brokered Job Queue

 

We at Exotel use Beanstalkd extensively as the technology for our brokered queues. It is simple and blazingly fast. Your challenge is to implement a brokered job queue like Beanstalkd, let’s call it ExoBeanstalkd.

Your code will be judged primarily on:

 

1. Performance: What we love about Beanstalkd (over SQS or RabbitMQ) is its speed. We want your ExoBeanstalkd also to be blazing fast
2. Coding style: How is your code design and structure? Are you using the right abstractions? And in general, cleanliness of code.
3. Correctness (goes without saying!)

 

The Beanstalkd protocol is given here: https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt. You only need to implement only the following commands:

 

1. use
2. put
3. watch
4. reserve
5. delete

Implementation Notes:

 

1. ExoBeantalkd needs to listen on TCP port 15001. Our test code will _only_ connect to this port and issue commands.
2. For the above commands, ExoBeanstalkd should implement the Beantalkd protocol _exactly_ as defined here: https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt
For ex: a “reserve” command on successful reservation should return something likeRESERVED \r\n
\r\n
3. ExoBeanstalkd may store all jobs purely in memory – ie, no need to have a binlog that saves the jobs when the process gets killed

A few general notes:

 

1. Your code MUST compile and run on any standard Linux distro.
2. You will need to provide compilation / running instructions.
3. You may use whatever language you want to. Only performance matters!

 

Are you ready to take up the challenge?