Tutor profile: Antonio T.
Subject: Processing Programming
Describe differences between stream processing and batch processing.
Those two are different techniques to approach to data processing. Stream processing: - handles one chunk of data at time doing various steps until its completed and moved on on next - tends to be simpler but might be less efficient than batch processing especially when performing remote requests Batch processing: - handles batch of data at time doing various steps in application for whole batch at once, when whole batch is finished it's continues with next batch - tends to be more complicated ti implement especially when dealing with async requests and in situations when different parts of batch need to be handled differently - main reason to have batch processing if for better network performance because one big remote request will be much faster that many small one due tto duration of network round-trips.
Subject: Java Programming
What is purpose of following methods that all java Objects have: - boolean equals(Object object) - int hashCode()
Method equals: Serves to test for semantic equality of two object instances. Default Object's implementation returns true only when invoked against same instance itself. Derived classes might need to override this method to support proper equality test of two different instances. It is used in many places in standard library such as in various collections to when performing contains check operation. Method implementation should follow several contracts: - reflective: method must return true for for same instance - symmetrical: method must return the same when A is tested on B and when B is tested on A - transitive: if A is equal to B and B is equal to C, then A needs to be equal to C Method hash code: Serves as representing an integer value for digest of an object. Implementation should attempt its best to return different value for different objects. But contract of this method against equals method is that two equal objects need to return same hash code value. Method is used in standard library, for example in HashMap implementation to be able to support fast lookups in map based on hash code of key object.
Subject: Computer Science (General)
What is data caching and what is it's purpose?
Data caching is technique to store previously calculated/obtained results for future/near-future re-use. Main purpose is to avoid repeated expensive calculation of already known result or avoid need to do lengthy network request to external system. Re-using cached reduces execution time and minimises CPU or external systems utilisation. Having cache comes with it's own cons such as: - increased memory consumption for storing cached values - cache invalidation problem which manifests in situation when working with external systems when data can change any time. When we use cache we need to be careful how to deal with situations if we use cached value when actual external data was changes since we stored it in our cache.