Every Man For Himself by Beryl Bainbridge.
So, we're on this large ocean liner steaming from Southampton to New York in April 1912. It's night-time, the ship is at full speed, and there are icebergs about in the north Atlantic. I won't spoil the ending for you....
Well, needless to say it's not really about the Titanic, fascinating subject though the whole business still is nearly a century later. Rather this is a book about the end of the carefree years of optimism and progress of the early 20th century, an ending suggested by Bainbridge's previous novel The Birthday Boys (about the ill-fated Scott expedition, also in 1912), and one that would be echoed on a much larger scale by the outbreak of the First World War just a couple of years later.
The main narrator, Morgan, an adoptive nephew of the owner of the shipping line that owned the Titanic and a minor engineer involved in its construction, is a slightly awkward initiate into the world of privilege inhabited by the passengers on the ship's maiden voyage, some of whom are based on real-life passengers like John Jacob Astor IV and Benjamin Guggenheim. There are various darkly humorous incidents exposing the idleness and pomposity of this particular section of society, and, more importantly, their utter helplessness when faced with a genuine crisis.
Bainbridge has a particular liking for people's cosy routine being rudely shattered by outside intervention, in this case, of course, a ruddy great iceberg. None of the characters is really sympathetic enough for us to expend much energy rooting for them to survive, except perhaps Morgan himself. Then again one of the drawbacks of the first-person narrative is that you already know that the narrator survives the events being described, unless something awfully post-modern is going on, which isn't really Bainbridge's style.
Needless to say a mountain of books and films have been made with this as the subject; one that's interesting for unique reasons is Morgan Robertson's Futility, or The Wreck Of The Titan which describes the sinking of the world's largest passenger liner, the Titan, after hitting an iceberg in the north Atlantic. The unique bit is that this novel was first published in 1898, fourteen years before the Titanic sank. Spooky. I remember first reading about this odd coincidence in a book I had as a child called Oddly Enough which was a collection of odd and coincidental stories. Unsurprisingly there are rather a lot of books which have this string in the title, and most of them are collections of crazy and amusing anecdotes from this wacky old world of ours. I would need a cover picture to be completely sure, but I have a feeling this is the book I'm thinking of. Looks like it's out of print, but it can be had second-hand. Maybe I'll get hold of one for old times' sake and share a few more nuggets with you.