Coder Social home page Coder Social logo

gemfair's Introduction

Requirements

- Build a simple microservice that can receive an uploaded image and return a unique identifier for the uploaded image that can be used subsequently to retrieve the image.
- Extend the microservice so that different image formats can be returned by using a
  different image file type as an extension on the image request URL.
- Extend the microservice with simple filters such as crop and rotation.
- Write a series of automated tests that test the image upload, download and file
format conversion capabilities.

- API Details
	- API Endpoint: "/upload-image"
	- Output: Returns a JSON response
		for eg: { "id": "unique_id" }
	- Details:
		- When user requests the above endpoint, the user will be asked to select and image and click on upload to upload the image

	- API Endpoint: "/download"
	- URL Parameters:
		- "/download?id=unique_id"
		- "/download?exts=image_type" (image_type = jpeg|jpg|png|gif)
	- Output:
		- Loads the respective image in the browser for a unique id passed in URL
		- Loads all the images matched with the image_type(extension) in the browser
		- To download, click on the Image

Questions • What would you have done if you had more time? 1. I would've implemented the Database to store the images and to serve the user requests 2. Would've implemented a Cache mechanism to serve the repeated requests to download the image 3. Would've designed a UI (least priority) to serve and upload the images 4. Would've designed a queue mechanism to upload the multiple images at once 5. Logic to handle/serve the large image files

• How did you design this service to meet the high-performance requirement?
	1. Load Balancer to handle the number of requests
	2. Cloud Storage to store the images uploaded by users
	3. Cache mechanism to optimize the download of images

• How did you approach testing this functionality?
	1. I've tested the application from Postman
	2. Tested Upload Image API for different Image formats (I've restricted the image types for JPED, JPG, PNG, GIF)
	3. Tested with unknown Image Id's

Unclear about Requirements - Extend the microservice with simple filters such as crop and rotation. 1. When should we apply these filters (before uploading image to server or while serving the image as download request) 2. For Rotating the image also, we can achieve this through Javascript in the browser itself

To run the application: python run.py To test the application: python tests.py

gemfair's People

Contributors

vengalrao-eppa avatar

Watchers

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.