## Basic Concepts of Time and Work

Most of the aptitude questions on time and work can be solved if you know the basic correlation between time, work and man-hours which you have learnt in your high school class.

Analogy between problems on time and work to time, distance and speed:
1. Speed is equivalent to rate at which work is done
2. Distance travelled is equivalent to work done.
3. Time to travel distance is equivalent to time to do work.
• Man - Work - Hour Formula:
1. More men can do more work.
2. More work means more time required to do work.
3. More men can do more work in less time.
4. $M$ men can do a piece of work in $T$ hours, then .
5. If $A$ can do a piece of work in $D$ days, then $A$'s 1 day's work = $1D$.
Part of work done by $A$ for $t$ days = $tD$.
6. If $A$'s 1 day's work = $1D$, then $A$ can finish the work in $D$ days.
7. $MDHW=Constant$
Where,
M = Number of men
D = Number of days
H = Number of hours per day
W = Amount of work
8. If $M1$ men can do $W1$ work in $D1$ days working $H1$ hours per day and $M2$ men can do $W2$ work in $D2$days working $H2$ hours per day, then
$M1D1H1W1=M2D2H2W2$
9. If $A$ is $x$ times as good a workman as $B$, then:
1. Ratio of work done by $A$ and $B$ = $x:1$
2. Ratio of times taken by $A$ and $B$ to finish a work = $1:x$ ie; $A$ will take $(1x)th$ of the time taken by $B$to do the same work.

## Shortcuts for frequently asked time and work problems

• $A$ and $B$ can do a piece of work in $'a'$ days and $'b'$ days respectively, then working together:
1. They will complete the work in $aba+b$ days
2. In one day, they will finish $(a+bab)th$ part of work.
• If $A$ can do a piece of work in $a$ days, $B$ can do in $b$ days and $C$ can do in $c$ days then,
• If $A$ can do a work in $x$ days and $A$ and $B$ together can do the same work in $y$ days then,
$Number of days required to complete the work if B works alone=xyx-ydays$
• If $A$ and $B$ together can do a piece of work in $x$ days, $B$ and $C$ together can do it in $y$ days and $C$ and $A$together can do it in $z$ days, then number of days required to do the same work:
1. If A, B, and C working together = $2xyzxy+yz+zx$
2. If A working alone = $2xyzxy+yz-zx$
3. If B working alone = $2xyz-xy+yz+zx$
4. If C working alone = $2xyzxy-yz+zx$
• If $A$ and $B$ can together complete a job in $x$ days.
If $A$ alone does the work and takes $a$ days more than $A$ and $B$ working together.
If $B$ alone does the work and takes $b$ days more than $A$ and $B$ working together.
Then,
• If $m1$ men or $b1$ boys can complete a work in $D$ days, then $m2$ men and $b2$ boys can complete the same work in $Dm1b1m2b1+m1b2$ days.
• If $m$ men or $w$ women or $b$ boys can do work in $D$ days, then 1 man, 1 woman and 1 boy together can together do the same work in $Dmwbmw+wb+bm$ days
• If the number of men to do a job is changed in the ratio $a:b$, then the time required to do the work will be changed in the inverse ratio. ie; $b:a$
• If people work for same number of days, ratio in which the total money earned has to be shared is the ratio of work done per day by each one of them.
$A$$B$$C$ can do a piece of work in $x$$y$$z$ days respectively. The ratio in which the amount earned should be shared is $1x:1y:1z=yz:zx:xy$
• If people work for different number of days, ratio in which the total money earned has to be shared is the ratio of work done by each one of them.

## Special cases of time and work problems

• Given a number of people work together/alone for different time periods to complete a work, for eg: $A$ and $B$work together for few days, then $C$ joins them, after few days $B$ leaves the job. To solve such problems, following procedure can be adopted.
1. Let the entire job be completed in $D$ days.
2. Let sum of parts of the work completed by each person = 1.
3. Find out part of work done by each person with respect to $D$. This can be easily found out if you calculate how many days each person worked with respect to $D$.
4. Substitute values found out in Step 3 in Step 2 and solve the equation to get unknowns.
• A certain no of men can do the work in $D$ days. If there were $m$ more men, the work can be done in $d$ days less. How many men were there initially?
Let the initial number of men be $M$
Number of man days to complete work = $MD$
If there are $M+m$ men, days taken = $D-d$
So, man days = $(M+m)(D-d)$
ie; $MD=(M+m)(D-d)$
$M(D–(D-d))=m(D-d)$
$M=m(D-d)d$
• A certain no of men can do the work in $D$ days. If there were $m$ less men, the work can be done in $d$ days more. How many men were initially?
Let the initial number of men be $M$
Number of man days to complete work = $MD$
If there are $M-m$ men, days taken = $D+d$
So, man days = $(M-m)(D+d)$
ie; $MD=(M-m)(D+d)$
$M(D+d–D)=m(D+d)$
$M=m(D+d)d$
• Given $A$ takes $a$ days to do work. $B$ takes $b$ days to do the same work. Now $A$ and $B$ started the work together and $n$ days before the completion of work $A$ leaves the job. Find the total number of days taken to complete work?
Let $D$ be the total number of days to complete work.
$A$ and $B$ work together for $D-n$ days.
So, $(D-n)(1a+1b)+n(1b)=1$
$D(1a+1b)–na-nb+nb=1$
$D(1a+1b)=n+aa$
$D=b(n+a)a+b$ days.

### Zoho Puzzle Questions With Answers

Measuring Time Logic Puzzle You are given with two ropes with variable width. However if we start burning both the ropes, they will burn at exactly same time i.e. an hour. The ropes are non-homogeneous in nature. You are asked to measure 45 minutes by using these two ropes.

How can you do it?

Please note that you can’t break the rope in half as it is being clearly stated that the ropes are non-homogeneous in nature.
Answer & Explanation Solution: 45 minutes

Explanation :
All you have to do is burn the first rope from both the ends and the second rope from one end only simultaneously. The first rope will burn in 30 minutes (half of an hour since we burned from both sides) while the other rope would have burnt half. At this moment, light the second rope from the other end as well. Where, the second rope would have taken half an hour more to burn completely, it will take just 15 minutes as we have lit it from the other end too.

Thus you have successfully calculated 30+15 = 45 minutes …

### Hackerrank > SQL > Basic Select

Select
01-Select All
Given a City table, whose fields are described as +-------------+----------+ | Field       | Type     | +-------------+----------+ | ID          | int(11)  | | Name        | char(35) | | CountryCode | char(3)  | | District    | char(20) | | Population  | int(11)  | +-------------+----------+
write a query that will fetch all columns for every row in the table.

My Solution
SELECT*FROM city;
---------------------------------------------------------------------------------
02-Select by ID
Given a City table, whose fields are described as