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 26739

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 16543

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

Fusion Systems GmbH,

6 11511

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


10 12834

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.


2 5858

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)


7 20533

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 46458

write a program to Insert in a sorted list


4 9345

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 26019

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

Amazon, Adobe, EFI, Imagination Technologies,

13 73604

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


3 12628

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 22630

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 8976

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

2 12969

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 170667

Un-Answered Questions { Code Snippets }

How to run the Result Intemation System project in java for collage student in which result of internal exam marks send on parents mobile using SMS? what software required to run this project? please reply immediately...


how to use the GetTickCount() properly and what is that procedure for?


How to Split Strings with Regex in Managed C++ Applications?


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.


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


How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)


Explain MIDlet Life cycle?


I have this code in leftmenu.ascx on leftmenu.ascx.cs page i want to access id values. but i dont want to check manually like Accommodation,Arts etc.. In cs file my code is like string str[]; //this array contains some values say 10 strings for(i=0;i<100;i++) { if(str[i]==id id.visible=true } i.e.i want to travel for each element of str and each value of id.if they match then id.visible=true how to do?


how to write a program that opens a file and display in reverse order?


I am configuring my anaconda file in linux, i want to use as kickstart file, in post installation how can i edit file or change the content of file and save it.


Common UI for Multiple web applications. Suppose there are 35 websites using same third party controls.These 3rd party controls are made together that all 35 websites can use these controls.If we put all 3rd party controls and use its dll in 35 websites,only class files will be accessable. But I want to use CSS,images also in all 35 websites. how I can design the N-tier solution for this project.


In LSMW , what does the following error mean and how to rectify it : Incorrect interface data for set 78 in method C . This error is occuring in idoc processing step of LSMW.


how to Scroll a DIV content


Create a ViewState Property?


Given a circular list of integers (when you reach the end of the list you come back to the beginning), what is the most efficient algorithm to find the smallest integer in the list? For example: circular_list = [22, 52, 66, 82, 5, 8, 12, 19].