Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Interview Question

Interview Question

Scheduled Pinned Locked Moved The Lounge
tutorialquestioncareer
83 Posts 26 Posters 25 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Rahul VB

    Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

    S Offline
    S Offline
    Stefan_Lang
    wrote on last edited by
    #47

    On a more serious note: as incomplete and nonsensical as these questions seem, client specifications for a project are typically just as incomplete and nonsensical. Maybe the point of these questions was to query for more specific information to the point where the problem is sufficiently specified to actually come up with a solution?

    GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]

    1 Reply Last reply
    0
    • G greldak

      That fails the 15 min requirement Why not just fold it into half (or quarters for 15 min) when it reaches the fold you're done

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #48

      There is no 15 min requirement: 30 and 45. For 45, cut it in half, burn one half, then burn the other from both ends.

      Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      G 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        There is no 15 min requirement: 30 and 45. For 45, cut it in half, burn one half, then burn the other from both ends.

        Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

        G Offline
        G Offline
        greldak
        wrote on last edited by
        #49

        You're not allowed to cut it - by folding it into quarters you can get any multiple of 15 minutes up to 60 including 45

        1 Reply Last reply
        0
        • L Lost User

          Rahul VB wrote:

          I can just measure that rope using time.

          Next you will claim you can fly the Kessel Run in less than twelve parsecs.

          The language is JavaScript. that of Mordor, which I will not utter here
          I hold an A-7 computer expert classification, Commodore. I'm well acquainted with Dr. Daystrom's theories and discoveries. The basic design of all our ship's computers are JavaScript.

          S Offline
          S Offline
          Simon ORiordan from UK
          wrote on last edited by
          #50

          Watch your mouth kid or you'll find yourself floating home.

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            The first one is rather simple: took about 10 seconds to work that one out. Set fire to both ends.

            Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

            P Offline
            P Offline
            Paddington Bear
            wrote on last edited by
            #51

            You don't need a tool to find the middle of the rope. Set fire to one end. Once it has burnt to the middle set light to the other end. 45 mins.

            I 1 Reply Last reply
            0
            • R Rahul VB

              Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

              N Offline
              N Offline
              Nelviticus
              wrote on last edited by
              #52

              Burning the rope is just an example of how you use time to measure it, not the only way permitted. If you can measure time accurately in this experiment (which they don't specify) you could, for instance, test how far a shadow moves over it in an hour. With a bit of maths you can then angle it so that it takes an hour for a shadow to move from end to end, after which you can measure a quarter by checking where the shadow gets to after 15 mins. You'd have to do each round of testing at the same time of day but so what, it's not a real situation anyway.

              Regards Nelviticus

              1 Reply Last reply
              0
              • L Lost User

                That depends.Up to now they fortunately never wanted me to sing and dance. :)

                The language is JavaScript. that of Mordor, which I will not utter here
                I hold an A-7 computer expert classification, Commodore. I'm well acquainted with Dr. Daystrom's theories and discoveries. The basic design of all our ship's computers are JavaScript.

                S Offline
                S Offline
                Stefan_Lang
                wrote on last edited by
                #53

                That would be their problem, not mine ;P

                GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]

                S 1 Reply Last reply
                0
                • R Rahul VB

                  Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

                  S Offline
                  S Offline
                  Stefan_Lang
                  wrote on last edited by
                  #54
                  1. If all you can measure is time, climb a tower or building higher than the rope is long, hold the rope on one end, letting the other dangle down. Then let it drop and measure the time it takes until the far end hits the pavement. Then drop something small to take the time it takes to drop from the current height. From the latter you can determine the current height, from the former you can determine the drop height of the far end. The difference between the two heights is the rope length. (note: height is 1/2*a*t^2, where a is ~9.81m/s^2 and t is the time you measured) You just need a sufficiently accurate stop watch and an accurate way to measure the moment the end of the rope hits the bottom (photo sensor should do) When you're done, tell the client the length and sell the rope: if burning it is ok, then why would the client expect to get it returned? ;) And don't tell me I can't use gravity! :~

                  GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]

                  1 Reply Last reply
                  0
                  • S Stefan_Lang

                    That would be their problem, not mine ;P

                    GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto) Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]

                    S Offline
                    S Offline
                    SortaCore
                    wrote on last edited by
                    #55

                    The nearby glassware would probably have something to say about your singing too.

                    1 Reply Last reply
                    0
                    • P Paddington Bear

                      You don't need a tool to find the middle of the rope. Set fire to one end. Once it has burnt to the middle set light to the other end. 45 mins.

                      I Offline
                      I Offline
                      irneb
                      wrote on last edited by
                      #56

                      You don't have a tool to measure to the "middle" ... unless you mean wait for 30 min then set light to the other end.

                      F 1 Reply Last reply
                      0
                      • I irneb

                        You don't have a tool to measure to the "middle" ... unless you mean wait for 30 min then set light to the other end.

                        F Offline
                        F Offline
                        Freak30
                        wrote on last edited by
                        #57

                        If it't a rope, you don't need a tool to find the middle. Just fold it, then pull the ends apart a little bit so that it lies in the shape of a V.

                        The good thing about pessimism is, that you are always either right or pleasently surprised.

                        I 1 Reply Last reply
                        0
                        • R Rahul VB

                          Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

                          I Offline
                          I Offline
                          irneb
                          wrote on last edited by
                          #58

                          Actually the 1st is a bit of a trick question. The hint is in this line:

                          Rahul VB wrote:

                          For example i set it on fire and the rope burns for one hour.

                          Did he actually state that the rope is 1 hour long and you must then divide it into a half hour- and another into a 3/4 hour rope? I think this question is meant to find out how you read a problem. E.g. your measuring tool is time. And all you're being asked is to measure a rope of 30 min "long" and another of 45 min "long" ... i.e. start burning the rope while you start the measurement (i.e. something like a stopwatch). Then snuff the burning rope once it's reached the time indicated. Now if you're required to end with a rope the same length as the specified time, you'd need at least 2 ropes (equal lengths) to achieve this. E.g. time how long the 1st burns, subtract the required left over rope from that time then burn the 2nd for that amount and snuff it.

                          I 1 Reply Last reply
                          0
                          • F Freak30

                            If it't a rope, you don't need a tool to find the middle. Just fold it, then pull the ends apart a little bit so that it lies in the shape of a V.

                            The good thing about pessimism is, that you are always either right or pleasently surprised.

                            I Offline
                            I Offline
                            irneb
                            wrote on last edited by
                            #59

                            If you read some of the other posts, you'll note that this was disallowed: "Not allowed to fold the rope".

                            P 1 Reply Last reply
                            0
                            • I irneb

                              Actually the 1st is a bit of a trick question. The hint is in this line:

                              Rahul VB wrote:

                              For example i set it on fire and the rope burns for one hour.

                              Did he actually state that the rope is 1 hour long and you must then divide it into a half hour- and another into a 3/4 hour rope? I think this question is meant to find out how you read a problem. E.g. your measuring tool is time. And all you're being asked is to measure a rope of 30 min "long" and another of 45 min "long" ... i.e. start burning the rope while you start the measurement (i.e. something like a stopwatch). Then snuff the burning rope once it's reached the time indicated. Now if you're required to end with a rope the same length as the specified time, you'd need at least 2 ropes (equal lengths) to achieve this. E.g. time how long the 1st burns, subtract the required left over rope from that time then burn the 2nd for that amount and snuff it.

                              I Offline
                              I Offline
                              irneb
                              wrote on last edited by
                              #60

                              Alternative to this (as others have mentioned) what if burning the rope is not necessarily the means of measuring it against time? Though here I might have to query on the translation, e.g. if the word rope is replaced with fuse the burning at a specified time interval makes a lot more sense than with a "rope". Also, are you allowed to "invent" (or rather deduce) a new measurement from a sample? E.g. take a single rope, measure it using some other means (e.g. using a stick you picked up). Then time how long it takes to burn it. Then you can use maths to use the stick as non-destructive measure on other ropes. And then, if the interviewer keeps giving you restrictions which void your answers. E.g. using mine above he then states: But you don't have 2 ropes. Or it's impossible to snuff. Etc. etc. ... that probably means he's actually testing your willingness to continue problem solving and how you react under pressure.

                              1 Reply Last reply
                              0
                              • R Rahul VB

                                Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #61

                                "Now i want to measure the rope for half an hour what to do?" You burn it from both ends :) They really will end up with expert pyromaniacs in that company.

                                T R 2 Replies Last reply
                                0
                                • R Rahul VB

                                  Yes Sir, Thats true. Capability and knowledge is every thing. This aptitude test and all bull shit. And on top of that what is the need to impose a criteria like 60% and above throughout academics? Its becoming frustrating now. In one company i cleared all aptitude and technical rounds, however one person who topped throughout his academics flunked these tests. Now what can be said about this? Well i hope these practices are not followed else where. Thanks and Regards, Rahul.

                                  K Offline
                                  K Offline
                                  Kirk 10389821
                                  wrote on last edited by
                                  #62

                                  Rahul, I hope these types of tests are used everywhere. And the criteria for being in the top 60% is merely an exclusion of the BOTTOM 40%, which shows someone who did not LOVE the degree, in my book. And the Guy who did GREAT in school, and FAILED these tests is WHY they (we) give such tests. It is the opposite of working the system. All school tests are solvable. Not all problems in real life are. We need people who can figure that portion out... They have to know what they don't know, or realize they cannot solve the problem BEFORE they just start banging out code. I use tests like these. Even worse... How many molecules of rubber comes off a tire in a single rotation, under normal wear conditions? If the person studied a lot of physics: If I push a fudge brownie out into space from the MIR space station. Will it explode/implode? Please explain? To be clear, what I am looking for has NOTHING to do with the answer. It has to do with the reasoning, and their reactions to the question, and their follow-up questions. Honestly, put yourself in their shoes. If you had 1,000 people to interview for 100 positions, and you wanted to hire the types of people who are going to do the best... How would you decide that? - Personality? (doesn't work) - Dress? (hardly?) - Experience (maybe, but if you have 10:1, you probably pay on the low side, and you should, for the new people. Give me someone who wants a chance to prove themselves and have shown this during school) It is a simple optimization, and a requirement to optimize. Interviewing takes time and costs money.

                                  R 1 Reply Last reply
                                  0
                                  • L Lost User

                                    "Now i want to measure the rope for half an hour what to do?" You burn it from both ends :) They really will end up with expert pyromaniacs in that company.

                                    T Offline
                                    T Offline
                                    Tomz_KV
                                    wrote on last edited by
                                    #63

                                    For 45 minutes, start fire at the 3/4 location. The question was not clearly defined purposely. Therefore, there is no definitive answer.

                                    TOMZ_KV

                                    1 Reply Last reply
                                    0
                                    • I irneb

                                      If you read some of the other posts, you'll note that this was disallowed: "Not allowed to fold the rope".

                                      P Offline
                                      P Offline
                                      Paddington Bear
                                      wrote on last edited by
                                      #64

                                      The only way this can be done with a single rope is either by exact measurement or proportions of the rope. Since you can neither measure it (no tools) nor find proportions (requires bending the rope) this cannot be done accurately. However, if you have two ropes this may be possible: Light both ends of one rope and one end of the second. When the first rope is fully burnt light the other end of the second rope.

                                      1 Reply Last reply
                                      0
                                      • R Rahul VB

                                        Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

                                        J Offline
                                        J Offline
                                        JamesStewarts
                                        wrote on last edited by
                                        #65

                                        Fire is just an example of one way of measuring the length of the rope. So for example, tie one end of the rope to a tree and walk away for an hour... how long is the rope - ones hours length of walking long. Go back to the tree and do the same for 30 minutes and 45 minutes, you've got 3 measurements. It's a silly question, so I think silly answers are only fair.

                                        I R 2 Replies Last reply
                                        0
                                        • R Rahul VB

                                          Hello Friends, I went for an interview to a company: they asked me these 2 questions: 1> I have a rope. There is no tool available to measure that rope. I can just measure that rope using time. For example i set it on fire and the rope burns for one hour. a>Now i want to measure the rope for half an hour what to do? b>I want to measure it for 45 minutes. How to do? 2> I have a figure below: :) :) :) :) :) :) :) :) :) :) I want to convert it to: :) :) :) :) :) :) :) :) :) :) You have 2 options: a>Either use 3 smilies at once to rearrange the figure. b>Or use a combination of (2 + 1) smilies to rearrange the figure. which means you have only 1 chance if you use 3 smilies. OR 2 chances if you use (2 + 1) smilies You cant do a 1 + 1 + 1 combination of smilies to rearrange the figure. I was given 15 minutes to solve the above problems. Thanks a ton

                                          M Offline
                                          M Offline
                                          mrmike
                                          wrote on last edited by
                                          #66

                                          You answer "African or European?" and then mention to the interviewer that you require a steady uninterrupted stream of "Skittles" delivered to your desk as you code. Interviews always respond favourably to developers with sugar addictions. Its not the capabilities, its the carbs....

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups