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.

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

20 26753

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

Microsoft, Mentor Graphics,

2 16551

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

Fusion Systems GmbH,

6 11519




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

Microsoft,

10 12839

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 5863

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 20539

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 46476

write a program to Insert in a sorted list

Microsoft,

4 9349

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 26030

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

Amazon, Adobe, EFI, Imagination Technologies,

13 73616

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

Microsoft,

3 12636

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).

TCS, Intel, Microsoft,

12 22641

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 8980

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

2 12974

How to swap two variables, without using third variable ?

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

104 170692







Un-Answered Questions { Code Snippets }

how to insert fname,lname,designation values into database while click on the submit button using windows authentication mode?

1399


Discuss an algorithm to traverse a tree, depth first.

486


Code for Adding Scripting Support to an Application?

1204


Design a timer circuit using VHDL which has the following: input : start_timer(ST) output: long_time(LT) short_time(ST) when the timer is triggered by the ST(either 0 or 1) signal the timer should generate two timing signals accordingly.While the long time is going ON the other should be OFF and vice versa.

1349


advance the focus to next consecutive fields when Enter Key is pressed

1057


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

810


A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

1430


Coding for Synchronizing Cache Access in ASP.NET?

2075


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

1872


code to Hide and Show form controls

1008


How to access oralce10g data from server to client in LAN?

1213


Code for Two Classes for Doing Gzip in Memory?

1808


How to get the version(major,minor,revision ) of VB6.0 delphi code .I am able to fetch dll file of vb6.0 but not vba file .Can u send me the code snippet in delphi to get the value for vb6.0.

2180


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

2600


We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

3096