Friday, October 31, 2008

Ruby on rails Interview questions

A few months I had been looking for interview questions to prepare myself for a switch. And all I could find were these from Ryan and these from a so called job interview questions website. 

But now when I was requested by a friend for some interview questions and I look for them I find some better results:  
 Puneet Pandey presents an exhaustive list of questions. Though you ll have to fight for the answers of a few of them. 
 Joe also has a nice variety. 
 And there is good list at RubyAssist
 Ben also has a good compilation of quality questions and Answers.  

And then of course here is the list of questions that i could remember of my own interviews… 

Basic
Q. Why ruby on rails? Why do you prefer RoR to other technologies like PHP, Python?
Q. What is Ruby on rails?
Q. What is scaffolding? What generates a scaffold?
Q. What is MVC? Does it score over n-tier? How?
Q. Do you use an IDE? Which?Why?

Specific Technical questions

Q. What in RoR is similiar to events in .NET. (Since I was familiar to .NET)
Ans. Callbacks (Read Active record callbacks)
Q. What is the difference between include and require?
Q. How is route/url mapping done in Rails? What files would you be changing?
Q. How can object oriented programming be implemented in ruby?
Q. What is rake? how does it help in migration?
Q. Tell us something about date and time support in rails?
Q. What is the base class of any class in ruby? Ans. Object
Q. How would you use a table to store a hierarchy? Ans. Acts_as_tree 
Q. What is the difference between “.save” and “save!” ?
Q. Tell me about some validation helpers in active record that you have used?
Q. What steps will you take to tune performance in a rails based app?
Q. How do you deploy a rails based app?
Q. Can you use third party tools in Rails app? How?

Some of the answers have been given right there. Some Answers can be found in my blog, especially for the questions in Basic category. And for more your effort to find them in the book should be worth it. And if you still need help on any let me know…. All the best for your interviews.  
Posted by Ujjwal Trivedi at 19:18:15 | Permalink | Comments (2)

Saturday, October 25, 2008

Include V/s Require in Ruby

With a switch in the company I had been a little distant from coding and with my new ideakosh and journal initiatives I almost forgot that this is a technical blog after all. Never mind its been great time, and I am all geared up to flex some brain muscles with Flex2.0. I know 3.0 is out but my client wants 2.0. But before that here is an answer to a question that i asked long back …. I asked it because people asked me in interviews.

Diff b/w include and require in Ruby?
Michael Morin (The ruby guide of About .com) has been generous to answer me thru email. Here is the answer:

——————————————————-
The include and require methods do very different things.  The require method does what include does in most other languages, run another file.  It also tracks what you’re required in the past and won’t require the same file twice.  To run another file without this added functionality, you can use the load method.
The include method takes all the methods from another module and includes them into the current module.  This is a language-level thing as opposed to a file-level thing with require.  The include method is the primary way to “extend” classes with other modules (usually referred to as mix-ins).  For example, if my class defines the method “each”, I can include the mixin module Enumerable and it can act as a collection.  This can be confusing as the include verb is used very differently in other languages.
——————————————————-

Thanks Micheal, I think thats an excellent answer.

Posted by Ujjwal Trivedi at 20:58:57 | Permalink | No Comments »

Friday, October 17, 2008

Creating a Brand of your Self - Part 2

[Also, "Plan B" for the Non-Creative People]
[Contd. from PART 1]
Here are generic steps on how you can begin to do “what you always wanted to do” and also see if u can make this work pay for your bills.

Theoretically…  
 
“Conceptualize it”: Have a creative idea? nurture it and make it big. It may be a painting, a new gadget, software tool or whatever. If your not sure about the ‘bigness’ of the idea just note it down somewhere so that your brain can happily process another one. Also, it gves you a chance to come back to this idea later.  

“Create it”: Implement your idea, create the final product, your creative masterpiece

“Convert it”: Apply an existing business model or evolve your own.

Practically …

Create your e-identity! Establish yourself on the world wide web. People will not come to YOU, they will come to your skills for help. You have to display and market your skills on the internet. Typically, if you want to become a creative entrepreneur, your prospective client should be able to find you in top ten google searches. But first things first here is a list of all that you need to do. :

Step 1. Create a weblog: 

 [For Creative people] 

Weblog is essentially the place where you keep all your creativity to display. Spit out your profile(informal resume), key strengths, learnings and creativity. It should essentially prove your worth with all your creativity, innovative ideas. One should provide solutions that fit in to innumerable problems that your prospective clientele should find useful. Dont worry about people making profit from your ideas initially. This altruism is a business strategy. The idea is to prove your name and creating that dependency on your ideas, leaving them yearning for more and eventually making them contact you and happily paying you for your talent. 

Now this is an ideal approach. Its not easy, if it at all sounds that way. But then there is no short cut to success and sometimes journey is more rewarding than destination. This is an instrument to help you display your work. So all you have to do really is “what you always wanted to do”. And then display it here. Many websites offer free blogging/Photo Uploads so you don’t have to spend any money initially. May be after a while you would like to invest some money to enjoy additional features.

 [For non-Creative people]

Well, God has gifted everyone with creativity. If you can create new beings, why cant you create some information that may be useful for the society. But lets say, you dont love to do anything, and still wanna be a part of the bandwagon. As I have iterated earlier, its not just to fulfil your creative self, it is also your plan B. Anyways if you think, you suck at any form of art or innovation. You may have to think a little about what do you do Best. Here are some approaches/examples for you: 

 + You can just put in your notes/understanding/findings on a complex topic so that people dont have to spend as much time as you did. 
 + If you like to criticize/condemn/complaint you can become a movie/technology/product/book critic and post reviews on popular websites that seek your review.
 +If you like to help people, join forums/communities like linkedIn/codeguru where you can answer people’s questions. 

Next post will discuss… 
How to dazzle the web, Create your network, Market your weblog and how to convert it?

[Continue to Part 3]

Posted by Ujjwal Trivedi at 21:17:40 | Permalink | No Comments »