zimslifeintcs.files.wordpress.com€¦  · web viewphrase of the word. ... this helps in...

29
TCS ASPIRE : Know your TCS quiz answers 2012 # Question 1 of 10 10.0 Points When and where was TCS founded? A. 1968, Mumbai B. 1954, Mumbai C. 1968, Jamshedpur D. 1954, Coimbatore Answer Key: A # Question 2 of 10 10.0 Points To how many industries does TCS provides its consultancy? A. 12 B. 10 C. 20 D. 15 Answer Key: A # Question 3 of 10 10.0 Points What are the values of TCS? A. Leading Change, Integrity, Responsibility, Excellence, Learning and propelling B. Leading innovation, Integrity, Respect for the colleagues, Excellence, Mentoring and Sharing C. Leading innovation, Integrity, Courteous, Certainty, Learning and Sharing Correct D. Leading Change, Integrity, Respect for individual, Excellence, Learning and Sharing Answer Key: D # Question 4 of 10 10.0 Points What is the name of the first research center established by TCS? A. Tata Institute of Social Sciences (TISS) B. Tata Research Development and Design Center (TRDDC) C. Tata Institute of Fundamental Research (TIFR) D. Indian Institute of Science (IISc) Answer Key: B

Upload: others

Post on 09-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

TCS ASPIRE : Know your TCS quiz answers 2012

# Question 1 of 10 10.0 PointsWhen and where was TCS founded?A. 1968, Mumbai B. 1954, Mumbai C. 1968, Jamshedpur D. 1954, Coimbatore 

Answer Key: A

# Question 2 of 10 10.0 PointsTo how many industries does TCS provides its consultancy?A. 12 B. 10 C. 20 D. 15 

Answer Key: A

# Question 3 of 10 10.0 PointsWhat are the values of TCS?A. Leading Change, Integrity, Responsibility, Excellence, Learning and propelling B. Leading innovation, Integrity, Respect for the colleagues, Excellence, Mentoring and Sharing C. Leading innovation, Integrity, Courteous, Certainty, Learning and Sharing Correct D. Leading Change, Integrity, Respect for individual, Excellence, Learning and Sharing 

Answer Key: D

# Question 4 of 10 10.0 PointsWhat is the name of the first research center established by TCS?A. Tata Institute of Social Sciences (TISS) B. Tata Research Development and Design Center (TRDDC)C. Tata Institute of Fundamental Research (TIFR) D. Indian Institute of Science (IISc) 

Answer Key: B

# Question 5 of 10 10.0 PointsWhat was TCS’s first onsite project?A. Automating Johannesburg Stock ExchangeB. Burroughs (the first business computer manufacturer)C. Developing electronic depository, SECOM for SIS SegaInterSettle, Switzerland D. Institutional Group and Information Company (IGIC) 

Answer Key: D

Page 2: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 6 of 10 10.0 PointsTCS is ….. largest IT firm in the world?A. 8th B. 2nd C. 4th D. 6th 

Answer Key: A 

# Question 7 of 10 10.0 PointsWho is TCS first General Manager?A. JRD Tata B. F.C Kohli C. Ratan Tata D. S. Ramadorai 

Answer Key: B

# Question 8 of 10 10.0 PointsTCS provides six major IT servicesA. Customer Development, Application Management, Migration and Re-engineering, System Integration, Testing, Performance Engineering B. Custom Application Development, Application Management, Migration and Re-engineering, Business Management, Testing, Performance Engineering C. Custom Application Development, Application Management, Migration and Re-engineering, System Integration, Testing, Performance Engineering D. Customer Development, Application Management, Migration and Re-engineering, Business Management, Testing, Performance Engineering 

Answer Key: B 

# Question 9 of 10 10.0 PointsWhich model does TCS follow?A. Global Integrated Delivery ModelB. World Integrated Delivery Model C. World Network Delivery Model D. Global Network Delivery Model 

Answer Key: D 

# Question 10 of 10 10.0 PointsTata Consulting Services goes public in India’s private sector’s largest initial public offer inA. 2006 B. 1999 C. 2004 D. 2002 

