Build Knowledge Tree
Monday, December 2, 2013
Technical Interview Problem 3
Design a component that will implement web browser history. the user goes to different site and once he press on history button you should display the last 5 (no duplicates allowed, and 5 can be any N later) if duplicates occur display the most recent one. so if user visit : G,A,B,C,A,Y and than press "history" we will display Y,A,C,B,G. and of course he can go later to two other websites and than press "history" we will show them than the previous 3.
Technical Interview Problem 2
You visited a list of places recently, but you do not remember the
order in which you visited them. You have with you the airplane
tickets that you used for travelling. Each ticket contains just the
start location and the end location. Can you reconstruct your journey?
order in which you visited them. You have with you the airplane
tickets that you used for travelling. Each ticket contains just the
start location and the end location. Can you reconstruct your journey?
Wednesday, November 6, 2013
Understanding Garbage Collector
I have copied the following slides from a presentation given by CTO of Azul Systems.
- concurrent and parallel are orthogonal terms. All four combinations are possible.
- All modern jvm will be the precise as if they are not precise then they will not be able to move stuff and that will lead to fragmentation.
- So the availability of safe points is crucial.
- Compiler injects these safe points.
- If there are not well placed safe points, threads will have to wait for others to reach safe points so that GC cab be started.
-At these safe points, GC will issue an stop-the-world.
Sunday, September 1, 2013
Complex ballroom dancers problem
Imagine that threads represent ballroom dancers and that two kinds of dancers, leaders and followers, wait in two queues before entering the dance floor. When a leader arrives, it checks to see if there is follower waiting. If so, they can both proceeds. Otherwise it waits.
Similarly, when a follower arrives, it checks for a leader and either proceeds or waits, accordingly.
At a time there will be a single pair doing the dance. Once a pair leave, the other pair enters. As shown in the diagram.
We will have the following ballroom class -
Similarly, when a follower arrives, it checks for a leader and either proceeds or waits, accordingly.
At a time there will be a single pair doing the dance. Once a pair leave, the other pair enters. As shown in the diagram.
We will have the following ballroom class -
Subscribe to:
Posts (Atom)