Monday, November 29, 2010

Learning UNIX - I

UNIX commands to Explore
xyx:/>pwd command. Show home directory on screen, PWD means print working directory.
/export/home/crk
is output for the command when used pwd in /export/home/crk directory.
________________________________________

xyx:/>mkdir command.
xyx:/>mkdir crk will create new directory, i.e. here crk directory is created.
________________________________________

xyx:/>cd command.
cd crk will change directory from current directory to crk directory.
________________________________________

xyx:/>cat command
cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
________________________________________

xyx:/>head command.
head filename by default will display the first 10 lines of a file. For first 50 lines you can use head -50 filename.
xyz:/> head -50 file1
________________________________________

xyx:/>tail command.
tail filename by default will display the last 10 lines of a file. For last 50 lines then you can use tail -50 filename.
________________________________________

xyx:/>more command. more command will display a page at a time and then wait for input which is spacebar. For example if you have a file which is 500 lines and you want to read it all. So you can use
more filename
________________________________________

xyx:/>wc command
wc command counts the characters, words or lines in a file depending upon the option.
Available Options
wc -l filename will print total number of lines in a file.
wc -w filename will print total number of words in a file.
wc -c filename will print total number of characters in a file.
________________________________________

xyx:/>man command. This is help command for looking any information about that command available,
man cp show cp command details with example and how you can use it.
man -k pattern command gives search for particular pattern with details.
________________________________________

xyx:/>banner command. For printing poster type ascii character, useful for making identifiable logins, any presentable output. Like below

xyx:/> banner crk

#### ##### # #
# # # # # #
# # # ####
# ##### # #
# # # # # #
#### # # # #

________________________________________

xyx:/>cal command. shows the calander on current month by default.
Witout options with cal command , will show current month calander, refer below example for more clarification

xyz:/>cal

November 2010
S M Tu W Th F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

N.B: if want to print calendar of 2nd Month of 2008
xyz> cal 2 2008
February 2008
S M Tu W Th F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29
________________________________________

xyx:/>ls command
ls command is most widely used command and it displays the contents of directory.
options
ls list all the files in your home directory.
ls -l list all the file names, permissions, group, in long format.
ls -a list all the files including hidden files that start with .
ls -lt list all files names based on the time of creation, newer first.
ls –Fx list files and directory names will be followed by slash.
ls -R lists all the files and files in the all the directories, recursively.
ls -R | more will list all the files and files in all the directories, one page at a time.
________________________________________

xyx:/>file Command displays about the contents of a given file, whether it is a text (Ascii) or binary file. To use it type
file filename. For example I have cal.txt which has ascii characters about calander of current month and I have resume1.doc file which is a binary file in MS word. Result would be as

file resume.doc
resume1.doc: data
file cal.txt
cal.txt: ascii text
________________________________________

xyx:/>cp command.
cp command copies a file. If I want to copy a file named oldfile in a current directory to a file named newfile in a current directory.

xyz:/>cp oldfile newfile

To copy oldfile to other directory in /tmp
xyz:/>cp oldfile /tmp/newfile.
Available Options are :
cp are -p and -r . -p options preserves the modification time and permissions,
-r recursively copy a directory and its files, duplicating the tree structure.
________________________________________

xyx:/>rcp command.
rcp command will copy files between two unix systems and works just like cp command (-p and -i options too).
Let us assume a unix system that is called unix1 and want to copy a file which is in current directory to a system that is called unix2 in /usr/om/ directory then you can use rcp command
rcp filename unix2:/usr/om
You will also need permissions between the two machines. For more infor type man rcp at command line.
________________________________________

xyx:/>mv command.
mv command is used to move a file from one directory to another directory or to rename a file.
Some examples:
mv oldfile newfile will rename oldfile to newfile.
mv -i oldfile newfile for confirmation prompt.
mv -f oldfile newfile will force the rename even if target file exists.
mv * /usr/om/ will move all the files in current directory to /usr/om directory.
________________________________________