Answer Key: C 

Page 3: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

TCS ASPIRE : Communication Quiz/question answers | latest 2012

# Question 1 of 20 10.0 PointsWhat does this Body language symbolize? A. IntuitiveB. AngerC. IrritatedD. QuestioningE. Insulting

Answer Key: D

# Question 2 of 20 10.0 PointsChoose the right phrase of the word. I’ll be with you in ___________ A. A quarter of an hour.B. A quarter of hour.C. One quarter of an hour.D. A quarter of one hour.

Answer Key: A 

# Question 3 of 20 10.0 PointsChoose the right vocabulary which matches its meaning. “Expressing one self readily, clearly, effectively”A. EloquenceB. UnderstandingC. EffectiveD. Comprehensive

Answer Key: A 

# Question 4 of 20 10.0 PointsSelect the right option which indicates MTI ( Mother tongue influence) in the below given statement. What is your good name?  A. Your goodB. YourC. NameD. Good name

Answer Key: D

# Question 5 of 20 10.0 PointsIdentify the tense used in the following sentence: We built a tree house last week.A. Present continuous

Page 4: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

B. Past PerfectC. Present PerfectD. Simple Past

Answer Key: D

# Question 6 of 20 10.0 PointsPick the correct option(past progressive tense): While Aaron_________ in his room, his friends________ in the pool. A. was working………………were swimmingB. was working……………………are swimmingC. was working………………was swimmingD. is working……………………are swimming

Answer Key: A 

# Question 7 of 20 10.0 PointsChoose the correct verb form to complete the sentence. I ______ on my sofa all day yesterday. A. lyingB. layC. lieD. laid

Answer Key: B

# Question 8 of 20 10.0 Points Identify the incorrect part of the sentence: She don’t understand / didn’t understands / didn’t understand/didn’t understanding the question yesterday.  A. didn’t understandingB. don’t understandC. didn’t understandD. didn’t understandsAnswer Key: C 

# Question 9 of 20 10.0 PointsPlease rewrite the following statement: We are simply loving it here. A. We are simply loving.B. We simply love it here.C. We are simply here.D. We love it here.

Answer Key: B

# Question 10 of 20 10.0 Points What is the right response for the phrase “ How do you do?”

Page 5: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

A. I am fine,how about you?B. I am fine thank youC. How do you do?D. I am not fine, by the way how are you?

Answer Key: C 

# Question 11 of 20 10.0 Points Arrange the following sections of a presentation in the correct order:a. overviewb. introductionc. start new sectiond. analyse a pointe. give examplesf. finish sectiong. paraphrase and clarifyh. summarize and concludei. inviting audience to ask questions/ discussA. a,d,b,c,e,f,h,g,iB. a,b,d,c,e,f,h,g,iC. a,b,c,d,e,f,g,h,iD. b,a,c,d,e,f,h,g,i

Answer Key: D 

# Question 12 of 20 10.0 PointsIn the business arena:A. It is not necessary for men or women to stand for handshaking and all introductionsB. Both men and women should stand for handshaking and all introductionsC. Only men should stand for handshaking and all introductionsD. Only women should stand for handshaking and all introductions

Answer Key: B 

# Question 13 of 20 10.0 Points

Fill in the blanks with appropriate articles: At ____ (1) beginning of ____(2) twentieth century, East Los Angeles

became ____(3) popular immigrant destination.

A. the,a,the

B. the,an,a

C. the,the,the

D. the,the,a

Answer Key: D 

Page 6: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 14 of 20 10.0 Points

State whether this is true or false: Every presentation has its own target audience.

- True

- False

 Answer Key: True 

# Question 15 of 20 10.0 Points

Read the passage and answer the following:

FINDING A JOB 

            Not so long ago almost any student who successfully completed a university degree or diploma course

could find a good career quite easily. Companies toured the academic institutions, competing with each other to

recruit graduates. However, those days are gone, even in Hong Kong, and nowadays graduates often face strong

