Code Snippets Interview Questions

Write a function, tokenize_string(input_string, delimiter_list) that returns a list of strings that are separated by the delimiters. For example: tokenize_string("How now, Mrs. Brown Cow") returns ['How', 'now', 'Mrs', 'Brown', 'Cow']

1479

Write a function to efficiently convert a floating point number to a rational number. For example, given 0.125 return "1/8"

635

Write a function that takes an unsorted integer array, and returns a three element subset whose sum is zero.

621

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]

1021

Write a function that takes an array of integers and efficiently calculates and returns the Least Common Multiply in python.

605

Write a function that takes as input a binary tree, and prints out each level of the tree on a newline. For example: a / b c / / d e f will output: a b c d e f

731

Write a function that takes an integer and returns the smallest number that is greater than the given number which is a palendrome. For example, if the input was 111 the next palindromic number would be 121.

760

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

780

What is CDC?

1125

What is Telematics?

988

What is the J2ME platform?

1122

J2ME defines two configurations - CLDC and CDC. Explain them

1176

What are profiles in J2ME?

1037

What is Java Community Process (JCP)?

1217

Why does Java strictly specify the range and behavior of its primitive types?

1701

Un-Answered Questions { Code Snippets }

How can you relate the function with the structure? Explain with an appropriate example.

2005

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?

1304

Develop a routine to reflect an object about an arbitrarily selected plane

1906

code to positioning of window in certain dimensions

1053

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

1081

Is there any way to open notepad within php?

1070

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.

1514

1335

How to get Filename from Path?

416

write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

3629

U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)

1438

1075

how to determine which Mouse Button was pressed

1170

A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply. Sample output: Movie Seats Reservation Summary of Seats: Seat 1: Available Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6 The Seat no. is out of range! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 The Seat no. is already reserved! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0 GoodBye... Thank You!!!

851

code to sorting an array of objects

1369