Limit the number of objects being created in JAVA

Q   :- Limit the number of objects being created in JAVA.

Sol :- The example below limits creation of objects of MyClass class to a maximum of 5 by declaring the constructor private and calling it via getMyClass() method.If an attempt to create more than 5 objects is done, the getMyClass() method will return a null,thus,the object so created will not be referenced and ultimately cleared by the garbage collector.
 
import java.io.*;
class MyClass
{
public static int count=0;
int a;
private MyClass()
{
count++;
a=count;
System.out.println("object created  = "+a);
if(count>4)
System.out.println("Object Creation Limit Exceeded");
}
public static MyClass getMyClass()
{
if(MyClass.count==5)
return null;
else
return new MyClass();
}
}

class LimitObjectInstance
{
public static void main(String [] args)
{
int i=-1,ch;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); 
MyClass obj[]=new MyClass[10];
while(true)
{
System.out.println("\nDo you want to create new Object (1 for Yes ) ??   ");
try
{
ch=Integer.parseInt(br.readLine()) ;
}
catch(Exception e)
{
ch=2;
}
if(ch==1)
{
i++;
                   obj[i]= MyClass.getMyClass();
}
else
{
System.exit(0);
}
}
}
}

Limiting the number of objects created in JAVA

Q   :- How can you limit the number of objects created in java ?

Sol :- In the example below MyClass constructor has been used to limit the  number of objects that can be created to 2 by using a count which has been declared static(single copy for all objects of a class).If one tries to create more than 2 objects the constructor will throw an error. 

class LimitInstanceOfObject
{
public static void main(String [] args) throws Exception
{
MyClass obj1,obj2,obj3,obj4;
try
{
obj1=new MyClass();
obj2=new MyClass();
obj1.fun();
obj2.fun();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
try
{
obj3=new MyClass();
obj4=new MyClass();
obj3.fun();
obj4.fun();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}

class MyClass
{
public static int count=0;
public MyClass() throws Exception
{
if(MyClass.count==2)
throw new Exception("Object creation limit exceeded !");
else
count++;
System.out.println("count = "+count);
}
public void fun()
{
System.out.println("Lolzzzzzz");
}

}

Important Interview Questions with Answers

1) Tell me something about yourself?

I am a person with strong interpersonal skills and have the ability to get along well with people. I enjoy challenges and looking for creative solutions to problems.
OR
Besides the details given in my resume, I believe in character values, vision and action. I am quick in learning from mistakes. I am confident that the various tests that you have conducted will corroborate my competencies aptitude and right attitude for the job.

2) What do you seek from a job?

I would like a job which gives me a chance to apply all that I have learned in college as well as one which enables me to grow as a professional. I would like a role which enables me to make a difference.
OR
Great learning opportunities, challenging roles, rational career progression, good job satisfaction and opportunities to use my strength organization that gives me the opportunity to serve the organization and the society.

3) How would you present your strengths ?

Always remember “DO NOT SIMPLY STATE YOUR STRENGTHS. YOU DO HAVE SOME STRENGTHS AND TRY TO CONVERT YOUR STRENGTHS INTO BENEFITS. IN SHORT TRY TO ADVERTIZE YOURSELF BY CONVERTING YOUR FEATURES INTO STRENGTHS.”

You can answer in two ways : -

a) I am a hard worker and because of this ability I can work for additional hours to accomplish my tasks.

I am commitment oriented and hence I always enjoy the trust and confidence of my team mates which enables me to perform my duties very easily.

I am adaptable, so I can handle any type of people and situations and also bring out the best from them in spite of conflicting situations or opinions.

I am a quick learner, so I can any subject quickly and analyze my job and add value to it as well as I can identify the problem and solve them faster and better.

b) My strength is that I have very strong values and ethics and a very good eye for detail. I believe in strong relationships and have a very supportive family and very good friends.

4) Do you have any weakness?

Always remember – “Try to specify your weakness as your strength and also highlight it as a benefit.”
There’s a saying –

Quote:
“However small the thorn maybe it has the ability to pierce.”


So never highlight your weakness unless specifically asked.

Answer: One of my weaknesses as I perceive it would be occasional compromise on time for quality and perfection.


5) Where do you see yourself 5 years from now?

I see myself as a _______ in your esteemed organization where by with all my enhanced learning and skill, I shall be able to make up a valuable and meaningful contribution to your organization.

6) Tell us an incident where you had a problem with your team-mate. How did you handle it?

Once I had a problem with my team-mate in college who was my partner in my field work assignment. We had a disagreement on how to present our project report.
I explained my point of view to her and asked her for her view point. I’ve found that when conflict occurs, it’s because of a failure to see both sides of the situation. At that point we found a compromise could be reached by incorporating both our ideas.

7) Is there anything else that we should know about you that would impact our decision?

I am a continuous learner and try to keep myself abreast of all developments in the field of IT. Also since I do not quit in the face of toughest challenges, I am certain that I would be able to achieve the targets that I set for myself and beyond.

8) How do you deal with criticism?

“You can’t please everyone, so just please yourself. You are your best critic. Some people are just not going to like you. Accept it.”

9) Did you have any failures in your life?

I failed to score a good percentage in my intermediate. I worked hard for it but scored less than what I expected.

10) What have you learnt from your failures?

From my failures I have learnt to analyze myself and find out my shortcomings. Those shortcomings are the areas of future improvement for me and I have undertaken seriously to improve myself on those relevant areas. One more thing I learned is never to give up, never to feel rejected.