competition in the search for jobs. 

                 Most careers organizations highlight three stages for graduates to follow in the process of securing a

suitable career: recognizing abilities, matching these to available vacancies and presenting them well to prospective

employers. 

              Job seekers have to make a careful assessment of their own abilities. One area of assessment should be of

their academic qualifications, which would include special skills within their subject area. Graduates should also

consider their own personal values and attitudes, or the relative importance to themselves of such matters as money,

security, leadership and caring for others. An honest assessment of personal interests and abilities such as creative

or scientific skills, or skills acquired from work experience, should also be given careful thought. The second stage is

to study the opportunities available for employment and to think about how the general employment situation is likely

to develop in the future. To do this, graduates can study job vacancies and information in newspapers or they can

visit a careers office, write to possible employers for information or contact friends or relatives who may already be

involved in a particular profession. After studying all the various options, they should be in a position to make

informed comparisons between various careers. 

                   Good personal presentation is essential in the search for a good career. Job application forms and letters

should, of course, be filled in carefully and correctly, without grammar or spelling errors. Where additional information

is asked for, job seekers should describe their abilities and work experience in more depth, with examples if possible.

They should try to balance their own abilities with the employer’s needs, explain why they are interested in a career

with the particular company and try to show that they already know something about the company and its activities.

When graduates are asked to attend for interview, they should prepare properly by finding out all they can about the

prospective employer. Dressing suitably and arriving for the interview on time are also obviously important.

Interviewees should try to give positive and helpful answers and should not be afraid to ask questions about anything

they are unsure about. This is much better than pretending to understand aquestion and giving an unsuitable answer.

Page 7: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

There will always be good career opportunities for people with ability, skills and determination; the secret to securing

a good job is to be one of them. 

Question: In paragraph 3, ‘three stages for graduates’ refers to: 

A. all of the above

B. stages in the assessment of personal interests

C. stages in the process of securing a suitable career

D. stages for the completion of a university degree or diploma course .

Answer Key: C 

# Question 16 of 20 10.0 Points

Read the passage and answer the following: 

FINDING A JOB 

                Not so long ago almost any student who successfully completed a university degree or diploma course

could find a good career quite easily. Companies toured the academic institutions, competing with each other to

recruit graduates. However, those days are gone, even in Hong Kong, and nowadays graduates often face strong

competition in the search for jobs. 

                   Most careers organizations highlight three stages for graduates to follow in the process of securing a

suitable career: recognizing abilities, matching these to available vacancies and presenting them well to prospective

employers. 

                       Job seekers have to make a careful assessment of their own abilities. One area of assessment should

be of their academic qualifications, which would include special skills within their subject area. Graduates should also

consider their own personal values and attitudes, or the relative importance to themselves of such matters as money,

security, leadership and caring for others. An honest assessment of personal interests and abilities such as creative

or scientific skills, or skills acquired from work experience, should also be given careful thought. The second stage is

to study the opportunities available for employment and to think about how the general employment situation is likely

to develop in the future. To do this, graduates can study job vacancies and information in newspapers or they can

visit a careers office, write to possible employers for information or contact friends or relatives who may already be

involved in a particular profession. After studying all the various options, they should be in a position to make

informed comparisons between various careers. 

                   Good personal presentation is essential in the search for a good career. Job application forms and letters

should, of course, be filled in carefully and correctly, without grammar or spelling errors. Where additional information

is asked for, job seekers should describe their abilities and work experience in more depth, with examples if possible.

They should try to balance their own abilities with the employer’s needs, explain why they are interested in a career

with the particular company and try to show that they already know something about the company and its activities.

When graduates are asked to attend for interview, they should prepare properly by finding out all they can about the

prospective employer. Dressing suitably and arriving for the interview on time are also obviously important.

Interviewees should try to give positive and helpful answers and should not be afraid to ask questions about anything

Page 8: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

they are unsure about. This is much better than pretending to understand a question and giving an unsuitable

answer. There will always be good career opportunities for people with ability, skills and determination; the secret to

