Tag: job

  • Answers to toughest interview questions

    <embed id="doc_266158069542781" style="outline: none;" type="application/x-shockwave-flash" width="100%" height="500" src="http://d1 weight reduction pills.scribdassets.com/ScribdViewer.swf” flashvars=”document_id=15997581&access_key=key-69t3uvwuf423itqak4u&page=1&viewMode=list” allowscriptaccess=”always” allowfullscreen=”true” bgcolor=”#ffffff” wmode=”opaque” data=”http://d1.scribdassets.com/ScribdViewer.swf” name=”doc_266158069542781″>

  • Brainteasers

    1. How many degrees angle between hour, minute hand when time is 3:15?
      7.5°
      360° full circle, therfore (360°/12 hrs) = 30° /hour.
      At 3:15,  minutes hand points to the 3, hour hand is ahead of 3 by 1/4th (15/60),  which is 7.5° apart. (30°/4)=7.5°
    2. Why are manhole covers round?
      – Round covers can be easily rotated
      – It’s easier to dig a circular hole
      – Round castings are easier to machine using a lathe
      – Easier to manufacture than custom-made covers
    3. How will you generate random number between two given numbers
      Assuming n1, n2 random number between them would be n1 + Math.random() * (n2 – n1)
    4. How will you sort a million integers?
      Split them into meaningful subsets, sort each subset, merge subset back
      http://neopythonic.blogspot.com/2008/10/sorting-million-32-bit-integers-in-2mb.html
    5. How many windows will be open in a 100 window room if you go around  a 100 times toggling each window you come across? All windows are closed initially.
      100 windows,  all closed.
      1st round, you toggle all windows i.e. all windows are opened
      2nd round, you close all even-numbered windows – 2, 4, 6, …
      3rd round, you open, close odd numbered winodws – 3, 6, 9,…
      So after 100 times, windows open are windows who have been toggled odd number of times. For e.g. consider window 12, round 1 will make it open, 2 will make it closed, 3 will make it open, 4 closed, then directly 12 will make it open. Consider again, window 20 – 1 (open), 2 (close), 4 (open), 5 (close), 10 (open), 20 (close). Consider 7 – 1 (open), 7 (close). So window 12 got touched 5 times, window 20 got touched 6 times, window 7 touched 2 times.
      So, in order to find “open” windows between 1-100, we have to find number having “odd” number of factors, which means numbers who have one repeated factor i.e.  factor by same factor gives the number e.g. 16 has 1, 2, 4, 8, 16 – open window. It has 4 which means 4×4= 16. Consider 20 has 1, 2, 4, 5, 10, 20. No factor is repetitive.
      Therefore, let us find numbers which are below 100, but are having square products, similar to 4×4 = 16 starting with 1, which gives 12=1, 22=4, 32=9, 42=16, 52=25, 62=36, 72=49, 82=64, 92=81, 102=100
      So open windows are 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 = 1o open windows
    6. A party of four travelers comes to a rickety bridge at night. The bridge can hold the weight of at most two of the travelers at a time, and it cannot be crossed without using a flashlight. The travelers have one flashlight among them. Each traveler walks at a different speed: The first can cross the bridge in 1 minute, the second in 2 minutes, the third in 5 minutes, and the fourth takes 10 minutes to cross the bridge. If two travelers cross together, they walk at the speed of the slower traveler. What is the least amount of time in which all the travelers can cross from one side of the bridge to the other?
      Obvious (but incorrect)
      Incorrect answer

      Not  so obvious (correct answer)
      Correct answer

    7. Next…

    A party of four travelers comes to a rickety bridge at night. The bridge can hold the weight of at most two of the travelers at a time, and it cannot be crossed without using a flashlight. The travelers have one flashlight among them. Each traveler walks at a different speed: The first can cross the bridge in 1 minute, the second in 2 minutes, the third in 5 minutes, and the fourth takes 10 minutes to cross the bridge. If two travelers cross together, they walk at the speed of the slower traveler.

    What is the least amount of time in which all the travelers can cross from one side of the bridge to the other?

  • TOYOTA: Speech by Akio Toyoda – president of Toyota Motor Corporation

    “Contributing to society” at Toyota means two things.  First, it means, “to manufacture automobiles that meet the needs of society and enrich people’s lives.”  And second, “to take root in the communities we serve by creating jobs, earning profits and paying taxes, thereby enriching the local economies where we operate.”

    TOYOTA: Company > Company Profile > Message from Top Management.

  • Management Pros Share Their Secrets

    Remember way back when – when you got your first management job. What do you wish someone had told you then? What would be the one tip you would give to a manager just starting out?

    Management Pros Share Their Secrets.

  • Run a job every first Sun of a month

    I came across an interesting cron issue recently. The requirement was to run a job every _first_ Sunday at 12:00PM of each month.

    After searching across various sites, skimming through cron manpages, I finally found the following one-liner

    0 0 1-7 * 0 <user> <job>

    Can you believe this simple solution? The reasoning is that Sun will be between 1 to 7th of each month. Once a Sun comes, the job will execute between 1st and 7th just once. After that any further Sundays will have a date greater than 7, and thus never execute!

    Sometimes, the simplest solution is the most elegant. BTW, I had read about many other complicated solutions, such as having your own logic to determine the day, apple script, bash script solutions. I was about to give up, when I hit the jackpot! 😀