Q: concurrent hashmap locking -- locking on an internal bucket object or a map entry object?
Q: a weak reference object can have a finalize()? What if in finalize() you make the object "reachable from the GC root set"?
Q: when do you use WeakHashMap?
Q: what's a phantom reference?
Q: static fields during serialization?
Q: how do you make a hashmap (not a hashtable) thread safe?
Q: how does jms provider keep track of which message has not been delivered to each durable subscriber?
Q: different modes of acknowledgment in JMS? what's the default mode?
Q: what's JMS correlation id?
Q: how does a java app know a file is already open for writing by another unix process id, so it should wait and avoid concurrent edit?
Q: if one method has synchronized(b){synchronized(c){...}}, and another method has synchronized(c){synchronized(b){...}}, and b and c point to the same object, can you think of when people write such code?
A: always bad design, unnecessarily confusing. Deadlock prone. Programmer must know for certain that b and c reference the same object throughout. I'd add an assert as documentation.
Q: what changed in 1.5 for notify()?
Q: key differences between Set and List?
Q: A set should contain unique objects but what if you input 2 unique objects and then make them identical twins (ie a.equals(b))? So the set has duplicate entries? Consequence?
Q: how many types of iterators are there?
Q: what classic design patterns did you use?
Q: what categories of design patterns do you know?
Q: what j2ee patterns did you use?
Q: how is the treeMap or TreeSet implemented internally? What kind of binary tree?
Q: what's Shell sort? What other sorts do you know?
Q: what's the time complexity of quick sort?
Q: name 5 things you would consider before developing a java threading app.
A: privatize all fields in shared objects
A: immutables
A: reduce number of locks
A: I should know exactly how many threads system will create. Reduce the number.
A: any wait/notify required? Need to know early since they tend to mess up my design
A: extremely mindful of deadlocks
A: avoid synchronization if possible -- use concurrent data structures
A: producer/consumer and other threading patterns. Avoid creating my own threading "pattern" or framework.
My main blog
Labels
_fuxi
(75)
_IV
(146)
_misc
(5)
{610610
(30)
algo
(1)
automatedTrading
(8)
banking/economy
(3)
book
(14)
c++misc
(125)
c++real
(15)
c++STL/java_container
(7)
cppTemplate
(1)
db
(13)
DB_tuning
(4)
deepUnder
(1)
dotnet
(69)
eTip
(17)
excelVBA
(12)
finance+sys
(34)
financeMisc
(24)
financeRisk
(2)
financeTechMisc
(4)
financeVol
(21)
finmath
(17)
fixedIncome
(25)
forex
(16)
IDE
(24)
invest
(1)
java
(43)
latency
(4)
LinearAlgebra
(3)
math
(30)
matlab
(24)
memoryMgmt
(11)
metaPrograming
(2)
MOM
(15)
msfm
(1)
murex
(4)
nofx
(11)
nosql
(3)
OO_Design
(1)
original_content
(4)
scriptUnixAutosys
(19)
SOA
(7)
socket/stream
(15)
sticky
(1)
subquery+join
(2)
swing
(32)
sybase
(6)
tech_orphan
(12)
tech+fin_career
(30)
telco
(11)
thread
(21)
timeSaver
(13)
tune
(10)
US_imm
(2)
US_misc
(2)
windoz
(20)
z_algo+dataStructure
(4)
z_arch
(2)
z_c#GUI
(30)
z_career
(10)
z_career]US^Asia
(2)
z_careerBig20
(1)
z_careerFinanceTech
(11)
z_FIX
(6)
z_forex
(31)
z_hib
(2)
z_ikm
(7)
z_inMemDB
(3)
z_j2ee
(10)
z_oq
(14)
z_php
(1)
z_py
(26)
z_quant
(4)
z_skillist
(3)
z_spr
(5)