securing a good job is to be one of them. 

Question: ‘each other ‘ in paragraph 2 refers to: 

 A. available vacancies

B. career organizations

C. three stages

D. job seekers

 Answer Key: B 

# Question 17 of 20 10.0 Points

Choose the correct option. We_________ around the parking lot for 20 minutes in order to find a parking

space. 

A. driven

B. drive

C. drove

D. drived

Answer Key: C 

# Question 18 of 20 10.0 Points

Choose the correct option: 

a)While I was writing the email, the computer suddenly went off. 

b) When I write letters, the computer goes off. 

c) Writing letters make my computer go off 

A. None of the above

B. c

C. b

D. a

Answer Key: D 

# Question 19 of 20 10.0 Points

Identify the tense: A rhinoceros was swatting flies with his tail when suddenly a fly bit him 

A. Past Progressive 

B. Past Simple

C. Past perfect continuous

D. Past perfect

Page 9: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

Answer Key: A 

# Question 20 of 20 10.0 Points

Choose the correct option: Not again! This is the third time that I ……. my keys since I …….. home this

morning. 

A. had lost/left

B. am losing/was leaving

C. will lose/have left

D. lose/had left

E. have lost/left

Answer Key: E 

TCS ASPIRE: Basic Programming Quiz/questions | latest 2012

# Question 1 of 10 10.0 PointsWhat is a variable in a computer program?A. An outputB. A value such as 5C. The name given to a valueD. An input argument

Answer Key: C

# Question 2 of 10 10.0 PointsWhat is a semantic error ?A. A program error that is difficult to debugB. A program error that is not so important to take careC. A program error that crashes the programD. A program error that gives wrong output

Answer Key: D

# Question 3 of 10 10.0 PointsA variable will last untilA. the value of the variable is used in the programB. The program completes and exitC. Hard disc is formattedD. Computer is switched off

Answer Key: B

Page 10: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 4 of 10 10.0 PointsIn a Javascript program, the word preceding the “ . “ representsA. A program nameB. An objectC. An action by an objectD. A command

Answer Key: B

# Question 5 of 10 10.0 PointsWhat do you mean by a portable computer program?A. The program can be attached to the port of a computerB. The program is very smallC. It can be run on computers with different types of computersD. It can be send from one computer to another computer

Answer Key: C

# Question 6 of 10 10.0 PointsA compiler willA. Interpret the program line by lineB. Compile the program to create an executableC. Link different programs written in same language togetherD. Correct the errors in the program

Answer Key: B

# Question 7 of 10 10.0 Points

What do we mean by the performance of a program ?

A. The utilization of resources such as CPU and memory by a program

B. The number of times a program can be run

C. The number of arguments that a program can handle

D. The speed with which a program runs

Answer Key: A

# Question 8 of 10 10.0 Points

What is debugging ?

A. Fine tuning the program for performance

Page 11: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

B. The process of tracking and correcting the bugs in a program

C. Testing the program to identify defects

D. The process of removing the identified bugs

Answer Key: B

# Question 9 of 10 10.0 PointsData structure enablesA. Analysis of the data used in a programB. Connecting a program with databaseC. Storing and organizing data in computer memory for efficient useD. Structuring data in a program

Answer Key: C

# Question 10 of 10 10.0 PointsWhat is class in object oriented program ?A. A collection of objectsB. A template to create objectsC. A variable type in a programD. Category /Type of a programAnswer Key: B

TCS ASPIRE : UNIX quiz/question-answer 2012

# Question 1 of 10 10.0 Points“ls” command in UNIXA. Lists the files in a directoryB. Compare the size of two filesC. Gives the currently logged session detailsD. Compares two numerals and prints the lower value

Answer Key: A 

# Question 2 of 10 10.0 PointsWhich among the following is not a part of UNIX operating systemA. ProgramsB. LibrariesC. KernelD. Shell

Answer Key: B

Page 12: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 3 of 10 10.0 PointsIn UNIX, the shell act as an interface between user andA. KernelB. Operating SystemC. HardwareD. Programs

