Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Tuesday, July 06, 2021

Programming Interviews Exposed: Coding Your Way Through the Interview 4th Edition

The Fourth Edition of Programming Interviews Exposed is a solid refresher on core computer science fundamentals. It is fairly concise. It presents core principles and provides a few very well explained problems. It does not have the theoretical depth of a text book or provide a vast array of every type of problem you may see. This makes it a great book for somebody wanting to brush up. The problems are generally language agnostic, though Java seems to be most frequently used in examples. (C++, C# and JavaScript also make appearances.) It does go into bits of more high level technologies such as map-reduce, SQL and AI, however, the focus is on the fundamentals and the process for solving problems quickly.

Sunday, August 09, 2020

Geek Sublime

Geek Sublime starts with great potential. The author details his experience at the intersection of the literary and computer world. Writing computer code can be similar to writing literary works. There are good writers and bad writers. Early on, coding was a "female" profession. It was considered to be similar to typing up a memo that was dictated by the male boss. The algorithm created by the "guy" was important. Coding it into the computer was simple. However, it soon became clear that coding computers is a skill and an art form of its own write. There is also a great thrill in getting a computer to do things. 

Computer programmers can also be a difficult to work with bunch. Even in open source communities that depend on working together, there can be plenty of battles. Programmers will often look down on others that use "higher level" languages that allow them to more easily do things. However, today almost everyone uses differing degrees of abstraction from machines. Even low level assembly language has taken us a few levels above the electrical switches that are operating on microchips.

The also spends time exploring differing cultural attitudes, especially with regards to India and the United States. In India, engineers and computer programmers are highly respected. Males and females both enter the field. In America, it tends to be dominated by Geeky males. 

Finally, the book takes a detour into Indian cultural and religious views. This part strayed from the original theses and lost me. Bits on Sanskrit were somewhat interesting, though seemed a little out of place. However, bits on Tantra seemed even more out of place. Perhaps a nice readers digest version could focus on the good parts without drifting too far.

Tuesday, September 25, 2018

Cracking the Coding Interview, 6th edition

Cracking the Coding Interview is an interview preparation book that emphasizes coding. It provides some general interview background, then dives deep into programming questions. The questions are organized by category and provide details answers. There is almost enough information there, to eliminate the need to go back to the old algorithms book.
The bulk of the book is the "question" section, with answers. They were divided into a number of different categories, with "C++", "Java" and "Hard problems" towards the end.
The questions seem to vary significantly. Some are nearly trivial, while others have multiple pages of code to answer. (This could be much more extreme than you are expected to find in an interview.) I found myself rushing through some sections as the answers just got to be too far "out there." They also seem to be somewhat dated. Map Reduce is treated as a cutting-edge solution rather than common implementation. There is also a ton of boilerplate (in Java) for many of the questions. It would be nice to explore different languages. Sometimes, the super complex java solution could be much more easily done with a different programming language.

Sunday, September 09, 2018

Programming Interviews Exposed, 3rd edition

Programming Interviews Exposed is one of the earliest of the genre of "programming interview books". I had read the third edition, though the fourth edition is now available. It covers the entire interview process from job search to salary negotiation and the actual interview. For coding interviews, it discusses good practices and provides some sample questions and types. However, the goal is not to provide a library of possible questions, but rather to cover some high level topics and guide the thinking process. In doing so, it does a good job of helping you to mentally prepare for the programming interview, including some of the curve balls that may be thrown.

Thursday, June 13, 2013

Commenting out JavaScript regular expressions in Node.js

Weird oddity commenting out code

This line works fine:


hc = hc.replace(/path=[^;]*/,"path=/"+hostMap[pref]);


However, if I try to comment out a block using /* */, things get wonky:

/*
hc = hc.replace(/path=[^;]*/,"path=/"+hostMap[pref]);
*/

The JavaScript interpreter throws a nice syntax error.
It turns out that the JavaScript interpreter sees the /* and says "cool, its a comment. I'll go until I see it close." Then it sees the */ of the regular expression and says "ok, I'm done."
It is left with some seemingly bogus line:
,"path=/"+hostMap[pref]);
*/

Now, if you could make this appear to be legitimate, you could get some seriously obfuscated code going.

The workaround is to comment out the line with the // mechanism:

//hc = hc.replace(/path=[^;]*/,"path=/"+hostMap[pref]);


Now if I could just figure out how to get chrome to start showing spell-check suggestions again...