Programming Code Interview Questions
Questions Answers Views Company eMail

Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.

ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,

21 48919

Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

Mentor Graphics, Microsoft,

2 22135

Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.

Fusion Systems GmbH,

6 20569

Give a one-line C expression to test whether a number is a power of 2.

Microsoft,

10 25592

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

Wipro,

2 10704

Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

Microsoft,

7 29784

program to Reverse a linked list

Aricent, Microsoft, Ness Technologies,

12 59087

write a program to Insert in a sorted list

Microsoft,

4 14297

Program to Delete an element from a doubly linked list.

College School Exams Tests, Infosys,

4 33040

Write a function to find the depth of a binary tree.

Adobe, Amazon, EFI, Imagination Technologies,

13 88177

Write a routine that prints out a 2-D array in spiral order

Microsoft,

3 17209

Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

Intel, Microsoft, TCS,

13 37389

Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)

Disney, Google, ZS Associates,

3 14020

Print an integer using only putchar. Try doing it without using extra storage.

2 20584

How to swap two variables, without using third variable ?

AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,

104 234701


Un-Answered Questions { Programming Code }

How to Bind Nested XML to a Repeater Control with Container.DataItem?

3383


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3623


i don't know about working of nested for loop can any one help me

2014


plzzzzzzzzz xplain this code import java.awt.*; import java.awt.event.*; public class Link extends Frame implements ActionListener { Label l1; Button b1; public static void main(String sr[]) { new Link().setVisible(true); } public Link() { super("Warning"); setSize(500,500); setBackground(Color.lightGray); setLayout(null); l1=new Label("There is no Link"); l1.setBounds(0,0,500,460); l1.setFont(new Font("TimesRoman",Font.BOLD,35)); l1.setAlignment(Label.CENTER); add(l1); b1=new Button("QUIT"); b1.setBackground(Color.orange); b1.setBounds(0,460,500,40); b1.addActionListener(this); add(b1); } public void actionPerformed(ActionEvent e) { this.dispose(); } }

1715


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

3132


Coding for .NET Delegates?

2283


write a program using virtual function to find the transposing of a square matrix?

3093


exception org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJs pException(JspServletWrapper.java:491) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServ let.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717) root cause java.lang.NullPointerException org.apache.struts.taglib.TagUtils.retrieveMessageRes ources(TagUtils.java:1175) org.apache.struts.taglib.TagUtils.message(TagUtils.j ava:1038) org.apache.struts.taglib.bean.MessageTag.doStartTag( MessageTag.java:224) org.apache.jsp.register_jsp._jspx_meth_bean_005fmess age_005f0(register_jsp.java:138) org.apache.jsp.register_jsp._jspService(register_jsp .java:94) org.apache.jasper.runtime.HttpJspBase.service(HttpJs pBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:377) org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServ let.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.j ava:717)

3580


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3255


develop a program to calculate and print body mass index for 200 employees

2410


Write a program that implements a date class containing day, month and year as data members. Implement assignment operator and copy constructor in this class.

689


Code for Two Classes for Doing Gzip in Memory?

2997


How to add a value from textBox over an existing certain column in SQL Server

2465


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

2175


Write a program to model an exploding firecracker in the xy plane using a particle system

3883