Answer Key: A

# Question 4 of 10 10.0 PointsEverything in UNIX isA. NoneB. a ProcessC. a file or a processD. a File

Answer Key: C

# Question 5 of 10 10.0 PointsWhich command is used for changing directory in UNIX?A. mkdirB. cdC. chgdirD. cddir

Answer Key: B

# Question 6 of 10 10.0 PointsIn UNIX, file permissions are not set forA. UserB. Other usersC. DevicesD. User Groups

Answer Key: C

# Question 7 of 10 10.0 PointsIn Unix, how can you read the manual – help pages – about a commandA. Type ‘help’ and the commandB. Type ‘options’ and the commandC. Type ‘details’ and the commandD. Type ‘man’ and the command

Answer Key: D

Page 13: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 8 of 10 10.0 PointsWhich is the most common text editor in UNIX ?A. Visual editorB. notepadC. WordD. Open office

Answer Key: A

# Question 9 of 10 10.0 PointsYou have created a shell script and wants to run the script. What should you do before trying to run the script ? A. No action requiredB. Compile the script to create the executableC. Update the execute permission of the scriptD. Give ownership of the file to system admin

Answer Key: C

# Question 10 of 10 10.0 PointsWhich is valid mode of operation in vi editor ?A. Typing modeB. Command ModeC. Append modeD. Open mode

Answer Key: B

TCS ASPIRE : software engineering quiz/question answer 2012

# Question 1 of 10 10.0 PointsRequirements can be classified in to two types, namely, functional requirements and non-functional requirements- True- FalseAnswer Key: True 

# Question 2 of 10 10.0 PointsSome examples of non-functional requirements are.1.Number of significant digits to which accuracy should be maintained in all numerical calculations is 10 2.The response time of the system should always be less than 5 seconds3.The software should be developed using C language on a UNIX based system

Page 14: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

4.The matrix diagonalisation routine should zero out all off-diagonal elements, which are equal to or less than 10-35.Experienced officers should be able to use all the system functions after a total training of two hours. After this training, the average number of errors made by experienced officers should not exceed two per day. - True- False

Answer Key: True 

# Question 3 of 10 10.0 PointsEvery software system has the following essential characteristics: A. It has processes which collaborate with each other to generate the outputs.B. All the aboveC. It has a boundary. The boundary separates what is with in system scope and what is outside.D. The system may also use data stores to store data which has a life beyond the system.E. These processes operate on data by creating, modifying, destroying, and querying it.F. It takes inputs from external agents and generates outputs.

Answer Key: B 

# Question 4 of 10 10.0 PointsERD complements DFD. While DFD focuses on data and the relationships between them, ERD focuses on processes and data flow between them - True- False

Answer Key: False

# Question 5 of 10 10.0 PointsPolymorphism: – It is the means by which an operation behaves differently in different contexts. - True- False

Answer Key: True

# Question 6 of 10 10.0 PointsEncapsulation: This helps in controlling the visibility of internal details of the objects. It improves security and integrity of data - True- False

Answer Key: True

# Question 7 of 10 10.0 PointsThere are 4 types of Abstraction, namely Entity, Action, Virtual machine & Coincidental. - True- False

Page 15: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

Answer Key: True

# Question 8 of 10 10.0 PointsThere can be more than one hash fields on a file.- True- False

Answer Key: False

# Question 9 of 10 10.0 PointsConcurrency refers to multiple transactions accessing the same database at the same time. In a system which allows concurrency, some kind of control mechanism has to be in place to ensure that concurrent transactions do not interfere with each other. - True- False

Answer Key: True

# Question 10 of 10 10.0 PointsSoftware genetic development process contains three genetic phrases namelyA. Software engineering, Definition, CodingB. Definition, development, maintenanceC. Coding, design, Software engineeringD. Design, Coding, DevelopmentE. Development, Definition, Testing

Answer Key: B

TCS ASPIRE | Database management system quiz/question | latest 2012

# Question 1 of 10 10.0 Points

