background preloader

Resources for Interviews

Facebook Twitter

(262) Gayle Laakmann McDowell's answer to Gayle Laakmann McDowell (author): What are Gayle Laakmann McDowell's top resume evaluation answers? List of data structures. List of data structures From Wikipedia, the free encyclopedia Jump to: navigation, search This is a list of data structures. For a wider list of terms, see list of terms relating to algorithms and data structures. Contents [hide] Data types[edit] Primitive types[edit] Composite types[edit] (Sometimes also referred to as Plain old data structures.) Abstract data types[edit] Some properties of abstract data types: "Stable" means that input order is retained. Other structures such as "linked list" and "stack" cannot easily be defined this way because there are specific operations associated with them.

Linear data structures[edit] Arrays[edit] Lists[edit] Trees[edit] Binary trees[edit] B-trees[edit] Heaps[edit] Trees[edit] In these data structures each tree node compares a bit slice of key values. Multiway trees[edit] Space-partitioning trees[edit] These are data structures used for space partitioning or binary space partitioning. Application-specific trees[edit] Hashes[edit] Graphs[edit] Other[edit] Categories: Views. Using Uninitialized Memory for Fun and Profit. This is the story of a clever trick that's been around for at least 35 years, in which array values can be left uninitialized and then read during normal operations, yet the code behaves correctly no matter what garbage is sitting in the array. Like the best programming tricks, this one is the right tool for the job in certain situations. The sleaziness of uninitialized data access is offset by performance improvements: some important operations change from linear to constant time.

Alfred Aho, John Hopcroft, and Jeffrey Ullman's 1974 book The Design and Analysis of Computer Algorithms hints at the trick in an exercise (Chapter 2, exercise 2.12): Develop a technique to initialize an entry of a matrix to zero the first time it is accessed, thereby eliminating the O(||V||2) time to initialize an adjacency matrix. Jon Bentley's 1986 book Programming Pearls expands on the exercise (Column 1, exercise 8; exercise 9 in the Second Edition): add-member(i): dense[n] = i sparse[i] = n n++ Sphere Online Judge (SPOJ) Programming Competition,Programming Contest,Online Computer Programming. Practice and Learn - Google Code Jam. On this page you can see results and code from past rounds of Google Code Jam, and you can try the problems for yourself.

If you're new to Code Jam, try following the Quick-Start Guide. Where should I start? If you're new to programming contests, we highly recommend starting with the least difficult problems and moving up from there as you get more confident. Beware: the round that has the easiest problem A may have a very difficult problem B! As you get used to the platform, you can check how many people solved each problem in the "Submissions" box to the left of the dashboard, and use that as a rough gauge of difficulty. Here are some choice problems for new competitors: Africa 2010, Qualification Round: Store Credit, Reverse Words. Remember, if you get stuck you can look at someone else's solution (click a "solutions" link below) or join our mailing list and ask for help. Finding Solutions You can click a "solutions" link below, but those aren't really indexed in a helpful way. TopCoder.

Programming Test | Hire programmers | Interviewstreet | Dashboard. Interview Questions. Hacking a Google Interview. Hard interview questions. Technical Interview Questions and Answers, Microsoft Interview Questions, Amazon Interview Questions, Data Structure Algorithms | Qubeet. GeeksforGeeks. Algo Muse. 16-1 In the box There are n identical boxes in which 2n balls are equally distributed. The balls are labelled from 1 to 2n. We don't know which ball is in which box, but do know that each box contains two balls.

The objective is to learn the arrangement of balls. For any set of balls S ⊆ {1,...,2n} we can ask a query of the form `How many boxes contain the balls in S? '. For example, consider the distribution of balls shown below. Prove that we can learn the distribution of balls by asking O(n log n) queries. Note that we cannot tell which ball is in which box. Solution Solution There are n pairs of balls. Lemma. Proof. How many boxes contain the balls in set A?

If answers to both the questions are same, then x is paired with one of the balls in set A; else x is paired with one of the balls in set B. 16-2 Evasive Tree We prove the lower bound for the special case when the tree is a path, using an adversarial argument. Analysis. 16-3 Saving a log Find an arbitrary spanning tree T. Programming, Software, and Technical Interview Questions - XOR Swap. Language agnostic - What are the lesser known but useful data structures. Interview Questions | MyCareerStack. A group of N high school students wants to play a basketball game. To divide themselves into two teams they first rank all the players in the following way: Players with a higher shot percentage are rated higher than players with a lower shot percentage. If two players have the same shot percentage, the taller player is rated higher. Luckily there are no two players with both the same shot percentage and height so they are able to order themselves in an unambiguous way.

Each team can only have P players playing at a time, so to ensure that everyone gets similar time on the court both teams will rotate their players according to the following algorithm: Each team starts the game with the P players who have the lowest draft numbers. The game has been going on for M minutes now. Input The first line of the input consists of a single number T, the number of test cases. Each test case starts with a line containing three space separated integers N M P Constraints 1 ? Output Example. Programming Contests, Software Development, and Employment Services at TopCoder. Technical Interview Question of the Day Archive. Microsoft Interview Questions - GPABook.com. Faq 'algorithm' Questions.