Mostly based on a veteran’s input…
Most GUI clients I have seen use some sort of messaging and you want that to be as asynchronous as possible. There is no reason to keep the user waiting. User clicks on something, the client sends a message to the server and the client is now waiting for a response. When a response comes in (on a separate thread), the GUI takes it and displays whatever it needs. Some people stick a unique request id in the message so when the response comes they can figure out to which request it belongs.
You also have subscription cases where you subscribe to prices for a security and the server will tell you listen to this channel for all updates. That should be encapsulated in some sort of handshake.
RV, 29West and JMS are good choices.
Q: how do u speed up a stored proc?
%A: join order; index selection; avoid table scan; update stats
Now I think we should first establish performance target, by estimating minimum I/O required. (U can’t make a huge query run faster than a tiny query.) Then measure actual logical i/o. See the gap? Usually u can find clues in the execution plan. Improve the plan.
Q: How could a string object’s content be modified?
A (right): reflection to access the char array.
Q: how does a singleton become a 2-ton?
A: 2 class loaders, but i thought class loaders form a delegating hierarchy so no 2 loaders compete to load a class?
A (from interviewer): you can create a class loader outside the hierarchy. Indeed singletons are per-classloader.
Q:diff between clustered and non-clustered index
The answer I forgot to give: a column with lots of updates is no good as clustered index
Q: Users complain about a delay/slowness. we know it’s due to a Unix process. How do you investigate.
A: top; thrashing.
Q: What’s garbage collection?
Q: I have an object in a cache. it’s not referenced from anywhere outside the cache. After using it once, i don’t need it anymore. How do i get it garbage collected?
A: just delete the entry from the cache
Q: lots of insert/delete/updates to a table. how do u keep track of all changes and by who? How do u ensure changes are always tracked?
A: %_hist table and milestoning
Code below is not fully tested, but it shows one feature of Data::Dumper — cross reference. Basically, $b content won't get dumped.
Dumper will show $b is an alias of (another pointer) @a.
If you don't want cross reference, then call Dumper() multiple times, each with a single argument.
$b = @a;
print Dumper @a, $b
Just 2 things
1) private ctor
2) friend function declaring a static variable.
First call to the function instantiates the object.
I think we need to disable copier and op= by declaring them private but without a _body_. See EffC++
PRECISE meaning of Type differs between java and C++.
– any (even marker) interface,
– any class,
– any primitive….
is a type. We say “the declared type of the variable”.
* any class, paramtrized or not
* primitive data type … is a type.
* typedef can declare new type names like aliases, but can’t create new types. Consider const_reverse_iterator.
For an architect and a student, it’s good know ..
when a method or field or argument is named like …register…, it often means “add a CALLBACK to an OBSERVABLE”. The observable (subject, dispatcher..) often holds a list of listeners. When some life cycle event occurs, it /notifies/ them. See other posts on callback, listener, async…
Registration is used in DI, Hollywood principal and many “frameworks”
* singletonList() …
* swap() to swap 2 items in a list
* shuffle — a deck of cards
* checkedList() …
converting between list, set and Collection –> don’t use Collections.java but use constructors.