Which of the following options list the steps to convert a table to its second normal form? 

A. All of the above

B. Find and remove fields that are related to the only part of the key.

C. Assign the new table with the key i.e. part of the whole composite key.

D. Group the removed items in the another table.

Answer Key: A

Page 16: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 2 of 10 10.0 Points

In which of the following ways does “TRUNCATE TABLE” differ from “DELETE”?

A. All of the above

B. The number of deleted rows are not returned.

C. Truncate operations are not transaction safe.

D. Truncate operations drop and re-create the table which is much faster than deleting rows. one by one.

Answer Key: A

# Question 3 of 10 10.0 Points

Following tasks can be performed when using the ALTER TABLE

clause:

1.Change the name of the table

2.Change the name of the column

3.Decrease the size of a column if table data exists.

  - True

  - False

Answer Key: False

# Question 4 of 10 10.0 Points

Sometimes tables within particular database become obsolete and ought to be discarded. Which of the

following commands would you use for the same? 

A. None of the above

B. REMOVE TABLE < TABLE NAME>

C. DROP TABLE < TABLE NAME >

D. DELETE TABLE < TABLE NAME >

Answer Key: C

# Question 5 of 10 10.0 Points

A foreign key must have a corresponding primary key or unique key value in the master table. 

- True

- False

Answer Key: True

# Question 6 of 10 10.0 Points

NULL value is equivalent to a value of Zero if the data type is number 

- True

- False

Page 17: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

Answer Key: False

# Question 7 of 10 10.0 Points

Integrity constraint can be dropped if the rule that it enforces is not longer TRUE or if the constraint is no

longer needed.

- True

- False

Answer Key: True

# Question 8 of 10 10.0 Points

SELECT TRIM(‘ Hansel ‘ ) “Trim both sides” FROM DUAL What would be the output of the above command?

A. None of the above

B. Trim both sides

C. Hansel

D. Trim both sides Hansel

Answer Key: D

# Question 9 of 10 10.0 Points

What would be the output of following command. SELECT TRANSLATE(’1sct523′,’123′, ’7a9′) “Change”

FROM DUAL; 

A. 7sct 5a9

B. None of the above

C. 7 sct

D. Change 7 sct 5a9

Answer Key: D

# Question 10 of 10 10.0 Points

What is joining a Table to itself called?

A. Self Join

B. Outer join

C. Left inner join

D. Inner join

Answer Key: A

Page 18: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

2012 TCS ASPIRE : Java quiz/question and answers latest

# Question 1 of 10 10.0 PointsAmong the following options, choose the four options that describe the appropriate default values for array elements of the types indicated? 1. int -> 0 2. String -> “null” 3. Dog -> null 4. char -> ‘\u0000′ 5. float -> 0.0f 6.boolean -> true A. 1, 2, 3, 4B. 2, 4, 5, 6C. 3, 4, 5, 6D. 1, 3, 4, 5

Answer Key: D 

# Question 2 of 10 10.0 PointsWhich option among the following lists only Java programming language keywords?A. goto, instanceof, native, finally, default, throwsB. byte, break, assert, switch, includeC. try, virtual, throw, final, volatile, transientD. strictfp, constant, super, implements, doE. class, if, void, long, Int, continue

Answer Key: A 

# Question 3 of 10 10.0 PointsWhich of the following options would legally declare, construct, and initialize an array? A. int [] myList = {“1″, “2″, “3″};B. int myList [] = {4, 3, 7};C. int [] myList = (5, 8, 2);D. int myList [] [] = {4,9,7,0};

Answer Key: B 

# Question 4 of 10 10.0 PointsYou want subclasses in any package to have access to members of a superclass. Which is the most restrictiveaccess that accomplishes this objective? A. privateB. transient

Page 19: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

C. publicD. protected

Answer Key: C 