Quote:
“Accepting a failure is a man’s great trait.”


11) If after sometime you start disliking the job? What would you do?

Well, if such situation then my first priority would be to look within myself and try to find out any shortcomings or lack of skills and techniques. If such things happen then I would try to improve and rectify myself. Still if I don’t get an answer then I will speak to my seniors and colleagues to learn my mistakes so that I become more user friendly to my organization.

12) What are your salary expectations?

“Never bargain for your 1st job. It’s a cardinal rule.”

Sir, before answering to your question I would like to ask you with your kind permission what salary you provide to new entrants in your organization at this level.

13) Can you give three reasons why would you like to join our company?


Three reasons why I would like to join your company are:

a) Since your company provides a strong core competency, very strong value systems and best practices so I believe I have a strong vision of viewing me as a project leader in your company.

b) Your company has one of the fastest growth rates and turnover in the industry and that would mean a faster growth rate for me as a professional.

c) The practices of your company are more employee and customer oriented.

14) Do you have any questions to ask us?

Never ask Salary, perks, leave, place of posting, etc. regarded questions.
Try to ask more about the company to show how early you can make a contribution to your organization like
“Sir, with your kind permission I would like to know more about induction and developmental programs?”
OR
Sir, I would like to have my feedback, so that I can analyze and improve my strengths and rectify my shortcomings.

15) How do you think our company determines success in an employee?

Well, I think your company measures success in an employee in three parameters –

a) Competence i.e how well one is able to perform his job with the least possible supervision.

b) Co-operation or Interpersonal skills i.e how well the employees adapt or adjust themselves with a wide variety of situations.

c) Integrity of characters – well a man with the above mentioned factors but lacks character is incomplete and unsuccessful.

16) Why from ECE to IT domain?

Sir, since I am a student of ECE, as u know that ECE/CSE/IT are sister branches and all are interrelated and secondly I think it will be of my best if I utilize my sharp analytical skills in a software industry so I basically do not have any problem to “SWITCH” from ECE to IT. And I believe flexibility must be there within us to progress in life.

17) If you were an animal/ a can of soup/ some other random object which one would you prefer and why?

I would be a can of soup – one that has a variety of flavors, bubbling with enthusiasm. I would associate my determined attitude with the can’s tough exterior. I would believe that whatever the label on the can, the content are always a surprise.
OR
I would like to be the mind of the CEO – I would then know exactly how complex issues are so thoughtfully analyzed, how prioritizing happens and how accurate decisions which affect numerous stakeholders are made. I would know how almost intuitively, they know what the next big things are and their risk taking abilities.

18) Suppose I tell you I don’t like your face, then why should I select you?

Even if you do not like my face, you definitely would agree that I have other qualities that appealed you, for which you are now interviewing me. There’s a saying –

Quote:
“A man’s face is not indicative of his abilities.”

“A book is not judged by its cover but it is judged by its contents.”


19) Suppose you find yourself in a deserted island. What three things you will need to survive?

Food, Water and Hope (that one day I will definitely come out from this island).

20) How mobile are you?


I am absolutely mobile. Well I can go to any part of the country or even abroad if situation permits.

21) How do you think you conducted or performed during this interview?

I think I have conducted myself in the best possible manner by satisfying your queries through my specific answers which I feel were logical, systematic and to the point. Through my answer my true worth as a dynamic and competent professional has come out fair and square and I am happy with my performance which would ensure my selection in this esteemed organization.

22) Can you work under pressure? If yes, how please explain?

Sir, I can handle pressure of work. Let me explain how. Whenever there is pressure of work, we need to tackle it from the mental and physical stand-point. Mental stand-point would mean being in a state of relaxation and composure so that I do not feel stressed out during the course of my work and from physical stand-point; I always prioritize my job in their exact order of merit and importance so that I can dispose them off quickly and effectively.

For Intelligence Bureau (IB) ACIO Some Important Note..

IB ACIO stands for Intelligence Bureau Assistant Central Intelligence Officers. The ACIO Exam is conducted to recruit ACIO in the Intelligence Bureau which proudly claims to be one of the oldest intelligence agencies in the world.

There is uncertaintly over what exactly ACIO does in the Intelligence Bureau. His exact duties are not defined properly due to the seriousness of this job. As you may know that Intelligence Bureau is responsible for internal intelligence in the country. The job of IB is to collect information about terror organizations and maoists and forward it to relevant department.

To become a Assistant Central Intelligence Officer, each candidate is required to appear in a entrance exam. On passing this exam, you would get to work in prestigious organization like Intelligence Bureau. Here are the eligibility Criteria to appear in ACIO Exam.

Eligibility Criteria
~~ You should be Indian
~~ The maximum age limit for ACIO is 27 years.
~~ You need to have a graduation degree in any stream to appear in ACIO Exam.
~~ The upper age limit is extended by 3 years for Other Backward Class
~~ Age Limit is extended by 5 years for SC/ST candidates.

Exam Pattern
There are two sections of the ACIO Exam:-
1) Written Test
2) Interview

There are two papers in the written test.

Paper 1
~~ General Awareness
~~ General Knowledge
~~ English Language
~~ Reasoning
~~ Mathematical Aptitude

Paper 2
~~ Essay
~~ Precis Writing

Note: There is no negative marking in the ACIO Exam
Interview
        Those who will pass the written test would be called for Interview after which candidates will be selected for ACIO post in Intelligence Bureau.

