Amazon interview questions

  1. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can’t pass the value k to any function also.
  2. What are the 4 basics of OOP?
  3. Define Data Abstraction. What is its importance?
  4. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.
  5. Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren’t present.
  6. Given a string,find the first un-repeated character in it? Give some test cases
  7. You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
  8. Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.
  9. What is a C array and illustrate the how is it different from a list.
  10. What is the time and space complexities of merge sort and when is it preferred over quick sort?
  11. Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
  12. Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.
  13. Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
  14. Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.
  15. How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
  16. Explain polymorphism. Provide an example.
  17. Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
  18. You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
  19. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.
Posted in C++, Database, General | 12 Comments

Sysadmin sample interview questions

  1. Why was it that you left the last job that you were at?
  2. What do you think your top 3 strengths are?
  3. What is most important to you in a job?
  4. Major difference between FAT and NTFS on a local machine?
  5. How many passwords by default are remembered in an active directory?
  6. What is a C name record (in DNS)?
  7. What is a LM host file used for?
  8. Can you name the FSMO roles in active directory?
  9. What tolls would you use to gage the effect of group policy before using any tools?
  10. Explain Active Directory sites and services and linked cost routing?
  11. When would you use circular logging and exchange?
  12. Exhange related question - as an echange admin if someone asked you how to determine if mail was delivered or not which tool would you use?
  13. Can you explain how you configurated SMS.
  14. Rate yourself in 3 different areas (1-5, 5 is expert)
Posted in Unix/Linux, Windows | 2 Comments

Yahoo! PHP interview questions and answers

Nick Halstead on his blog posts a list of interview questions from Yahoo! that a friend of his supplied, apparently free of NDA. Yahoo! is a strong PHP shop, with a few big names like Rasmus Lerdorf leading PHP development there.

A few questions on PHP functions, and “what does this code do?” type of questions that seem a bit off-the-mark in PHP environment, with naming consistency like array_pop and shuffle (both do operations on array), and frequent swaps in the order of parameters passed in. Some fairly good questions, though:

How do you debug a PHP application? - Interesting to see what the interviewee used outside of echo’s and error_log’s.

Is PHP better than Perl? Discuss. and before that What’s the difference between the way PHP and Perl distinguish between arrays and hashes? - not sure how that relates to someone who’ve been using PHP all around, but occasionally played around with Perl, or vice versa, but nevertheless some good starting points for discussion.

Posted in Web dev | Leave a comment

Two men running

Adam and Bob have exact speeds for walking and running - neither Adam outwalks Bob, nor Bob outruns Adam.

But for a given distance, Adam runs half the time, then walks another half. Bob runs half the distance, then walks another half.

If they were to compete, which distance would Adam win at, and which distances would Bob be the winner at?

Posted in General, Puzzles | 35 Comments

54 screening questions for Windows admin

  1. What is Active Directory?
  2. What is LDAP?
  3. Can you connect Active Directory to other 3rd-party Directory Services? Name a few options.
  4. Where is the AD database held? What other folders are related to AD?
  5. What is the SYSVOL folder?
  6. Name the AD NCs and replication issues for each NC
  7. What are application partitions? When do I use them
  8. How do you create a new application partition
  9. How do you view replication properties for AD partitions and DCs?
  10. What is the Global Catalog?
  11. Read More »

Posted in Windows | 39 Comments

10 questions on MySQL speed-up and optimizations

Jay Pipes, author of Pro MySQL, on his blog posts 10 questions and answers dealing with MySQL speed optimizations.

  1. Which will be faster out of these two queries - one with OR or one with IN?
  2. Where does MyISAM cache table records?
  3. Which will be faster out of queries with explicit INNER JOIN and implicit one?
  4. Is InnoDB faster/better than MyISAM?
  5. Is CHAR faster than VARCHAR?
  6. Is VARCHAR(80) faster than VARCHAR(255)?
  7. Are there performance issues when joining tables from different storage engines?
  8. If I change a derived table to a view, will performance increase?
  9. If I see Using temporary; Using filesort” in the Extra column of EXPLAIN output, does that mean a temporary table is created on disk?
  10. Is it possible to do a FULL OUTER JOIN in MySQL?
Posted in Database, Web dev | 1 Comment

Search engine marketer questions

