Skip to content

answers to questions

Asad Ali edited this page Feb 26, 2017 · 5 revisions

Questions

Please answer the following questions in a markdown file called answers to questions.md.

  • How long did you spend on the coding test? What would you add to your solution if you spent more time on it? If you didn't spend much time on the coding test then use this as an opportunity to explain what you would add.

Answer

I took around a week of time (an hour on daily basis), which is of course more time in term of day but not hours. Complete code could be developed in one working days.

  • What was the most useful feature that was added to Java 8? Please include a snippet of code that shows how you've used it.

Answer

I think its Lambda expressions, which brings Java to the forefront of functional programming, right there with other functional JVM-based languages such as Scala and Clojure.

List<TransactionsDto> transactionsHistoryDtosList = transactions.stream().map(f -> {
		TransactionsDto transactionsHistoryDto = new TransactionsDto();
			transactionsHistoryDto.setAmountSpent(f.getAmountSpent());
			transactionsHistoryDto.setCurrency(f.getCurrency());
			transactionsHistoryDto.setDescription(f.getDescription());
			transactionsHistoryDto.setDate(f.getTransactionDate());
					transactionsHistoryDto.setTransactionId(f.getTransactionId());
transactionsHistoryDto.setLastTransactionType(f.getLastTransactionType());
			transactionsHistoryDto.setUserId(f.getUserId());
			return transactionsHistoryDto;

		}).collect(Collectors.toList());
  • What is your favorite framework / library / package that you love but couldn't use in the task? What do you like about it so much?

Answer

Since it’s a small task, so couldn’t utilized 100% of any framework, let it Spring, Hibernate or be Java 8. Being a java developer, I like Spring framework, dependency on any other framework is less if you are using Spring as it contains bunch of feature. In short everything could be found in Spring and no need of using different framework for different purpose unlike if we go few year back developers were forced to use Struts, Hibernate and some other third party framework for different different purposes.

  • What great new thing you learnt about in the past year and what are you looking forward to learn more about over the next year?

Answer

I learned n number of things in the past years, like I upgraded myself from Java 7 to Java 8, learned about messaging System such as activeMQ and kafka a bit for sending notification or mail to the users. Presently I am learning Scala and in future would like to learn and work with AWS services.

  • How would you track down a performance issue in production? Have you ever had to do this? Can you add anything to your implementation to help with this?

Answer

There could be n number of things which may be responsible for performance issues. In one hand network traffic, memory leak, API response time is more (slow or delayed response) etc. Organization may track with the help of analyzing or profiling tools. If DBA runs stats and reports for the app, then we can monitor that too. In other hand Tracking could be done in following ways. Analyze logs. This can vary from enabling %T in Apache log format to setting log format to "DEBUG" (Note: Logging in Production environments is usually set to "ERROR", so best to do this in a lower environment like Test). The only solution to the performance issue is to take precaution while development phase itself, by following some of the below steps.

  1. Don’t hit database on frequent call until and unless require, Identify the stuff and try to cache them which you can cache. Use framework like memcached, redis etc for caching purpose.
  2. Try to form relationship between tables based on situation and requirement, Use proper fetch type (Eager or Lazy), minimal use of eager would be appreciated but not mandatory.
  3. Use of proper indexing on column will also save the response time while retrieving results.
  4. Take thread and heap dumps. Analyze them for locks or memory leaks. Memory Analysis Tool is a useful tool for heap dump analysis
  • How would you improve the APIs that you just used?

Answer

Answer to this could be taken from previous answer (if improvement is in the sense of performance). Although constant values could be cached instead of persisting in database, like preset messages, amount, success and failure messages etc.

If improvement is in the sense of adding more feature or enhancement then there could be multiple things such as

  1. Login could be more secure and genuine if access token is used with social networking sites like Google, Facebook, and LinkedIn etc.
  2. We can use Google API to fetch user locale or country and based on that we can auto assign currency for the user (In update profile we can add option of changing currency too).
  3. We can implement email and notification feature so that user could be notified in case of any promotional offer or if amount got credited or debited from/to account.
  • Please describe yourself in JSON format.

Answer

{
   "myself": {
      "personal": [
         {
            "Name": "Asad Ali",
            "from": "U.P",
            "Age": 26,
            "Sex": "Male",
            "contact":7066908372
         }
      ],
      "educational": [
         {
            "degree": "B.tech in Computer Science.",
            "university": "JNTU- Hyderabad ",
            "percentage": 76.99
         }
      ],
      "professional": [
         {
            "previousOrganization": "Synechron Technologies Pvt, Ltd",
            "presentOrganization": "Woo App"
         }
      ]
   }
}
  • What is the meaning of life?

Answer

It depends how you think or take it, perception of life changes from person to person, and in my perception life is an existence or flow or movement which defines your growth backed by your activity. One can only exist if he or she has flow or movement in her/his life, even water can’t live without flow, water with flow is fresh otherwise it is dead water. A person without movement is also considered as dead. Here flow or movement means keep going, even though if you fall get up again and move, let it be if it is ups or downs (A flowing water also faces ups and downs on the way and many more obstacles). Struggle and fight with obstacles and show your existence, if you want, not to be considered as dead.

Clone this wiki locally