Basic programming questions

  1. Design a data structure such that given a stream of numbers, you can find the maximum of the numbers at any point and also all the numbers.
  2. Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions.
  3. Find the common ancestor of two given nodes in a binary tree, how do you exploit the properties of a given BST for the same problem.
  4. You’re given a function getsort(data) that sorts the data given. The function sorts in place and does not use any extra memory. How do you validate the function with respect to 1) it sorts 2) it does not use extra memory
  5. Explain the Traveling Salesman problem? What is an NP-complete problem? What is the Hamiltonian cycle problem?
  6. Find out the least common ancestor in a binary tree.

Linux command line Q&A

  1. You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?
    tail -15 dog cat horse
    The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file.
  2. Who owns the data dictionary?
    The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

Click to continue reading “Linux command line Q&A”

SQL interview questions

  1. What are two methods of retrieving SQL?
  2. What cursor type do you use to retrieve multiple recordsets?
  3. What is the difference between a "where" clause and a "having" clause? - "Where" is a kind of restiriction statement. You use where clause to restrict all the data from DB.Where clause is using before result retrieving. But Having clause is using after retrieving the data.Having clause is a kind of filtering command.
  4. What is the basic form of a SQL statement to read data out of a table? The basic form to read data out of table is ‘SELECT * FROM table_name; ‘ An answer: ‘SELECT * FROM table_name WHERE xyz= ‘whatever’;’ cannot be called basic form because of WHERE clause.

Click to continue reading “SQL interview questions”

Java interview questions

Describe what happens when an object is created in Java?

Several things happen in a particular order to ensure the object is constructed properly:
1. Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its superclasses. Implementation-specific data includes pointers to class and method data.
2. The instance variables of the objects are initialized to their default values.
3. The constructor for the most derived class is invoked. The first thing a constructor does is call the constructor for its uppercase. This process continues until the constructor for java.lang.Object is called, as java.lang.Object is the base class for all objects in java.
4. Before the body of the constructor is executed, all instance variable initializers and initialization blocks are executed. Then the body of the constructor is executed. Thus, the constructor for the base class completes first and constructor for the most derived class completes last.

Click to continue reading “Java interview questions”

WinRunner question encyclopedia with answers

176 questions, so warm up that fireplace.

  1. Explain WinRunner testing process? - a) WinRunner testing process involves six main stages
    i.Create GUI Map File so that WinRunner can recognize the GUI objects in the application being tested
    ii.Create test scripts by recording, programming, or a combination of both. While recording tests, insert checkpoints where you want to check the response of the application being tested.
    iii.Debug Test: run tests in Debug mode to make sure they run smoothly
    iv.Run Tests: run tests in Verify mode to test your application.
    v.View Results: determines the success or failure of the tests.
    vi.Report Defects: If a test run fails due to a defect in the application being tested, you can report information about the defect directly from the Test Results window.

Click to continue reading “WinRunner question encyclopedia with answers”

Java threads question set

  1. Do I need to use synchronized on setValue(int)? - It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
  2. Do I need to use synchronized on setValue(int)? - It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.

Click to continue reading “Java threads question set”

Unix admin questions

  1. How do you list the files in an UNIX directory while also showing hidden files?
  2. How do you execute a UNIX command in the background?
  3. What UNIX command will control the default file permissions when files are created?
  4. Explain the read, write, and execute permissions on a UNIX directory.
  5. What is the difference between a soft link and a hard link?
  6. Give the command to display space usage on the UNIX file system.
  7. Explain iostat, vmstat and netstat.
  8. How would you change all occurrences of a value using VI?
  9. Give two UNIX kernel parameters that effect an Oracle install
  10. Briefly, how do you install Oracle software on UNIX.

Hiring an IT guy - questions to ask

This is an aggregated list of questions discussed for hiring an IT guy for your organization at SpiceWorks community forum. Check out their discussion, and description of what question are good and which ones are not that good.

  1. What port does telnet use?
  2. What is SMTP?
  3. How would you troubleshoot a printer?
  4. How does traceroute work?
  5. Walk me through everything that happens in the network from the moment you punch in www.google.com in the address bar to when the browser displays the page?
  6. Can you work this weekend?

Click to continue reading “Hiring an IT guy - questions to ask”

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.

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)

Yahoo! PHP interview questions

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.

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?

« Previous Entries