Must Read... Worth Sharing....

A group of highly educated students visited their old university professor. Conversation soon turned into complaints about stress in work and life.
Offering them coffee, Professor returned from kitchen with a pot of coffee and an assortment of cups- porcelain, glass, crystal, some plain looking, some expensive, some exquisite - telling them to help themselves to hot coffee. When all had a cup of coffee in hand,
The professor said: "If U noticed, all the nice looking expensive cups were taken up, leaving behind the plain ones. While it's but normal for U to want only the best, that's also the source of Ur stress. What U really wanted was coffee, not the cup, But U still went for the best cups nd were eyeing each other's cups!" :)

"If life is coffee, Then jobs, money and status in society are the cups. They are just tools to hold and contain Life.
Don't let the cups drive U.."

Enjoy the coffee

Challenge – Equal Probability between 1 and 7

Question:
              Write a method to generate a random number between 1 and 7, given a method that generates a random number between 1 and 5. The distribution between each of the numbers must be uniform.

Answer:
              Let’s think of this like a decision tree. Each rand5() will be a decision. After 2 tries, we have 25 possible solutions. We try to get maximum bunches of 7 as we can (1 – 21, 3 sets of 7). If we get any of the other values, we just try again. Since the probability of getting each of 21 values are the same every time, trying again won’t affect their probabilities.

 
 
 
int rand7() {
    while (1) {
        int num = 5*(rand5()-1) + rand5();
        if (num < 22) return ((num % 7) + 1);
    }
}
That was fun, right? Anyone up for another challenge? Watch out for it next tuesday (March 1st).

Challenge – Find First Common Ancestor

Question:
               How would you find the first common ancestor of two nodes in a binary search tree? First as in the lowest in the tree. Another way to ask is to find the lowest common ancestor of two nodes.

 Meanwhile, check out the challenges from previous weeks here

Answer:
TreeNode findFirstCommonAncestor(TreeNode root, TreeNode p,
 TreeNode q) {

    if (root == null) {
        return null;
    }

    if (root == p || root == q) {
 return root;
    }

    TreeNode left = findFirstCommonAncestor(root.left, p, q);
    TreeNode right = findFirstCommonAncestor(root.right, p, q);

    if ((left == p && right == q) ||
        (left == q && right == q)) {
 return root;
    }

    return (left != null) ? left : right;
} 

Alternate:

TreeNode findFirstCommonAncestor(TreeNode root, int p, int q) {

    if (root == null) {
        return null;
    }

    if (root.value == p || root.value == q) {
 return root;
    }

    if (root.value > p && root.value > q ) {
        return findFirstCommonAncestor(root.left, p, q);
    }
    else if (root.value < p && root.value < q ) {
        return findFirstCommonAncestor(root.right, p, q);
    }
    else {
        return root;
    }
}

Challenge – 50 trucks with payload

Question:
               Given a fleet of 50 trucks, each with a full fuel tank and a range of 100 miles, how far can you deliver a payload? You can transfer the payload from truck to truck, and you can transfer fuel from truck to truck. Assume all the payload will fit in one truck.

 Meanwhile, check out the challenges from previous weeks here

Answer :
              We want to use as little fuel as possible so we try minimize the number of trucks we use as we go along. Let’s say we start with all 50 trucks with full fuel (5000 miles range). For each mile, we lose 50 miles in range. After two miles, we lose 100 miles leaving us with 4900 miles. This can be supported by 49 trucks so we drop one truck.
As you can see for every 100 miles we lose in range, we drop a truck.
50 trucks: 100/50
49 trucks: 100/49

Total distance = 100/50 + 100/49 + 100/48 + … + 100/2 + 100/1 (harmonic series) = 449.920533833

how to maintain session in asp 3.5 with c#

There are different ways. You can use form authentication , it's a way to do that.

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="Login.aspx"
           protection="All"
           timeout="30"
           name=".ASPXAUTH" 
           path="/"
           requireSSL="false"
           slidingExpiration="true"
           defaultUrl="default.aspx"
           cookieless="UseDeviceProfile"
           enableCrossAppRedirects="false" />
  </authentication>

<authorization>  
    <allow users="admin" />
    <deny users="*" />
</authorization>
</system.web>
private void btnLogin_Click(object sender, System.EventArgs e)
{
 if (Validate(txtUsername.Text, txtPassword.Text))
 {
  FormsAuthentication.Initialize();
  String strRole = txtUsername.Text;  
  FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, 
   txtUsername.Text, DateTime.Now, 
   DateTime.Now.AddMinutes(30), false, strRole, 
   FormsAuthentication.FormsCookiePath);
  Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, 
   FormsAuthentication.Encrypt(fat)));
  Response.Redirect(FormsAuthentication.GetRedirectUrl(txtUsername.Text, false));
 }
 else
  lblError.Visible = true;
}

private Boolean Validate(String strUsername, String strPassword)
{
    return ((strUsername == "admin") && (strPassword == "password"));
}
 


In logout page you can use the following code

private void Page_Load(object sender, System.EventArgs e)
{
 Session.Abandon();
 FormsAuthentication.SignOut();
}


remeber this kind of authentication works only user enables cookies

What are the career opportunities available for MCA, Engineering Graduates?

