Log Date

Welcome to techInterview, a site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!





  1. Text post

    Getting a fair result with an unfair coin

    How can you get a fair coin toss if someone hands you a coin that is weighted to come up heads more often than tails?

    Notes: 24 notes

  2. Text post

    We are NY Tech asks:

    “How many unique areas of human knowledge have the right size of passionate users to make it as a Stack Exchange site?”

    Answer: 30,000.

    Notes: 4 notes

  3. Text post

    Storing 1 million phone numbers

    What is the most efficient way, memory-wise, to store 1 million phone numbers?  Apparently this is an interview question at Google, although this seems like its a bit too easy.

    Notes: 7 notes

    Tags: google interview

  4. Text post

    Reverse a String

    A typical programming interview question is “reverse a string, in place”. if you understand pointers, the solution is simple. even if you don’t, it can be accomplished using array indices. i usually ask candidates this question first, so they get the algorithm in their head. then i play dirty by asking them to reverse the string word by word, in place. for example if our string is “the house is blue”, the return value would be “blue is house the”. the words are reversed, but the letters are still in order (within the word).

    Read More

    Notes: 8 notes

  5. Text post

    100 Doors in a Row

    Problem: you have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6). the third time, every 3rd door (door #3, #6, #9), etc, until you only visit the 100th door.

    question: what state are the doors in after the last pass? which are open which are closed?

    Read More

    Notes: 16 notes

  6. Text post

    Red Marbles, Blue Marbles

    Problem: you have two jars, 50 red marbles, 50 blue marbles. you need to place all the marbles into the jars such that when you blindly pick one marble out of one jar, you maximize the chances that it will be red. (when picking, you’ll first randomly pick a jar, and then randomly pick a marble out of that jar) you can arrange the marbles however you like, but each marble must be in a jar.

    Read More

    Notes: 5 notes

  7. Text post

    Bumblebee

    problem: two trains enter a tunnel 200 miles long (yeah, its a big tunnel) travelling at 100 mph at the same time from opposite directions. as soon as they enter the tunnel a supersonic bee flying at 1000 mph starts from one train and heads toward the other one. as soon as it reaches the other one it turns around and heads back toward the first, going back and forth between the trains until the trains collide in a fiery explosion in the middle of the tunnel (the bee survives). how far did the bee travel?

    Read More

    Notes: 3 notes

  8. Text post

    int atoi( char* pStr )

    Problem: write the definition for this function without using any built-in functions. if pStr is null, return 0. if pStr contains non-numeric characters, either return 0 (ok) or return the number derived so far (better) (e.g. if its “123A”, then return 123). assume all numbers are positive. plus or minus signs can be considered non-numeric characters. in order to solve this program, the programmer must understand the difference between the integer 0 and the character ‘0’, and how converting ‘0’ to an int, will not result in 0. in other words, they have to understand what ascii is all about.

    Read More

    Notes: 7 notes

  9. Text post

    Daughters’ Ages

    Two MIT math grads bump into each other at Fairway on the upper west side. They haven’t seen each other in over 20 years.

    the first grad says to the second: “how have you been?”
    second: “great! i got married and i have three daughters now”
    first: “really? how old are they?”
    second: “well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
    first: “right, ok.. oh wait.. hmm, i still don’t know”
    second: “oh sorry, the oldest one just started to play the piano”
    first: “wonderful! my oldest is the same age!”

    problem: how old are the daughters?

    Read More

    Notes: 7 notes

  10. Text post

    Palindromes

    Problem: this year on October 2, 2001, the date in MMDDYYYY format will be a palindrome (same forwards as backwards).
    10/02/2001
    when was the last date that this occurred on? (see if you can do it in your head!)

    Read More

    Notes: 3 notes

Tumblr Theme 'Nautical' by PixelUnion