Вы находитесь на странице: 1из 3

1.

Verbal test:
a) What's the difference between StringBuffer and StringBuilder
b) What's the diff between a linkedList and arrayList? When would you use each?
2. Language Quiz -Strings
a="hello"; b="hello"; c=new String("hello"); d=c; e=new String("hello");
Tell me the result
a) a==b
b)a.equals(b)
c)a==c
d)c==d
e)c.equals d
f) c==e
g)c.equals e
3. Code time!!!
program a method that returns an inOrder Arraylist of the nodes in a tree
public ArrayList<Integer> inOrder(Node root)
From various interviewers on-site, I was asked:
e
-

Design and implement an iterator for a singly-linked list class.


How would you design a garbage collector?
Given two connected singly-linked lists (giving a T-shaped structure), find th
node where they connect.
Implement a complete singly-linked list class in C++.
Cycle detection in singly-linked lists.
Describe the differences between C++ and Java.
Determine if a binary tree is balanced.
Describe the architecture of the systems of my current employer.
Describe how to maintain data integrity across concurrent reads/writes to/from
a database.
- How to remove duplicates from an array.
- When does it make sense to store a tree ADT in an array?
- How would you organize a data structure used for parsing arithmetic operations
? (Like 3*2 + 4 = 10)
- Write a python script to scan the files in a directory for a word. Return true
if the word is found in at least one file and false if otherwise.
--(I was asked a tree questions, and array pattern search question).
Building Bridges problem-- cities on 2 ends, connect them Answer Question
Balanced Partition problem Answer Question
reverse a byte Answer Question
find if byte a palindrome or not Answer Question
swap consecutive bits in a byte Answer Question
Quick sort, Design Elevator system, Spiral Traversal of a Matrix, BFS, DFS relat
ed
What is the output from this code (assume int is 32 bit)
int f(int n)
{
return n * f(n-1);
}
print(f(100)); View Answers (2)
ALGORITHM (weight: 30%)

A small directory is hard-coded as an array in the code:


String names[] = { "Elon Musk",
"Ken Howery",
"Luke Nosek",
"Max Levchin",
"Peter Thiel" };
A requirement is to be able to extend this directory dynamically at
runtime, without persistent storage. The directory can eventually grow
to hundreds or thousands of names and must be searchable by first or
last name.
1) What approach would you take? (Ans: HashMap)
2) Write an implementation for the add and search methods in pseudo-code
using data structures you have in mind. View Answers (2)
SQL (weight: 10%)
Consider the table below:
table A (
id integer primary key,
name varchar(20),
age integer
)
Write a query to return the list of unique names from table A
CODING (weight: 50%)

View Answers (2)

The string "PAYPAL IS HIRING" is written in a zigzag pattern on a given


number of rows like this: (you may want to display this pattern in a
fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: PAHNAPLSIIGYIR
Write the code that will take a string and make this conversion given a
number of rows:
String convert(String text, int nRows);
convert("paypalishiring", 3) should return "pahnaplsiigyir"
Design strategy of person who drives a truck he/she able to drive car and identi
fy another person which only drives car? Answer Question
String reverse without using method? View Answer
1
1 2 1
1 3 3 1
It took about 5 hours. First round was the IQ tests. (ex: given a stack of penny
, how do you determine if all the pennies can fill this room) Second round was f
inding programming errors on the pre-defined questions from the interviewer. You
need to explained why there are errors and how to fix it. Next was writing code
on white code for C++ exception handling. Then after that, it was the basic mat

h function type question. (ex: given a number 1234, how do you reverse the numbe
r in 4321 format without using string.reverse). Next round is programming design
.( ex: UML). Last round is with the manger. The discussion includes everything a
bove plus oracle DB problems ( ex: indexes, how to do update to the live db tabl
es etc.) The whole interviewing process is long but not terribly hard.
Prepare puzzles well.
1) Odd Ball problem
2) Hourglass problem
Reverse a linked list if you can call it difficult
Algos, data structures, db-sql related
Implement function that revert link list recursive Answer Question
Implement function that inverts all the words whithin a string, each word separa
te with space, notice do not revert the statment just the words. Answer Questio
n
Implement function that Revert the bits within unsigned int, using bit opperatio
n View Answer
You are given a glass bottle which will be broken if thrown from a particular fl
at of 100 story building. What's the efficient way to find that flat. View Ans
wers (3)
Why the manhole is round in shape V
I was asked about time complexity, BST deletion and DFS. Pretty straightforward
stuff.
Questions
How to build a tree using linked list? Answer Question
Design a FSA - Finite State Automaton to perform search Answer Question
Find longest palindrome in a string. Answer Question
What is C++ inheritance, polymophism, overloading/overriding, constructor/destru
ctors, connections to database? A

Вам также может понравиться