Now that we live in the age of information technology, there is a world of opportunities waiting for MCA graduates like you. Although understandably, you might be apprehensive about your future considering that workforce competition can be quite stiff, you need not worry as long as you plan your career ahead of time.
You need not be scared of not being able to find a job. I’m here to help you. I suggest that you take a moment to learn some helpful tips and insights outlined in this section so that you will not have any problems in finding your dream job.

Career Options for MCA Graduates

As an MCA graduate, you possess excellent computer skills and the ability to develop or create computer applications, understand and utilize various computer languages, as well as provide maintenance and repair to different types of applications, among others. With these technical skills, you would surely find employment in the following positions:
  • Software engineer
  • Software developer or programmer
  • Project manager
  • Web applications developer
  • Web designer
  • Computer application consultant
These jobs are considered high-paying jobs that could help you earn somewhere between $30,000 and $75,000 per annum, depending on your years of experience and skill level.
A computer programmer with a degree in MCA who has been working for 10 years could earn as much as $72,000 annually in the United States, whereas an entry-level MCA graduate who has just been recently employed would probably start earning around $30,000 per year.

How to Increase Your Chances of Getting Hired

Job applicants with an educational background in the IT field are very much in demand. However, you must also keep in mind that there are many people just like you, who are also armed with a degree in MCA, Computer Science, and IT, among others. If you want to find employment, you need to do the following:
  • Make sure you apply for the job that you really want. Career planning is very important so before you even start looking for a job, you need to decide on what kind of job you want to apply for based on your skills and interest.
  • You need to create an impressive resume. You must make sure that your resume will showcase your skills, talents, and achievements to convince potential employers that you are good candidate for the job.
  • Prepare for your job interview. Preparation and planning are important. Think and prepare for the possible questions that will be asked during the interview, and practice answering them on your own.
  • Be confident during the interview. You must prove to your interviewer that you are the right candidate for the job, so when giving answers, speak confidently and clearly.
Now that you know what jobs you can apply for as an MCA graduate, make sure to follow the tips provided above so that you can be on your way to building a solid career. Good luck

Some Question and answers

1. Using the digits 1,5,2,8 four digit numbers are formed and the sum of all possible such numbers.
ans:106656

2. Four persons can cross a bridge in 3,7,13,17 minutes. Only two can cross at a time. find the minimum time taken by the four to cross the bridge.
ans:20

3. Find the product of the prime numbers between 1-20
ans.9699690

4. 2,3,6,7--- using these numbers form the possible four digit numbers that are divisible by 4.
ans.8

5. Two trains are traveling at 18kmph and are 60 km apart. There is fly in the train. it flies at 80kmph. It flies and hits the second train and then it starts to oscillate between the two trains. At one instance when the two trains collide it dies. Distance traveled by the fly when both trains collide is Ans.---12km

6. there are 1000 doors that are of the open-close type. When a person opens the door he closes it and then opens the other. When the first person goes he opens-closes the doors ion the multiples of 1 i.e., he opens and closes all the doors. when the second goes he opens and closes the doors 2, 4 6 8 respectively. Similarly when the third one goes he does this for 3 6 9 1 2 15th doors resly. Find number of doors that are open at last.
Ans: square numbers

7.There are 9 balls of this one is defective. Find the minimum no. of chances of finding the defective one.
Ans: 3times

8. There are coins of Rs.5, 2,1,50p,25p,10p,5p. Each one has got a weight. Rs 5 coin weighs 20gms.find the minimum number of coins to get a total of 196.5gms.

9.A can do a work in 8 days, B can do a work in 7 days, C can do a work in 6 days. A works on the first day, B works on the second day and C on the third day resly.that is they work on alternate days. When will they finish the work. which day will they finish the work.
Ans: 7 7/168 days

10.A batsman scores 23 runs and increases his average from 15 to 16. find the runs to be made if he wants top inc the avg to 18 in the same match.
Ans: 39runs.

11.A man sells apples. First he gives half of the total apples what he has and a half apple. Then he gives half of the remaining and a half apple. He gives it in the same manner. After 7 times all are over. How many apples did he initially have.
Ans: 127 apples.

12.In a club there are male and female members. If 15 female quit then the number of females will become double the number of males. If 45 males quit no. of female becomes five times the number of males. Find the number of females.
Ans: females:175,males:80

13.When I was married 10 years back my wife was the sixth member of my family. Now I have a baby. Today my father was dead and I had a new baby. now the average age of my family is the same as that when I was married. Find the age of my father when I was married.
ans:50

14.I and two of my friends were playing a game. For each win I get Rs 3. totally I had three wins. Player 2 got Rs9 and player 3 got Rs 12. how many games had been played.

15.A person gives a secret to two other persons in 5 minutes. How long will he take to tell the secret to 768 people.

16.There are 40 seats in a bus. People agree to share the money for the number of seats. The total money comes to 70.37. how many seats were free.
Ans. 9 seats.Rs.2.27

17.I had Rs100 and I play. If I win I will have Rs110 and if I lose I will have Rs90. at the end I have 2 wins and 2 loses. How much do I have.

18.There were sums related to diagrams. They asked to calculate the areas of the circle, rectangle that were enclosed in other objects. They were simple.

19. In a village, there is flood. In one village causalities were less than the other. Why?
Ans : There were better health care centres(HCC).

20. A question on Pythagoras Theorem.
Ans. 20

21. The distance between Mumbai & Calcutta is 25000 Km. Train goes from Mumbai to Calcutta for which Speed & Time are given. From C->M Speed alone is give. Of the above conditions which is not required. (Not Complete)