xyx:/>ln command.
Instead of copying you can also make links to existing files using ln command.
If you want to create a link to a file called myfile in /usr/local/bin directory then you can enter this command.
ln myfile /usr/local/bin/myfile
Some examples:
ln -s fileone filetwo will create a symbolic link and can exist across machines.
ln -n option will not overwrite existing files.
ln -f will force the link to occur.
________________________________________

xyx:/>rm command.
To delete files use rm command.
Available Options:
rm oldfile will delete file named oldfile.
rm -f option will remove write-protected files without prompting.
rm -r option will delete the entire directory as well as all the subdirectories, very dangerous command.
________________________________________

xyx:/>rmdir command. Remove directory or directories if a directory is empty.
• rmdir om --> to remove om directory.
• rmdir -p --> to remove directories and any parent directories that are empty.

Wednesday, November 24, 2010

General Interview Questions

1) Tell me about yourself.
Ans: This is regular basic question asked in interviews. Try to brief about yourself as short as possible, do not describe the history of your family or town from where you are coming.
Present it in very simple manner which would give positive impression on other person. You can use the following:

- Your name (may include hometown details and parent's details)
- You education details (be short)
- Your employers, experience
- Your achivements, certifications

2) Tell me about some of the recent projects you have worked with?
Ans: Brief about recent projects (which are listed in Resume) you have worked on. Also is imperative that during your briefing, you demonstrate how you applied your skills and knowledge in the project.

3) Why are you leaving your current position?
Ans:Do not criticize your previous employer or coworkers or sound too opportunistic. It is fine to mention a major problem like a buy out, budget constraints, merger or liquidation.
You may also say that your chance to make a contribution is very low due to company wide changes or looking for a more challenging senior or designer role.

4) What do you like and/or dislike most about your current and/or last position?
Ans: The interviewer is trying to find the compatibility with the open position. So
Try Not to mention:
- You dislike overtime.
- You dislike management or coworkers etc.

You could use the following:
- You like challenges.
- Opportunity to grow into design, architecture, performance tuning etc.
- You dislike frustrating situations like identifying a memory leak problem or a complex transactional or a concurrency issue. You want to get on top of it as soon as possible.

5) What are your strengths and weaknesses?

Ans:
Strengths:
- Focus on Customer Staisfaction
- Taking initiatives and being pro-active: You can illustrate how you took initiative to fix a transactional issue,a performance problem or a memory leak problem.
- Team work and collabration, quick responsive
- Approachable for any issues
- Problem solving skills: Explain how you will break a complex problem into more manageable sub-sections and then apply brain storming and analytical skills to solve the complex problem.
- Open Communication: Always willing to listen to new ideas, or to adopt alternative approaches
- Communication skills: Illustrate that you can communicate effectively with all the team members, business analysts, users, testers, stake holders etc.
- Ability to work in a team environment as well as independently: Illustrate that you are technically sound to work independently as well as have the interpersonal skills to fit into any team environment.
- Hard working, honest, and conscientious etc are the adjectives to describe you.

Weaknesses:
Select a trait and come up with a solution to overcome your weakness. Stay away from personal qualities and concentrate more on professional traits for example:
- I pride myself on being an attention to detail guy but sometimes miss small details. So I am working on applying the 80/20 principle to manage time and details. Spend 80% of my effort and time on 20% of the tasks, which are critical and important to the task at hand.
- Some times when there is a technical issue or a problem I tend to work continuously until I fix it without having a break. But what I have noticed and am trying to practise is that taking a break away from the problem and thinking outside the square will assist you in identifying the root cause of the problem sooner.

6) Miscellaneous instructions:
- Try to find out the needs of the project in which you will be working and the needs of the people within the project. Try to get Business flow and basic architecture or request flow of recent project(s)
- Most of the interview questions are based on your own resume. So include only those things which you feel you can answer confident
- Where possible briefly demonstrate how you applied your skills/knowledge in the key areas and handled situations in your own way
- Always be honest to answer technical questions, you are not expected to remember or know everything in your area
- Do not be critical, focus on what you can do. Also try to be humorous to show your elegance
- Do not act superior or arrogant