Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

11/04/2013

More Interview Programming Questions


  • Write a function to reverse a sentence's wording order (also in recursive form)
    • Input: "I saw a dog"
    • Output: "dog a saw I"
  • Given APIs write following functions
    • Given APIs:
      • Color(String color) --changes pen color
      • Rotate(angle) --rotate the pen angle
      • Move(distance) --move while drawing
    • Draw rectangle function
    • Draw circle function
  • Given API, write following function
    • Airline.hasDirectFlight(source,destination) :: boolean
      • Returns true if source and target has a direct flight
    • Write boolean isReachable(source,destionation) function

10/22/2013

Some Phone Interview Programming Questions


I sometimes try phone interviews with companies. It is both a refreshment for me and a fun way to challenge yourself. These questions are easy ones though, but can be noted.
  • Find duplicate element in an N array.
    • [1,2,3,4,5,4] > 4
  • Given earth and 1 billion star location, find 100 closest stars to earth
    • locations in 3d
  • Write parseInt function in Java.
    • 123 > 123
    • 123.00 > 123
    • 123ab > Exception
    • 123.ab > Exception
    • 123.50 > Exception (or rounding)
    • 12323123123131231231312312312 > Exception