Ans: The distance 25,000Km is not required. Because, Speed * Time = Distance. So only two conditions are required.

22. m < n & x>y Which is false?
Ans: x-m < y-n

23. A person has Rs.100. If he wins he gains 10%. If he loses the game, he loses 10%. He wins twice and loses twice. How much he has at the end?
Ans: Always less than 100.

24. Area of Shaded portion is ?
Ans : 115.5

25. In A tribal group two groups live in different climatic conditions. Ear Sensitivity is tested and found that one has more when compared to other. What is the reason.
Ans. Depends on the physical place and condition he is living.

e-Admit Card for Combined Defence Services Examination (II) 2012

For Downloading of e-Admit Card for Combined Defence Services Examination (II) 2012, please Click Here

PRESS NOTE 

            The Union Public Service Commission will be conducting the Combined Defence Services Examination (II), 2012 on 16th September, 2012 (Sunday) at 41 Centers all over India as per notification dated 2nd June, 2012.  The Commission has introduced the facility of generating e-Admit Card for this Examination for convenience of candidates. Rejection Letters citing the ground (s) for rejection have been dispatched and also put on the Union Public Service Commission Website http://www.upsc.gov.in  .  In case of any difficulty faced by the candidates for downloading e-Admit Card, they may contact the UPSC Facilitation Counter on Telephone Nos. 011-23385271, 011-23381125 and 011-23098543 on any working day between 10.00 AM and 5.00 PM.  The candidates can also send Fax message on Fax No. 011-23387310.  No paper Admission Certificate will be sent by post.
                In case the photograph is not printed clear on the e-Admit Card candidates are advised to carry three (3) photographs (one identical photograph for each session) alongwith proof of identity such as identity Card or Voter Identity Card or Passport or Driving License and printout of e-Admit Card at the venue of the Examination.

Implementing Queue Using Stack

Question: How would you use stacks to implement a queue?
Answer: So how could we go about doing this? What if we used two stacks and used one as the incoming stack and the other as the outgoing stack? A queue is a FIFO structure, so when we enqueue something, we need to make sure that it does not get popped off before something that was already there. Similarly, when we dequeue something, we have to make sure that elements that were inserted earlier get ejected first.

What’s better than some code!
 
Stack in;
Stack out;
void enqueue( int value ) {
    while( !out.isEmpty() ) {
        in.push( out.pop() );
    }
    in.push( value );
}

int dequeue() {
    while( !in.isEmpty() ) {
        out.push( in.pop() );
    }
    return out.pop();
}

Isn’t that cool? Help share this on Facebook and Twitter!

Answer- to Camel and Bananas Challenge

Thanks for all the responses. Quite a few of you have the right answer.

The Question was: The owner of a banana plantation has a camel. He wants to transport his 3000 bananas to the market, which is located after the desert. The distance between his banana plantation and the market is about 1000 kilometer. So he decided to take his camel to carry the bananas. The camel can carry at the maximum of 1000 bananas at a time, and it eats one banana for every kilometer it travels.
What is the largest number of bananas that can be delivered to the market?

And the here is the Answer: At KM#0, we have 3000 bananas. The maximum bananas the camel can carry is 1000 so the camel must at least make 3 trips from the start point. (Leave #0, Return to #0, Leave #0, Return to #0, Leave #0).
If we move just 1km, we need 1 banana for each step mentioned above thus making a total of 5 bananas for each km.
We continue making 3 trips until we reach a banana count of 2000.
3000 – 5*d = 2000 => d = 200
At #200km, we will have 2000 bananas
At this point, we only need to make 2 trips (Leave #200, Return to #200, Leave #200). This will cost 1 banana for each step thus making a total of 3 bananas for each km.
We continue making 2 trips until we reach a banana count of 1000.
2000 – 3*d = 1000 => d = 333km
At#(200+333) = #534km, we will have 998 bananas
At this point, we need to make one trip so the camel just carries everything and marches toward the market.
Remaining km = 1000 – 534 = 466km. Bananas needed = 466.
Therefore, the bananas remaining once the camel reaches the market is 998 – 466 = 532 bananas. :)
Check out the challenges from previous weeks here.

Challenge – Camel and Bananas Comment your Answer

Question: The owner of a banana plantation has a camel. He wants to transport his 3000 bananas to the market, which is located after the desert. The distance between his banana plantation and the market is about 1000 kilometer. So he decided to take his camel to carry the bananas. The camel can carry at the maximum of 1000 bananas at a time, and it eats one banana for every kilometer it travels.
What is the largest number of bananas that can be delivered to the market?

Challenge: Do you know the answer to this question? Post in the comments.
The Answer will be posted on 10th Sept
 
You Can see the Answer for this Challenge Here After Scheduled Date

Puzzle and Interview Questions 2 - 08 sep 2012

Question:  Count the number of Cubes

 
 

Press Button to See the Answer

CTS- Cognizant Technology Solution Selection Procedure

CTS Selection Procedure consists of following 3 rounds
1. PPT.
2. Aptitude Test.
3. HR and Technical.
PPT-30 -40 minutes
1Written Test
No of questions : 55
Time limit : 60 minutes
No negative mark
Sectional cut off


In written test consists two section

