Answer the question
In order to leave comments, you need to log in
Review code or what's wrong with my test task?
Recently I was interviewing for the position of Middle Android Developer in one of the application development companies.
After talking with HR and a technical interview with a team leader, I was given a homework test. Completion time 5 hours.
Having successfully completed the task in 4.5 hours and sent it to HR, I began to look forward to the result.
The next day I received the answer "The level of performance of the test task leaves much to be desired."
The answer shocked me, to put it mildly... I wrote a letter asking me to describe my mistakes in more detail. In response, I received an ignore ...
I ask those who wish to comment on the execution of this test task. What is wrong with the performance?
Project on GitHub https://github.com/krawa/EstafetaTest
Thank you all!
Answer the question
In order to leave comments, you need to log in
Personally, I have a code of the form
setupList();
showListProgress(true);
getTaskList();
An opinion on design, since I don’t have skills in java - the code, of course, is written for the machine, and it doesn’t matter how it is written - as long as it works, but read by a person and understand to maintain and expand the functionality - to a person.
adapter/TaskListAdapter.java
public boolean areItemsTheSame(Task item1, Task item2) {
return !(item1 == null || item2 == null) && item1.getId() == item2.getId();
}
if (ActualEndDate != null ? !ActualEndDate.equals(task.ActualEndDate) : task.ActualEndDate != null)
return false;
...
if (длинное условие)
doSomething();
doAnotherThing();
...
...
if (длинное условие)
// doSomething();
doAnotherThing();
...
I'm not a programmer at all, not even a java junior.
But for example, a quick look at the comments says that you have never used javadocs, and for a mid-laner, this is most likely inexcusable.
Your variable names seem to have style, but they don't make sense. Looking at the code, it is not clear what exactly is stored in some variable, well, in general.
I myself am not a professional in androyd, rather an amateur, but I’ll insert my 5 kopecks:
private static Context mContext;
@Override
public void onCreate() {
super.onCreate();
mContext = this;
}
public static RestAPI get() {
if(instance == null) instance = new RestClient();
return instance.restAPI;
}
if (getActivity() == null) return;
. But with this you check the presence of the activity, but not the fragment, the fragment can be destroyed, or its view can be destroyed, or the activity can have another fragment altogether or something. In short, it will all lead to a crash.All in a bunch. Business logic is mixed with display, the middle must have an idea how to separate it all. It was possible to template the same adapters and fragments. Maybe something else, I didn’t really look =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question