# Question 5 of 10 10.0 Pointsinterface Base { boolean m1 (); byte m2(short s); } 1.interface Base2 implements Base {} 2.abstract class Class2 extends Base { public boolean m1(){ return true; }} 3.abstract class Class2 implements Base {} 4.abstract class Class2 implements Base { public boolean m1(){ return (7 > 4); }} 5.abstract class Class2 implements Base { protected boolean m1(){ return (5 > 7) }} A. 3 and 4B. 1 and 5C. 1 and 2D. 2 and 3

Answer Key: A 

# Question 6 of 10 10.0 PointsAmong the 6 options provided below, which three form part of correct array declarations?1.public int a [ ]2.static int [ ] a3.public [ ] int a4.private int a [3]5.private int [3] a [ ]6.public final int [ ] aA. 2, 4, 5B. 1, 3, 4C. 2, 5, 6D. 1, 2, 6

Answer Key: D 

# Question 7 of 10 10.0 PointsWhich of the following is/are legal method declarations?1.protected abstract void m1();2.static final void m1(){}3.synchronized public final void m1() {}4.private native void m1();A. All of them are legal declarations.B. 1 and 3C. 2 and 4D. 1 only

Answer Key: A

Page 20: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 8 of 10 10.0 PointsWhich three among the following are valid method signatures in an interface? 1.private int getArea(); 2.public float getVol(float x); 3.public void main(String [] args); 4.public static void main(String [] args); 5.boolean setFlag(Boolean [] test); A. 3, 4, and 5B. 2 and 4C. 1 and 2D. 2, 3 and 5

Answer Key: D 

# Question 9 of 10 10.0 PointsWhich option among the following creates an instance of an array?A. int[ ] ia = new int[15];B. int ia[ ] [ ] = { 4, 5, 6 }, { 1,2,3 };C. char[ ] ca = “Some String”;D. float fa = new float[20];

Answer Key: A 

# Question 10 of 10 10.0 PointsWhich of the following class level (nonlocal) variable declarations will not compile? A. volatile int d;B. private synchronized int e;C. protected int a;D. transient int b = 3;

Answer Key: B

TCS ASPIRE : Unix Assignment 1 quiz answers 2012

# Question1:

Write a command to list all the files inside a folder i.e. if there is a folder inside a folder then it should list all

files inside the sub-folder which is inside the folder to be listed.

Answer: ls -aR

[Hint]

Ls =list information about files.

-a –all (hidden files also), -R –recursive (list subdirectories) 

Page 21: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 2:

Search all the files which contains a particular string, say “include” within a folder.