Some would say that a position of a search engine marketer or optimizer is not a very technical one. True, compared to Linux kernel hacker, the technical knowledge required for entering SEO field seems simpler, but when the site is built and serving pages, you’re very likely to have SEO go over the site structure and reprogram essential parts of it. Anyway, check out 55 search engine optimization questions, and either test yourself, or use them whenever you’re interested in hiring a search engine marketer.

Posted in General, Web dev | Leave a comment

Topics for networking interview

These questions were sent in from IBM. They discuss various telecom and networking topics.

  1. OSPF
    1. Describe OSPF in your own words.
    2. OSPF areas, the purpose of having each of them
    3. Types of OSPF LSA, the purpose of each LSA type
    4. What exact LSA type you can see in different areas
    5. How OSPF establishes neighboor relation, what the stages are
    6. If OSPF router is stucked in each stage what the problem is and how to troubleshoot it
    7. OSPF hierarchy in the single or multi areas. Cool OSPF behavior in broadcast and nonbroadcast
    8. Draw the diagram of typical OSPF network and explain generally how it works, DR, BDR, election, ASBR, ABR, route redistribution and summarization

    Read More »

Posted in Networking | 1 Comment

C++ interview questions and answers

  1. What is the most efficient way to reverse a linklist?
  2. How to sort & search a single linklist?
  3. Which is more convenient - single or double-linked linklist? Discuss the trade-offs? What about XOR-linked linklist?
  4. How does indexing work?
  5. char s[10];
    s=”Hello”;
    printf(s);

    What will be the output? Is there any error with this code?
  6. What is the difference between
    char s[]=”Hello”;
    char *s=”Hello”;

    Please give a clear idea on this?
  7. Why do we pass a reference for copy constructors? If it does shallow copy for pass by value (user defined object), how will it do the deep copy?
  8. What is the difference between shallow copy & deep copy?
  9. What is the difference between strcpy and memcpy? What rule should we follow when choosing between these two?
  10. If we declare two variable and two applications are using the same variable, then what will its value be, will it be the same?
Posted in C++ | 19 Comments

12 general questions from an international company

A TechInterviews reader sent in the questions he faced at a major global company. The questions are fairly generic:

  1. Tell me about your analytical skills, cite some examples of how you have used your skills in the past.
  2. What are some of your long term goals?
  3. What are your short term goals?
  4. Where do you see yourself five years from now?
  5. Tell me why I should hire you?
  6. What does customer service mean to you?
  7. Why did you leave your last job?
  8. Describe your definition of a team player?
  9. Sight examples of when in the past you have proven to be a team player?
  10. How would you handle a conflict with another employee?
  11. What do you believe you can gain by working at this company?
  12. Give me some examples of times in the past, when you were able to avoid a conflict, by thinking on your feet. Tell what you know about this company.
Posted in General | Leave a comment

Windows admin interview questions (includes Vista)

  1. What is Active Directory?
  2. What is LDAP?
  3. Can you connect Active Directory to other 3rd-party Directory Services? Name a few options.
  4. Where is the AD database held? What other folders are related to AD?
  5. What is the SYSVOL folder?
  6. Name the AD NCs and replication issues for each NC
  7. What are application partitions? When do I use them
  8. How do you create a new application partition
  9. How do you view replication properties for AD partitions and DCs?
  10. What is the Global Catalog?
  11. Read More »

Posted in Windows | 6 Comments

Linux application programming questions

  1. Explain the difference between a static library and a dynamic library? - Static library is linked into the executable, while a dynamic library (or shared object) is loaded while the executable has started.
  2. How do you create a static library? - If you have a collection of object (.o) files, you can do it by running ar command. Generally a static library has a .a extension, and you can link it into an executable by providing -l libraryname to gcc.
  3. Where should the developed libraries be installed on the system? - GNU recommends /usr/local/bin for binaries and /usr/local/lib for libraries.
  4. What’s LD_LIBRARY_PATH? - It’s an environment variable that lists all the directories which should be searches for libraries before the standard directories are searched.
  5. How do you create a shared library? - Create the object file with -fPIC for position-independent code, then run gcc with -shared option.
  6. How do you install a shared library? - Run ldconfig in the standard directory that it’s installed in.
  7. What does ldd do? - It shows a list of installed shared libraries.
  8. How do you dynamically load a library in your app? - Use dlopen()
  9. What does nm command do? - It reports the list of symbols in a given library.
Posted in Unix/Linux | Leave a comment