Bloomberg LP Interview Questions
- 0of 0 votes
AnswersWhat is the difference between static and global variable in C?
- deepakpraykar February 13, 2012 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer - 0of 0 votes
Answersclass Empty {};
- JeffD January 29, 2012 in United States
Empty e;
What is generated for e? If you look at it in a debugger what will you see?
(This was actually Solomon Page, on behalf of BBG.)| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersWrite a function to create an mirror image of binary tree
- theval January 21, 2012 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersWhat is wrong with the following code
- Anonymous December 28, 2011 in United States
char * test(int v)
{
char buf[6+1];
switch(v)
{
case 1: strncpy(buf, "Case 1", sizeof(buf));
case 2: strncpy((buf,"Case 2", sizeof(buf));
case 3: strncpy((buf, "Case 3", sizeof(buf));
case deafult: strncpy((buf, "Default", sizeof(buf));
}
return &buf;
}
int main()
{
char * p = test(2);
cout << p << endl;
}
Now one obvious answer is that they are trying to return address of a local variable. Then the question is how to solve this problem without changing the prototype of the function. Global variable and static variable are not the right answers| Report Duplicate | Flag | PURGE
Bloomberg LP C++ - 0of 0 votes
AnswersHow to design a good hash function if the key is a person`s name
- miracle2121 November 23, 2011 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 1of 1 vote
AnswersThere are 10 boxes of apples. Each apple in the boxes weights 1 pound, except that one of the boxes contains bad apples, which weights 0.9 pound each. You are given a digital weight (not a scale), and you can take apples out of the boxes. what is the minimum time of weighs to find out which box has bad apples?
- miracle2121 November 23, 2011 in United States
I gave one solution of 3 times using divide and conquer, but the interviewer said that 1 step is possible. So I couldn`t come up with the solution.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Brain Teasers - 0of 0 votes
AnswersGiven constant integers x and t, write a function that takes no argument and returns true if the function has been called x number of times in last t secs.
- topgun.in October 27, 2011 in United States for R&D| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 1of 1 vote
Answers- Scrollable is an interface
- Nish October 25, 2011 in United States
- Writable is an interface
- TextScreen is an abstract class
- Videoscreen is a class that extends TextScreen and implements both Scrollable and Writable
in the scenario above which of the following statements is always true
a. A VideoScreen object cannot be passed to a method that expects a Writable
b. A Scrollable object can be cast to produce a VideoScreen
c. A VideoScreen object cannot be passed to a method that expects a TextScreen
d. VideoScreen can be cast as a Scrollable
e. A VideoScreen cannot be passed to a method that expects a Scrollable| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Java - 0of 0 votes
AnswersGiven an Array A={-2,4,30,-50,90,-60,100,120}
- cmsuraj007 October 20, 2011 in United States
The array index represents time of day.
Say 0-9 A.M, 1- 10 A.M....etc
And value represents stock price at that time.
Get the max profit. i.e in this input,
best buying price=-60
best selling price=120| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Arrays - 0of 0 votes
AnswersExplain STL maps- Hash tables and buckets.
- cmsuraj007 October 20, 2011 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 0of 0 votes
Answersgiven the following inheritance scheme
- cinderella September 16, 2011 in United States
class A
{
}
class B : public A
{
}
class C : public A
{
}
class D : public C
{
}
Given a function
static void foo(C * obj)
{
}
which one of the above defined classes' pointer can be passed into the function foo()| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 1of 1 vote
AnswersDesign a hashtable, you have 1000 items, how many slot would you choose. why.
- Bill September 10, 2011 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWhat does IDL stands for ?
- dhaval0129 July 26, 2011| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerWhat is IDL?
- dhaval0129 July 26, 2011
a.) International Document Language - a language-independent text format for transmitting documents
b.) Independent Device Layer - a software abstraction that sits on top of different hardware presenting a uniform interface
c.) Interface Definition Language - a programming-language-independent method for defining object interfaces
d.) Internet Dialup Layer - a communications layer that manages TCP/IP connections over a modem link
e.) Image Definition Language - a graphics definition language for defining portable images| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersConnection cn;
- dhaval0129 July 26, 2011
String queryStr;
// .. Code to open the connection and create a query not shown
cn.setAutoCommit(false);
cn.executeQuery(queryStr);
// *** Line A
In the code above, which one of the following substitutions for Line A writes the query results to the database?
a.) cn.update();
b.) cn.flush()
c.) cn.executeQuery("TRANSACTION END");
d.) cn.commit();
e.) cn.rollback();| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerFilePermission fp=new FilePermission("/tmp/110115.tmp","write");
- dhaval0129 July 26, 2011
AccessController.checkPermission(fp);
What happens if the code above is run from a thread that has NOT been granted access to the /tmp directory?
a.) The runtime system presents a browser dialog to the user.
b.) The virtual machine exits.
c.) The call to AccessController throws an AccessControlException.
d.) The runtime system terminates the thread that called AccessController.
e.) The call to AccessController returns false.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersBufferedImage im=
- dhaval0129 July 26, 2011
new BufferedImage(100,200,BufferedImage.TYPE_INT_RGB));
Graphics2D gc= im.createGraphics();
Where is the origin (0,0) of the image created above?
a.) In the center of the image
b.) In the top left corner
c.) In the top right corner
d.) In the bottom left corner
e.) In the depends on the AffineTransform in effect| Report Duplicate | Flag | PURGE
Bloomberg LP - 0of 0 votes
AnswersWhat is the main purpose of Java servlets?
- dhaval0129 July 26, 2011
a.) They allow browsers to upload intelligent search agents to a Web server.
b.) They allow resource-limited devices such as printers or embedded systems to respond to http requests.
c.) They allow Java programs to access back-end databases such as Oracle and Sybase.
d.) They allow for generation of dynamic content and processing of user input on the Web.
e.) They handle the communications protocols required to send applets to Web browsers.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerWhich statement below describes a class that implements the Enumeration interface?
- dhaval0129 July 26, 2011
a.) It has implementations of the toString() and getNextString() methods.
b.) It is a subclass of Vector.
c.) It contains implementations of the hasMoreElements() and nextElement() methods.
d.) It can be used to store associative arrays.
e.) It can work with the StringTokenizer class.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersHow do you get a reference to the system clipboard?
- dhaval0129 July 26, 2011
a.) java.awt.Toolkit.getDefaultToolkit().getSystemClipboard()
b.) Java can't get access to the clipboard.
c.) new java.awt.datatransfer.Clipboard()
d.) System.lang.ClipBoard
e.) java.awt.datatransfer.Clipboard.getDesktopClipboard()| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersWhat is an RMI "stub"?
- dhaval0129 July 26, 2011
a.) It is used by the client to find remote objects on a server.
b.) It acts as a client-side proxy to receive RMI calls and pass them to the server.
c.) It enables applets to make RMI calls without violating browser security.
d.) It receives RMI calls from the server to enable applet callbacks.
e.) It is the interface implemented by both the client and server objects.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersWhich one of the following correctly describes the function of a bean's home interface in EJBs?
- dhaval0129 July 26, 2011
a.) It maps Java types to underlying database types.
b.) It defines how to create, find, or remove the bean.
c.) It defines all of the beans public methods.
d.) It is the container for the bean and it manages transactions.
e.) It interfaces to a naming service to allow remote objects to lookup the bean.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerWhich interface is intended to supersede Enumeration in the collections framework?
- dhaval0129 July 26, 2011| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
Answersclass SuperClass {
- dhaval0129 July 26, 2011
private void printIt() {System.out.println("SuperClass");}
void printIt(boolean f) {
if (f) {
System.out.println("Super-part 2");
} else {
printIt();
}
}
}
class SubClass extends SuperClass {
void printIt() {System.out.println("SubClass");}
}
public class TestSub {
static void main(String args[]) {
SubClass sc=new SubClass();
sc.printIt();
sc.printIt(false);
}
}| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
Answers// *** Line A
- dhaval0129 July 26, 2011
package com.brainbench.TestExamples;
// *** Line B
import java.io.*;
// *** Line C
public class DocumentationSample
// *** Line D
implements Serializable {
// *** Line E
// .. Code not shown ..
}
In the code sample above, where must you place a documentation comment that describes the purpose of the class DocumentationSample?| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
Answerspublic class ArrayTest{
- dhaval0129 July 26, 2011
public static void main(String[] args){
// insert code here
}
}
Given the above sample code, what do you insert to print out a list of the command-line arguments?
a.) for(int i=0; i<args.getLength(); i++)
System.out.println(args[i]);
b.) for(int i=0; i<args.size(); i++)
System.out.println(args[i]);
c.) for(int i=0; i<args.length(); i++)
System.out.println(args[i]);
d.) for(int i=0; i<args.length; i++)
System.out.println(args[i]);
e.) for(int i=0; i<sizeof(args); i++)
System.out.println(args[i]);| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
Answers<%@ page language="java" import="java.io.*" %>
- dhaval0129 July 26, 2011
<HTML>
<BODY>
The browser's IP address was:
<%-- *** Line A *** --%>
</BODY>
</HTML>
When substituted for Line A in the JSP code above, which one of the following lines displays the browser's IP address?
a.) <%= session.getRemoteAddr() %>
b.) <%= request.getRemoteAddr() %>
c.) <%= application.getRemoteAddr() %>
d.) <%= page.getRemoteAddr() %>
e.) <%= response.getRemoteAddr() %>| Report Duplicate | Flag | PURGE
Bloomberg LP Java - -1of 1 vote
Answerspublic double SquareRoot( double value ) throws ArithmeticException
- dhaval0129 July 26, 2011
{
if (value >= 0) return Math.sqrt( value );
else throw new ArithmeticException();
}
public double func(int x) {
double y = (double) x;
y *= -9.0;
try {
y = SquareRoot( y );
}
catch(ArithmeticException e) { y /= 3; }
finally { y += 10; }
return y;
}
Referring to the above, what value is returned when method func(9) is invoked?| Report Duplicate | Flag | PURGE
Bloomberg LP