Life Codecs @

Ruminations. Reflections. Refractions. Code.

Apr 23, 2009 - general software dev

A Failed Interview!

I had an interview yesterday – which I thought went quite well, except for 2 questions below (interview was around 30 minutes I think), which it seems were significant to the interviewer.

Disclaimer: I didn’t get the job – so there’s obviously some bias in what I have to say. If anything, just add these questions to your list of things to look out for when looking for a Java WebApp job. I did not have a full job description when I went in (it was not provided), all I knew was it involved Hibernate, and that they were a team following an Agile methodology.

The Questions of Doom were:

  1. What’s a Hibernate Session?
  2. In a WSDL, what’s the difference between port and binding?

Question 1, something I probably should’ve been able to give a quick answer for. I started with the Session being a non-threadsafe object, which allows you to do CRUD operations with entities. The interviewer brought up the relationship between a Session and a database connection, and this is where I fumbled – eventually saying that a session uses one connection. It’s tricky because a Hibernate Session performs many functions (the docs say so too – “The Session is also many other things”!! I wonder if that violates the SRP 😛 – though it’s probably more a logical Facade). When you learn it mostly on project where most things are set up when you get there, you tend to skip exact details, so reading about it formally: it’s a unit of work, it also maintains the persistence cache – a map of objects in the persistence context to ensure identity, it is a handle to load and store objects, it’s a list of SQL statements to be executed, and finally it obtains a connection from a connection pool. Many things eh. I knew all of this from experience, I just could not put it elegantly into words. I also obviously knew having too many sessions open at the same time could exhaust your connections!

I also now know that you can reconnect a session – but the API deprecates the no-param reconnect() method, and you have to supply a connection reconnect(Connection)… any ideas on what the use case for this generally is? Extended sessions? Hmm…

Question 2, now I have done a fair bit of Web Services work, debugged quite a few issues too – but I’ve generally been a downstream client, so we get WSDLs from the upstream services, run a tool like Axis over it, voila a nicer Java view of the whole thing, so I didn’t have to tweak or look at the WSDL much – hence my knowledge of WSDLs themselves is fairly informal – I do know it’s basically a contract/webservice interface document and defines types, messages, and operations. When I did have to mess with WSDLs – it had to do with the operations and I/O parameters – the actual messages being passed around. So this question took me under 10 minutes to find resources for and get a fairly clear idea about the difference – a portType is like a module of available functions, and their parameters. A binding links these operations (and defines message formats) to a transport (which is usually just SOAP over HTTP anyway!). While I appreciate that it shows a crucial concept that WSDL separates messages from the transport – it’s hardly something that takes days to understand, certainly not rocket science (actually talking about SOAP itself, it very well could be).

In this interview, if I were to apply meaning to the whole incident, I would be left feeling a bit discontented – but I won’t do that because I know my abilities better than that – I so uberly-rock *cough* :P. In the end I just did not meet their expectations, but it is their expectations, and that is all. As for me, I’ll prepare better for notions or concepts that I take for granted because I use them everyday – must be like a fish-in-the-water-not-knowing-about-the-water-syndrome (that’s a long syndrome name…).

Apr 5, 2009 - martial arts

BKC Demonstration

I initially posted this video on Facebook (doesn’t look like I can point to my status and it’s comments from here?), and received some comments to which I needed to reply in some detail. However, Facebook restricts the amount I can type in a comment box, so reproducing it here.

See post comments. FYI it’s a demonstration by my grandmaster, founder of BKC.

Mar 14, 2009 - arts personal

“Nessun Dorma”, Vanessa Mae’s Violin Rendition

Here’s the video – it’s just some background images for the piece really, not a “real” video. Definitely makes it to my all-time favourite list. Here’s more info on the piece itself. You might also like the more opera-friendly version sung by the 3 tenors. For completeness, I like Andrea Bocelli’s version too.

Beautiful stuff. Hope you enjoy it as much as I do.

— Kamal, bumming and unemployed at 1.55am :-).

Mar 11, 2009 - general gripe


Disclaimer: Firstly, this is partly tongue-in-cheek (but only partly), and secondly I don’t think all consultancies are like this, there are definitely better companies out there, I’ve certainly worked in one. On to the content…

Michael posted a link to a news on Superpartners tech revamp on Facebook, which is expected to cost 70 million dollars (!). The news speaks of a company called CSC who’s secured a chunk of the SI work. Anyway, this post has nothing to do with CSC (so please keep your lawyers on a leash) – but it brought us to the topic of consultancies (ya know, mind associations, boredom, that kinda thing). Since Mike seg-faulted reading my long comment (how rude), I may just delete it – but I rather liked my comment, so thought I’d reproduce it here before dust turns to dust.. or comment to.. bit dust.. whatever.

The background conversation here is that moving jobs from one bad consultancy to another may just entail the same thing, my comment:


Scary ain’t it.

In terms of code it’s like someone defined a few marker interfaces: ICrap and ILateHours. The base class AbstractConsultancy implemented them, and added more of its own inner painful classes (e.g. AnalysisParalysis and AllPainNoGainStakeholderMeeting).

Then the various consultancy startup entrepreneurs created their own Consultancy classes extending AbstractConsultancy (for much of the work was done there), but also implementing IPersonalisedCrapAndLateHours to add their own distinct flavour. Oh then obviously they instantiated the Consultancy.

I’d link to a UML class diagram, but this sore throat exacerbates my inertia. Please use your imagination skills, guys and gals.

Yours truly in sarcasm,



Ah, my space, my comment.

— Kamal