JavaRush /Java Blog /Random EN /Test task "Image Comparison"
Roman_kh
Level 33
Харьков

Test task "Image Comparison"

Published in the Random EN group

Hello everyone, dear readers and forum users!

It's a great idea to start posting tests for those who want to test themselves before an interview. Started this thread and I remembered that I also have a couple of tasks.
Here I will set only the condition of the task, in the comments you can discuss the solution algorithm. The task, as usual, will be in English.
  • The output of the comparison should be a copy of one of the images image with differences outlined with red rectangles as shown below.
  • We need to see your own code. No third party libraries and borrowed code is allowed.
  • Target completion time is 2 hours, but you may choose to use up to 4 hours. Submissions sent after 4 hours will be disqualified. Note that in addition to quality, time is also factored into scoring the task. The closer you get to 2 hours the higher is the score.
  • Test Test Test
    Nice to have
    • It should be possible to exclude certain parts of the image from comparison, for example a clock or dynamically generated number. They will be provided by the caller as a list of rectangles to exclude.
    • Provide some sort of UI either as a web page or GUI that allows the user to select the images and view differences as an overlay on either of the images.
    Expected Deliverables
    • source code.
    • Binary version of the algorithm that runs and produces output of comparison. No build should be required.
    • Output image showing the result of comparison.
    Tips and Hints
    • Use javax.imageio.ImageIO to read/write images.
    • Consider java.awt.image.BufferedImage#createGraphics() to draw on in-memory images.


    From myself I want to add that it would be good practice to write JUnit tests for all this stuff. To do this, you will need to use some kind of Ant / Maven / Gradle project build system to pull up the lib for JUnit.

    We put "+" on the article if it was useful. We solve it, pump our skills. She came across in two companies! See also my other articles:
    Quiz: "Write a BrainFuck Interpreter"
    Quiz "Image Comparison" Java - faster, stronger and higher! Salaries of Ukrainian programmers. Success story after 1.5 years from the start of training
    Technical questions at the interview.
    How to find a job? Sending resumes
    Professional burnout. How to resist?
    English for IT and for interviews
    Pattern Command in your own words.
    Singleton pattern in your own words.
    How to create an executable jar in Intellij IDEA / how to create jar in IDEA
    Help, I need some motivation!

    Subscribe to my blog Design Patterns and write articles in it!">
    Comments
    TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
    GO TO FULL VERSION