Answer: grep include ./*

[Hint]

Grep = searches the named input file for lines containing a match to the given pattern. ./* = In current directory (.), all

files(*)

# Question 3:

Rename all the files within a folder with suffix “Unix_” i.e. suppose a folder has two files a.txt and b.pdf than

they both should be renamed from a single command to Unix_a.txt and Unix_b.pdf

Answer: for i in *.*;do mv “$i” Unix_”$i”;done;

[Hint]

Loop:

Syntax for variable in no of times;

Do command;

….;

Done;

Here: i= *.* (for all files)

$= to read value of variable.

do mv “$i” Unix_”$i” = rename *.* as Unix_*.* 

# Question 4:

Rename all files within a folder with the first word of their content(remember all the files should be text files.

For example if a.txt contains “Unix is an OS” in its first line then a.txt should be renamed to Unix.txt

Answer: for i in *.txt; do head -1 “$i” > ad.txt ; x=”$(cut -d ‘ ‘ -f1 ad.txt)”; mv “$i” “$x.txt”; done;

[Hint]

i = *.txt (all text files);

do head -1 “$i” > ad.txt; = prints first line and store in ad.txt file.

x=”$(cut -d ‘ ‘ -f1 ad.txt)” ; = removes first column (field) delimited by space from ad.txt file stores in x.

mv “$i” “$x.txt”; = rename *.txt as value of x .txt.

# Question 5:

Suppose you have a C project in a folder called “project”, it contains .c and .h files, it also contains some

other .txt files and .pdf files. Write a Linux command that will count the number of lines of your text files.

That means total line count of every file. (remember you have to count the lines in .txt files only)

Page 22: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

Answer: wc –l *.txt

[Hint]

Here: wc =word count

-l =to count lines

*.txt =all text files

# Question 6:

Rename all files which contain the sub-string ‘foo’, replacing it with ‘bar’ within a given folder.

Answer: for i in ./*foo*;do mv “$i” “${i/foo/bar}”;done 

# Question 7:

Show the most commonly used commands from “history”. [hint: remember the history command, use cut,

and sort it.

Answer: history|sort|cut -d ‘ ‘ -f1 

TCS ASPIRE : Unix Assignment 2 quiz answers 2012

# Question 1:

Create a tree structure named ‘training’ in which there are 3 subdirectories – ‘level 1’,’ level2’ and ‘cep’. Each

one is again further divided into 3. The ‘level 1’ is divided into ‘sdp’, ‘re’ and ‘se’. From the subdirectory ‘se’

how can one reach the home directory in one step and also how to navigate to the subdirectory ‘sdp’ in one

step? Give the commands, which do the above actions?

Answer : To navigate from 'se' to home directory,in one step,the command is : cd

 To navigate from 'se' to 'sdp',in one step,the command is : cd ../b 

# Question 2:

How will you copy a directory structure dir1 to dir2 ? (with all the subdirectories)

Answer : cp –R dir1 dir2 

# Question 3:

How can you find out if you have the permission to send a message?

Answer : ls -l ( To check access permissions) 

Page 23: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 4:

Find the space occupied ( in Bytes) by the /home directory including all its subdirectories.

Answer : du -s -b 

# Question 5:

What is the command for printing the current time in 24-hour format?

Answer : date +%T 

# Question 6:

Create the following files: chapa, chapb, chapc, chapd, chape, chapA, chapB, chapC, chapD, chapE, chap01,

chap02, chap03, chap04, chap05, chap11, chap12, chap13, chap14, and chap15.

Answer :

The general syntax is :

cat > filename

Type the contents of file

Press Ctrl+D

Example:

cat > chapa

        Type the contents of file

        Ctrl+D

# Question 7:

What is the command for printing the year, month, and date with a horizontal tab between the fields?

Answer : date +%Y%t%B%t%e

# Question 8:

With reference to question 7, What is the command for listing all files ending in small letters?

Answer : find –name “*[a-z].*” 

# Question 9:

With reference to question 7, What is the command for listing all files ending in capitals?

Answer : find –name “*[A-Z].*” 

Page 24: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 9:

With reference to question 7, What is the command for listing all files ending in small letters?

Answer : find –name “*[a-z].*” 

# Question 10:

With reference to question 7, What is the command for listing all files whose last but one character is 0?

Answer : find –name “*0?.*” 

# Question 11:

With reference to question 7, What is the command for listing all files which end in small letters but not ‘a’

and ‘c’?

Answer : find –name “*[b d-z].*” 

# Question 12:

In an organisation one wants to know how many programmers are there. The employee data is stored in a file

called ‘personnel’ with one record per employee. Every record has field for designation. How can grep be

used for this purpose?

Answer : grep -c "programmers" personnel 

# Question 13:

In the organisation mentioned in question 12 how can sed be used to print only the records of all employees

who are programmers.

Answer : sed -n /programmers/p personnel 

# Question 14:

In the organisation mentioned in question 12 how can sed be used to change the designation ‘programmer’

to ‘software professional’ every where in the ‘personnel’ file

Answer : sed 's/programmer/software professional/g' personnel 

# Question 15:

Find out about the sleep command and start five jobs in the background, each one sleeping for 10 minutes.

Answer : sleep 10m & sleep 10m & sleep 10m & sleep 10m & sleep 10m & 

Page 25: zimslifeintcs.files.wordpress.com€¦  · Web viewphrase of the word. ... This helps in controlling the visibility of internal details of the objects. ... In a system which allows

# Question 16:

How do you get the status of all the processes running on the system? i.e. using what option?

Answer : ps -e

ALL CREDIT GOES TO TECHNOVARY!