Code Snippets Interview Questions
Questions Answers Views Company eMail

What are PIDs?

1 2133

How do you write a while loop in shell?

1 1827

How do you remove a file?

1 1914

How do you remove recursively?

1 2034

How do you find out your own username?

1 1961

How do you count words, lines and characters in a file?

1 1926

How do you search for a string inside a given file?

1 1910

How do you search for a string inside a directory?

1 1889

How do you search for a string in a directory with the subdirectories recursed?

1 1792

How do you list currently running process?

1 1894

How do you find out what’s your shell?

1 2100

How do you fire a process in the background?

1 1821

How do you refer to the arguments passed to a shell script?

1 1828

What’s the conditional statement in shell scripting?

1 2293

How do you do number comparison in shell scripts?

1 1980


Un-Answered Questions { Code Snippets }

Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

4383


Write a function that takes an array of integers and returns that array rotated by N positions. For example, if N=2, given the input array [1, 2, 3, 4, 5, 6] the function should return [5, 6, 1, 2, 3, 4]

1843


program for check the given number is prime or not in VB.net

2683


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3414


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






Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7320


1.What happens to a session object when the browser associated with it is closed? 2. Explain what happens when a servlet is sent a POST request? 3. Why does only one copy of a servlet get created? 4. Explain what happens when a browser requests a servlet? (for the first time) 5.How is information stored in a session object?

2033


create a .dll component operation and use created component in another project. required methods events and properties. connect, add,search,data report

2084


Write code to make an object work like a 2-d array?

467


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

1693


i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.

1957


What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }

629


Could u please tell me any UNIX scripts that 'll lead to find the network latency of the servers.?or else any unix command to find the network latency of a server?Thnx in advance...

1690


how to get the User's Time of Day

1659


What is a well formed XML document?

324