Monthly Archives: July 2017

Java Multi Thread Basics

1. Textbook questions (Summary – Divide – Summary) Process (application, program) vs Thread (share memory) Concurrency(progress at same time, some fast and others slow, single core) vs Parallelism (execute at same time, multi-core) Runnable (interface) vs Threads (class)   2. … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment

How to design a Big Data Platform

Data Producer: Rider / Driver App, API / Services, Dispatch (GPS logs), Map Services Data Product (Uber Surge Pricing – high in traffic, low in free time) Real time pipeline (Kafka -> Surge / ELK / Storm / Samza) -> … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment

How to design GFS/BigTable/MapReduce

How to design GFS/BigTable/MapReduce Foundation of Big Data Age Interviewer: design search engine How to read a paper? Find a suitable solution under your scenario instead of recite details What is the layers of search engine system? Layers of system … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , , , | Leave a comment

Java Design Patterns

Advanced Class Design Pattern Singleton Factory Builder Deps Injection Scale is large enough (then need Design Pattern) Project Requirement Epic Fantasy Story Role Play Game (RPG) Turn-based Strategy fighting system Treasure Collection Players Pick Roles NPC Roles Analysis Ability promotion … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment

Java Basic Object Oriented Concepts

Lambda: {arguments} -> {statements} Functional Interface: Comparator, Function, Predicates Method Reference: Class::method Default Method: implementation in Interface Stream: map, reduce, sort, filter Collectors: joining, toList, summingInt… Map: putIfAbsent, computeIfPresent, Tree Node (separate chain) Optional Basic OO in Java (Class is … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment

Java 8 features

Pass by value in Java Primitive Value, copy Object, copy of reference Out of memory (Heap, method, copy of reference) Stack overflow (Stack, object, instance) Java 8 features Lambda expression (interface, extract one abstract method, mark as function interface) Method … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged | Leave a comment

Java Basics (Sorting, Classes)

Sorting if same time complexity, check # of swaps # of comparisons o(n^2) Insertion sort > Bubble sort > Selection sort in place (maybe only o(1) space) stable (same numbers’ relative position are same, 2,3,4,5(1),5(2)) o(nlogn) Quick sort o(1) extra … Continue reading

Posted in CS Research&Application, Uncategorized | Tagged , | Leave a comment