Section -1- Analytical Ability (30 Ques in 30 mints)
For analytical :
For analytical (Areas to concentrate)
1. Puzzles (4Ques)
2. Figure-Odd-1 (1ques)
3. Syllogism ( including 2 statements which are mostly asked)....(2 Ques)
4. Coding decoding(4Ques)
5. Logical connectives
6. Data sufficiency
7. Data interpretation (2)
8  Pie chart and table
8. Statement-Conclusion.
9. Blood relation.
10. Cube and dice.
11. Statement inference (true or false like)......(2 Ques)
12. Figure Sequence(4Ques)
13. Puzzles
Practice Tests for Quantitative Aptitude
Tips and Tricks to learn Quantitative Aptitude
For verbal:
1. Error in sentences.(10Ques)
2. Rearrange.
3. Passage.(2 Big Passage)(10Questions)
4. Jumble Sentence

Verbal section seems to be little tough as u find no time to complete it.....But good practice makes your  way.... The verbal section was most difficult.

Also in the answer sheet there was one question-"What qualities should a software professional have and how do you fulfill them?"

TIPS 
- practice doing lots of online tests so that u can improve your speed.
CTS Mock on on line Practice Tests
Next you will be called for a technical interview. The interview is not so difficult if your technical is good. They ask very basic technical questions, and you will clear it very easily if
your basic concepts are clear.

Questions on C, JAVA, Data Structures, DBMS, Software Engg-SQL query Data structures, networks, C (he also asked me to write a small program).

Answer confidently and clearly say if you don't know the answer.

Before appearing personal interview go thorough the company profile, CEO, CFO, current employees no, founder's name and year etc.,

Go through the C.V properly, your CV should be small and compact with all correct information, before going to PI dont forget to take ORIGINAL MARKSHEET, COLLEGE ID, Passport size photos

If you clear you will be called for HR interview. The interview is very easy but you should prepare for some typical questions like.
1. Tell me about yourself ?
2. What's your short and long term goal ?
3. Why do you want to join our company ?
4. Why I hire you and why i don't hire you ?
5. What will you do if you are not selected ?
6. Do you have any question ?
7. Your strengths and weakness ?
8. Expectations from Cognizant ?
9. As u an IT student, what are the most interesting changes/inventions have been take place in last 5 years
10. which is your preferable language
11. what are the properties of oops
12. What is polymorphism?
13. 2NF with an example
14. Write a program in C to find factorial of a number.
15. Explain method overloading and overwriting with example.

Cognizant Company Profile and it's information for Interview


Website: www.cognizant.com
HQ Teaneck, NJ
Industry Information Technology Services
Size 130K+ Employees, $6B+ Revenue
NASDAQ CTSH
Competitors Infosys, Wipro, Tata Consultancy Services
 

About cognizant
Cognizant Corporate view:
Cognizant is an American multinational IT services and consulting corporation headquartered in Teaneck, New Jersey, United States.
Cognizant has been named to the 2010 Fortune 100 Fastest-Growing Companies List for the eighth consecutive year. Cognizant has also been named to the Fortune 1000 and Forbes Global 2000 lists. It has consistently ranked among the fastest growing companies including the 2010 Business Week 50 list of the top-performing U.S. companies, the Business Week Hottest Tech Companies 2010, and the Forbes Fast Tech 2010 list of 25 Fastest Growing Technology Companies In America.
Founded: 1994
Headquarters: Teaneck, New Jersey, U.S.


Key people: 
Francisco D'Souza (President & CEO)
Lakshmi Narayanan (Vice Chairman)
Chandra Sekaran (President & MD, Global Delivery)
Gordon Coburn (EVP, CFO & COO)

India location: Chennai, Bangalore, Hyderabad, Kolkata, Mumbai, Pune, Gurgaon, Coimbatore, Cochin

We help transform core processes for greater flexibility, higher efficiency and lower costs.
Our unique onsite/offshore global delivery model is guided by dedication to client satisfaction.

With a Two-in-a-Box™ client engagement model, you’re assured the onsite attention of a Client Manager, experienced in your industry, working on site with you. Paired with the Client Manager is a dedicated Delivery Manager, who may be located at any of our global, nearshore or local delivery centers. One team is assigned to work on your project from start to finish, becoming an extension of your staff.

Organized by vertical industry as well as service line, we know the particulars of your business and deliver solutions with the precision you require.

Our more than 805 clients span five continents and every major industry. With an advanced global delivery platform, Cognizant 2.0 (C2), we can share knowledge and efficiently manage projects across our global delivery network. It allows us to provide you with the most cost-effective and comprehensive, end-to-end, advanced solutions.

When required, we can access the specialized skills of our deep talent pool from anywhere in the world, to solve any problem, through C2. Enhanced project collaboration tools and our well-codified, company-wide processes assure consistent, well-planned, measurable and reliable delivery from any and all locations.

Let us use our IT, business-process and strategic consulting to help you transform your business, with minimal risk and disruption. Give your organization greater flexibility, higher efficiency and lower costs. Position your business to thrive now and in the future.
Corporate Social Responsibility

As Cognizant has grown and changed over the years, one thing has remained constant: social responsibility as one of our top business priorities. And we continue to focus on making a positive environmental, social and economic impact, every day, in all our facilities around the globe.
Simply put, sustainability is good business, and vital to our marketplace success. At Cognizant, our internal performance and client satisfaction depend on how we:

Provide what's best for people and the environment.
Conduct our business, employing the highest standards of personal and corporate conduct.
Serve and satisfy our customers, thus shaping our ability to sustain our own future.

