WYSIWYG

http://kufli.blogspot.com
http://github.com/karthik20522

Tuesday, February 21, 2012

Whaa (t), a good candidate?

There comes a time when after interviewing over few dozen candidates for a nothing out of the ordinary software developer position I started wondering if there is something called as a good candidate? Unfortunately it's hard to find out a candidate type [http://stevenbenner.com/2010/07/the-5-types-of-programmers/] in the limited time given during interviewing. So rather than determining if a candidate is a rock star programmer or a dud, I tend to categorize my candidates into 3 categories:

- Someone who works for the sake of working
- Someone who works for money
- Someone who is passionate and work more than what is asked for

This makes my questions easier since there is no technical aspect involved in judging a candidates character. The need to change my interview tactics was due to the following facts:

- Many programmers are not found of analytical questions like 2 trains traveling at so & so speed, tricky data structure etc

- Most programmers have probably not worked on the frameworks, technology that we use. It doesn't mean they are dumb, but just the fact that they haven’t had the opportunity to use them.

- Some are nervous during interviews so judging their technical skills only adds chaos.

- Last of all, we are not building Google like search or Facebook scale site, so an average programmer with the ability to learn is what we want and what most companies probably need

With all this in mind, the interview changed from Technical, whiteboard questions to semi-technical, all chit chat questions. But to my surprise, even non-technical questions were too hard to be answered! Is it the recruiter sending us less than average candidates or are my questions too hard to answer?? Following are my questions to
most of my candidates:

- What possibly are five fundamental things that a programmer should know either technical or non-technical or theoretical?
- Do you believe an ideal programmer should be a duck tape programmer?
- Have you heard of 4guys From Rolla? What design patterns do you usually use when you program?
- Briefly can you go over what you have been working on during past yr? More interested on programming/tech aspects of your work. Like I built websites using jquery/extJs, clubbed with rest based services, with oracle background etc
- Jack of all trades or king of one?
etc etc…

Is the above questions too hard or is it just the candidates who claims to over 3-5yrs of experience just not built to answer these questions! So I can't question technical questions nor can candidates answer non-technical questions; what the fuck do ppl ask then?

So whenever I come across a good candidate, I am like woooh!!!!

Labels: ,

Wednesday, February 15, 2012

MongoCSharp - Custom Serializer

As part of MongoDB Csharp driver is the custom serialization property, IbsonSerializable. The idea behind the use of this is to create a custom seralizer and deserializer to add and access documents. But as always the documentation is quite off and hard to find any information about this. Following is an example of using bson serializer:

Let’s say that we want to build a class that has a “LogDate” property of type DateTime but we want to save this property into MongoDB as “CreateDate” alias and of type System.Int64.



In the Serialize function, an anonymouse class is created where CreateDate is the new field Name and with value to be long (DateTime.Ticks). This anonymouse class is then converted into a BsonDocument and sent into the writer.

In the Deserialize function, the data from MongoDb is read from the reader and converted into a DemoClass object. CreateDate is read from the reader and converted into logDate format of DateTime.

Labels:

Tuesday, February 14, 2012

Mongodb - not so common basics

Basics of MongoDB:

* _id field is automatically indexed by MongoDB

* Maximum document size is 16MB

* Maximum size of a index field value is 800 bytes i.e. if a value who’s size/length is greater than 800bytes long, would be skipped from indexing. As an FYI, in SQL it’s 900 bytes.

* Searching against a non-indexed field is a no-no. This would be extremely slow and would require mongo to load all documents in memory to search. Note that MongoDB is fast as it tries to load maximum amount of data into memory.

* For a MongoDB to use Index the search key must be in order of text / beginning char of the index key

* A substring search of a Indexed field would not use the index. So a regex operation would be slow, since index’s wouldn’t be used.

* Index searches are case sensitive. Doing {/[value]/i} – non-case sensitive search would be slow

*MongoDB uses paged memory mapped.

*MongoDB creates index’s in background. Adding a new index’s though might take long (depending on size of collection) but also doesn’t cause Mongo to choke much. Be brave while adding new Index’s

* Use Explain command to get a quick overview of the query processing. Example:





* Remove one array item from a property, in one specific document:


- Remove all instances of a property, which happens to be an array, from all documents:


* MongoDB has a rest interface to monitor it’s status. It’s usually on 28017 port. - - rest is the command to enable rest interface.

* mongod is basically Mongo Daemon.

*MongoCSharp uses connection polling when using MongoServer.Create(). Do not programmatically disconnect the server as the open connection would be reused.

* When using MongoCursor, cursor.Count() can be used to get the total results when using limit and filter commands.

* For Windows users, MongoVUE is a pretty decent tool for visual interface.

* MongoDB monitoring is needed as like every other database. MMS (mongo monitoring service) is a good starting point. MMS is a free online agent provided by 10gen (MongoDB parent company)

* For a more speedier real time metrics interface, MongoLive chrome plugin is a good start.

Labels: