Code Snippets 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 45769

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 21372

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

Fusion Systems GmbH,

6 19176

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

Microsoft,

10 23761

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 9951

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 28189

program to Reverse a linked list

Aricent, Microsoft, Ness Technologies,

12 56956

write a program to Insert in a sorted list

Microsoft,

4 13453

Program to Delete an element from a doubly linked list.

College School Exams Tests, Infosys,

4 32128

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

Adobe, Amazon, EFI, Imagination Technologies,

13 85983

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

Microsoft,

3 16502

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 35125

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 13245

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

2 19630

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 222914


Un-Answered Questions { Code Snippets }

an on-line examination application using html jsp servlet and jdbc. including session management and cookies

4457


can any body give me answer to this question please? please give me code in cl with the folling specifications. 1.Accept 2 parameters-date and date type 2.If date type is J then convert date to *MDY format 3.If date type is M convert date to *JUL format 4. Send a program message with the value of converted date? Please give me the answer.Because im practicing in my house.Im taking trining on AS/400.

1898


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(); } }

1576


Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.

3381


What is XML Element?

391






code to images to rollover

1846


Create a Menu that can be activated while clicking on Right Mouse button

1693


what does mbln in mblnrects mean? my boolean?

2425


plzzzzzzzzz xplain this code import java.awt.*; import java.awt.event.*; public class Agency extends Frame implements ActionListener { Label l1,l2,l3,l4; Button b1; TextField t1,t2; String s1,s2,s3,s4; public static void main(String args[]) { new Agency().setVisible(true); } public Agency() { super("Gas Agency Package"); setSize(1280,800); setBackground(Color.lightGray); setLayout(null); // setLayout(new BorderLayout()); t1=new TextField(20); t1.setBounds(440,150,200,30); t1.setBackground(Color.white); t2=new TextField(20); t2.setBounds(440,180,200,30); t2.setBackground(Color.white); t2.setEchoChar('*'); l1=new Label("Gas Agency Package"); l1.setBounds(400,30,300,50); l1.setFont(new Font("TimesRoman",Font.BOLD,25)); l1.setAlignment(Label.CENTER); l2=new Label("Enter your ID and Passoword"); l2.setFont(new Font("TimesRoman",Font.BOLD,20)); l2.setBounds(270,80,300,50); l3=new Label("Enter ID"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l3.setBounds(270,150,120,50); l4=new Label("Enter Passoword"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l4.setBounds(270,180,140,50); add(l1); add(l2); add(l3); add(t1); add(l4); add(t2); b1=new Button("Login"); b1.setBackground(Color.white); b1.setBounds(400,280,100,70); b1.addActionListener(this); add(b1); } public void actionPerformed(ActionEvent e) { if(e.getSource()==b1) { s3="svce"; s4="svce"; s1=t1.getText(); s2=t2.getText(); if(s1.equals(s3) && s2.equals(s4)) { //System.out.println("password is correct"); MenuForm m= new MenuForm(); m.setVisible(true); //this.dispose(); } else { System.out.println("password not correct"); } this.dispose(); } } } plzzzzzzzzz xplain this code

1536


What is the coding about how to recognize color in fuzzy logic using Matlab R2009b?

1563


Which framework is best in php among Smarty, Cakephp, Joomla, Drupal, Zend or Something else...? If any then Why?

8014


What are nested elements in XML?

343


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2382


Can we run Applet in Web browser with security policy files

2070


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3250