Building on our company's principles of integrity, service and expertise, our sustainability efforts provide a framework for pursuing the challenges and opportunities that responsible business practices create. It also helps our performance meet global targets, by guiding how we measure and evaluate the impact of all we do.
Culture & History
Our business culture reflects the fact that we were “born global” as a unit of U.S.-based Dun & Bradstreet with operations based in India.
As a result, we’ve always been multicultural, which has eased our expansion in more and more markets around the world.
Many of our senior managers have extensive international business experience and educational backgrounds. In fact, our CEO was born in Kenya, educated in Asia and the U.S., and has lived throughout the world.
U.S. corporate citizen — a “local” around the world

Although headquartered in the U.S., we continue to enjoy high standing as “local” player and an employer of choice with a strong reputation for excellence in India. As a testament, we consistently garner top recruitment honors at the leading institutes of Technology and Business Management there.

Website: http://www.cognizant.com
Work Culture:
They are the only international services provider with a business model structured both vertically and horizontally. That is, vertically with expertise in almost every major industry segment, as well as horizontally, across a full complement of integrated solutions and services. In fact, many of their senior people originate from the industries in which they work.
At Cognizant culture is an enabling one. It emphasizes empowerment of the individual to make decisions in the best interests of the client. Importantly, it also rewards personal achievement and contribution, financially and through public recognition.

Entry level Recruitment:
Do you have the passion to make a difference, the passion to build stronger businesses for organizations around the world? Cognizant offers career opportunities that are as dynamic as the marketplace. You'll experience a series of engaging assignments and challenging projects, and work in a fast-paced environment. It's your chance to be a part of a vibrant business community.
Training for freshers:
Designed for campus trainees, this 14-week program trains and prepares college recruits to face real time work at projects. The central focus there is to help the transition of associates to a corporate environment, equipping them with the requisite skill and expertise. Through a constant and conscious intervention process, ELTP has made constant and wholesome changes to the style of imparting training. They revisit the program once in a while to reflect the rapidly changing needs of the software industry.
About the Recruitment test:
The selection process consists of 3 rounds.
1)     Written test
2)     Technical round
3)     HR round
How to prepare:
Read more on CTS preparation.
In India office addresses:
 
Chennai
Enfil Premraj Jeyaraj
Address: 5/535, Old Mahabalipuram Road
Okkiam Thoraipakkam, Chennai - 600 097
Bangalore
Rohit Eustachius
Address: 45 Golf View Campus, Wind Tunnel Road,
Murugesh Palya, Bangalore - 560017.
Kolkata
Nilangshu Ghosal
Address: Plot- Gn 34/3,
Sector -V, Salt Lake Electronic Complex, Kolkata - 700091
Pune
Vikas Kanwar
Address: Plot No. 26/27 ,
Rajiv Gandhi Infotech Park, Midc, Hinjewadi Pune - 411057
Hyderabad
Rohit Eustachius
Address: Vanenburg IT Park
17, Software Units Layout, Madhapur, Hyderabad - 500081
Coimbatore
Rashmi Rajan
Address: Mountain View Campus STPI - IT Park 
Kumaraguru College Of Technology Campus 
Coimbatore - 641006

Placement Review for Credit Suisse 2012 – pattern | Interviews | Tests

Hey let me declare, that this post is not by me it's a review from a friend who attended the Credit Suisse Campus :) 
Description: CREDIT SUISSE
Apti:
It consisted of 8 puzzles and 8 algoritms/pseudocodes.
For puzzles refer to ‘how to ace the brain teaser’. For algorithms refer ‘cracking the coding interview’ and be familiar with questions asked in carrer cup site.There was one DB qstn too. We were asked to design a schema and normalize it.
Interview 1: Complete tech.
There were 2 bonus questions in the apti to design a client server architecture. I hadn’t solved it in apti so i was asked to explain it.
I was asked about my BE project, how i will implement it and explain the algorithms i will be using etc.
Thwn he asked me a simple puzzle.that chicken,corn and fox wala.
I was asked my fav subject, to which i said database. Then i was asked indexing, structures used, RAID levels. I was asked to design a database schema and write simple queries on it.
Then i was asked to explain OOPs concepts and write a code to explain virtual functions.
Then he moved to memory management in java.(that heap and stack concept)
Interview2: tech again!!
I was asked to write a code of bubble sort, modified bubble sort, quick sort and all their complexities.
Then he asked me solve puzzles which i hadn’t in the apti and also the second bonus question. Also some more puzzles. Then came OOAD concepts: is-a relation and all. He had given me 3-4 classes and asked me to relate all of them. Then database recovery concepts again. One of the puzzle was whats the shortest distance for an ant from one corner of a room to opposite corner.i said its the diagonal bt ants don’t fly! So he said ki ants cant fly bt u can do nething with the room. I answered ki break the ceiling from one end and make it as a slope 4 the ant to climb. He said yes bt wanted more ways which i didn’t get. Thats was it.
Interview 3: management
It was a normal HR interview. I was asked about the test and how i think i had performed (i knew it coz interviewer in 2nd round had already told me my mks :p) etc. Then again abt my projects and i was given 1 min to sell my proj to him(where i performed badly :p). Then he gave me some situations and asked how i wud react to it n all.
Interview4: HR again bt a stress interview
Here too there were basic qstns abt me.bt he jst didn’t agree to any of my ans abt y credit Suisse n all..as ita a stress interview, just be firm with what u have said and yaa..keep smiling whatever he does to irritate u and be frank. No diplomatic ans allowed here :p And yaa..jst research abt the company and basic finance stuff..it will help.thats it..:D

