background preloader

Jobs

Facebook Twitter

C++

Interesting. Meaning. How to be a Programmer: A Short, Comprehensive, and Personal Sum. Debugging is the cornerstone of being a programmer. The first meaning of the verb to debug is to remove errors, but the meaning that really matters is to see into the execution of a program by examining it. A programmer that cannot debug effectively is blind. Idealists that think design, or analysis, or complexity theory, or whatnot, are more fundamental are not working programmers.

The working programmer does not live in an ideal world. Even if you are perfect, your are surrounded by and must interact with code written by major software companies, organizations like GNU, and your colleagues. Most of this code is imperfect and imperfectly documented. Debugging is about the running of programs, not programs themselves. To get visibility into the execution of a program you must be able to execute the code and observe something about it. The common ways of looking into the ‘innards’ of an executing program can be categorized as: How to Debug by Splitting the Problem Space. Programming Interview Questions. Intro This is a summary of the questions I got in a number of in-person interviews with a range of companies.

The interviews were split between very large, large, and startup-sized tech and finance companies. The good news is that the core set of questions is generally pretty limited. Two books usually cover 70-80% of what you will get: Linked Lists This is an extremely popular topic. Strings Reverse words in a string (words are separated by one or more spaces). Binary Trees Implement the following functions for a binary tree: Insert PrintInOrder PrintPreOrder PrintPostOrder Implement a non-recursive PrintInOrder Arrays You are given an array with integers between 1 and 1,000,000.

Queues Implement a Queue class in C++ (which data structure to use internally? Other Count the number of set bits in a byte/int32 (7 different solutions) Difference between heap and stack? Puzzles You have 2 supposedly unbreakable light bulbs and a 100-floor building. Design Questions Concurrency Networking Links: » Google interviewing. The phone screen Question #1: How would you go about making a copy from a node in a directed graph?

This I had done before for Savant’s dependency tree. I had never distributed this type of operation, but since the operation is simple on a single machine distribution seems to be just a matter of dividing and then sharing of information via standard distributed algorithm operations like scatter, collect, etc. Question #2: How would you write a cache that uses an LRU? This I had also worked on. Question #3: How would you find the median of an array that can’t fit in memory? This question I had some problems with. Question #4: How would you randomly select N elements from an array of unknown size so that an equal distribution was achieved for infinite selects? This one I sorta understood and got a very minimal answer to.

Boulder office Second round of interviews was at the Boulder office. This is pretty simple brute force. California office Question #1: Find all the anagrams of a given word. Interview Question Categories. Microsoft and interview questions. Microsoft Google Algorithm Interview Questions. Microsoft Interview Questions - Job Interview Wiki. Google Interview Questions | Careers.CSE. Given a number, describe an algorithm to find the next number which is prime. There are 8 stones which are similar except one which is heavier than the others. To find it, you are given a pan balance. What is the minimal number of weighing needed to find out the heaviest stone ? Answer: Divide the stones into sets like (3,3,2). If the pan does not remain balanced when weighing (3,3), pick the set of stones that outweigh other. [These questions from 'Taher'] Order the functions in order of their asymptotic performance * 2^n * n^Googol ( 10^100) * n! Answer: n^(whatever constant), 2^n, n! What is the best and worst performance time for a hash tree and binary search tree?

Answer: Best is O(c), worst is O(log n) Questions regarding a string Class * What do you need when you instantiate a string ( i said a byte array and possibly the length) ? Trade offs between a multi threaded and single threaded implementation ? N threads .. n resources .. what protocol do you use to ensure no deadlocks occur?