Difficult interview questions about management Skills

12 difficult interview questions about management

I. Contents of difficult interview questions


Questions below will help you interview candidates about their management skill at difficult level.

II. Difficult interview questions of management skill

1. What do you look for when you hire people?
2. Tell me about a time when you had to deal with a co-worker who wasn’t doing his/her fair share of the work. What did you do and what was the outcome?
3. Are you a good manager? Can you give me some examples? Do you feel that you have top managerial potential?
4. Give me an example of a time when you took the time to share a co-worker’s or supervisor’s achievements with others?
5. Tell me about a time that you misjudged a person?
6. How do you get along with older (younger) co-workers?
7. What is your management style?
8. How do you deal with authority?
9. What qualities do you feel a successful manager should have?
10. What is your biggest strength as a manager?
11. How to do measure your own effectiveness?
12. Have you worked with someone you didn’t like? If so, how did you handle it?

Difficult interview questions

9 difficult interview questions about new job.

I. Contents of difficult interview questions


Questions below will help you interview candidates about their new job at difficult level.

II. Difficult interview questions of new job

1. How long would it take you to make a meaningful contribution to our firm?
2. How long would you stay with us?
3. Please give me your definition of the position for which you are being interviewed?
4. What important trends do you see in our industry?
5. Why do you want to work for us?
6. What do you know about our organization?
7. Why do you want to work here?
8. How would you evaluate your present firm?
9. Do you have any questions?

Stress interview questions

It include 27 stress questions as follows:

1. Direct stress questions


• Do you consider standing in a line as stressed work?
• Define stress and when do you get stressed out?
• Are you able to work under stress?
• Please give us an example about you work with a team that faced stress from your experience?
• Why do you think it will conduce stress?
• What is the worst thing when you faced with stress?
• Which transaction is not good for your colleagues whom also faced the stress at the same time?
• How do you handle stress? What is the best thin or work you do when you are stressed out?

2. Stress questions by conflict

• Okay, if that’s the best answer you can give me. Then what about this question…?
• I don’t really feel like your answering the question. Could you please clarify / could you please start again?”

3. Stress questions Pressure

• How do you handle rejection?
• What is the worst thing that you have heard about our company?

4. Other stress questions

• Why are manhole covers round?
• Why did you switch to political science? Is it because you couldn’t handle engineering? Why did you do so poorly on this test?
• What kinds of people do you find it difficult to work with?
• What are some of the things that you find difficult to do?
• How would you evaluate me as an interviewer?
• What interests you least about this job?
• See this pen I’m holding? Sell it to me.
• You need to work a full whole one month because of quarter results nearby what reason will you give to exempt from the work?
• If you are a leader of the team, what could you do better than the truly leader?
• What do you think that you have learned from it?
• Would you like to have your boss’s job?
• Why should I hire an outsider when I could fill the job with someone inside the company?
• Why were you out of work for so long?
• If you caught a student cheating on their test, what would you do?
• How do you feel this interview is going?

Categories

10th 3i InfoTech Academic Books Accenture ACIO ActiveX ADT Agricultural AIEEE Air Force Algebraic Amdocs Android Answers Application Development Aptitude Aptitude Questions Architectures ASP ATOS B.Sc B.Tech.B.E. Bank Exam BCA BE Board Exam Books break-continue Business Plan C C Programming C# C++ Campus campus interview Candidate profile Capgemini Career CDS Certification CET Challenge Circle Cisco class code Cognizant communication Company Company Profile Competitive Exams computer Computer Networks concentric circles constructor Course Credit Suisse CSS CTS Data Structure DBMS DC Deloitte difficult interview questions dimensions Distributed Computing do while dotNet Download ds Dynamic Web Development e-Admit card Educational engineering entertainment Even Odd Events exam schedule exception for loop fresher GATE general Discussion general knowledge Get Placed Government Job Hall Ticket HCL how to answer How to Prepare HR HR Interview HSC hypertext preprocessor IB IBM IBPS IIT Indian Army Information infosys Intelligence Bureau Internship interview Experience interview questions Interview Tips IntroC IntroC# IntroJava IntroPHP IT J2EE J2ME Java JavaScript jobs Language Books Language Tutorial Languages limit number of objectsJava Limit the number of objects being created in JAVA Linux Linux Administrator Linux Developer Logical Questions loops M Tech M.E. M.Tech M.Tech AND B.Tech Management Management Skills Matrices MBA mca ME microsoft mistakes Mixture Mobile Computing mock questions mock test MySql naukri NDA OOP opening Operating System Oracle paper Persistent PHP php programming php string variables PL/SQL Placement placement guide Placement Paper Placement Process preparing for placement presentation probability Problems Professional program Programming Project Engineer project idea Projects Puzzle qualities Question of the day Questions Quiz Question Recruitment Recruitment Pattern Requirement Result Resume Reviews Screen Sizes Scripting Session Skills Software Software Engineering solved papers Source Code Speed time and distance SQL SSC story Stress Interview Study Material study tips submit resume Synonym TCS Tech Mahindra tech news Technical Books Technical Interview Testing thank you letter Thought Time Table TutC++ Unix questions asked in aptitude and inteviews for MCA UPSC verbal Web Designing Web Developer Website Development What to read while loop Wipro Writing Resume

Receive Quality Tutorials Straight in your Inbox by submitting your Email ID below.