Important Questions
Important Questions
Highlight Rules:
Repeated Question Question Asked More then 40% Interviews
Unique Question Question Asked Only in That Interview
S .No Topic
1 Solid Principles
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Reading Material
Link Rating
http://www.codeproject.com/Articles/703634/SOLID-architecture-principles-using-simple-Csharp
Good
Please Add Questions Here.
Company Question
e Add Questions Here.
Answer
Interview #
3
Question
Write a program to remove all duplicates from a 2d array of characters. Try to come up with a solution
which
Write asolves the which
program problem in 0(n),
returns truewhere
if the ninput
is the number
array of elements
of characters in the a2dduplicate
contains array else returns false.
Solve the problem in 0(n) time
Implementation of Tries (also called Prefix Tree) and complexity of operations on it
Implementation of Binary Tree and complexity of operations on it
Given
Given a file of
a file of size
size 30
10GBGB,containing
which is stored
stringsondelimited
your disk,
byhow would
spaces, you
find thesort that fileof all prefixes that can
frquency
Design
be made pattern scenario based questions. Scenarios were made out of real use cases of careem app -
What is afrom
Most important
the?strings
thread How ittoin
patterns
that
isknow file from a process ? For what kind of operations
different
are Observer pattern, MVC, Adapter pattern, Singeleton will youpattern,
make aStrategy
thread ?
What are the consequences of making too much threads ? What is meant by thread
pattern, Facade Pattern and Factory Method. SOLID design principles, Dependancy Injection and 2 safety ?
practical
OOP basic examples
conceptsof-that
Abstraction, Encapsulation, Information Hiding, Polymorphism, Delegation,
Inheritance, Abstract
Basic Database classes,
concepts Interfaces,
- Functional Generics/Templates,
dependencies, Access
Normalization specifiers,
(1NF, 2NF, 3NF, BCNF), ERD , SQL
joins, Indexes, Database connection pool, Foreign keys, Primary Keys, Uniqueness constraint
Basic concepts like how a does a client communicates with the server
What REST (Representational State Transfer) is ?
What
If you are
havepush notifications
mentioned andon
Android how they
your work ?then be ready for a lot of android platform specific
resume,
questions
eyga. hashing kr do .he asked acha agr collision aye tou i said separate chaining use kr lo us me bhi traverse krna hoga but significantly kam
traverse a linked list with odd number of node only once and tell the
value of middle element
1. FYP
5 2. language used in fyp
3. other languages used
4. rate your database skills out of 10
5. rate your oop skills out of 10
6. abstract and interface
7. static and non static variables
8. favorite language
9. types of polymorphism in c#
10. templates in c#
11. static ko access kaise krtay hai
12. bhot saari classes aik class ko access kr rahi ho to kya
hoga? variables ki value change hongi ya nae?
13. singleton ka code
14. Car bike airplane ki classes ko singleton kaise kr sktay
hai?
15. array mai se odd integers nikal ke doosray array mai copy
krnay ka code its complexity in the case of sorted or unsorted
16. trees kitnay types ke parhay hai?
17. data structures kitnay types ke parhay hai
18. load balancer kya hota hai? kaise kaam krta hai
19. agr aik pc ko access nae mil raha baki saaro ko cloud ka
access mil raha hai to uska kya matlab hai?
20. is room mai dusters kaise fit karo gay
21. sealed class kya hoti hai
22. your role in fyp
23. matlab kyun use kia
24. folio 3 se kya expect kartay ho?
25. fast ka area kitna hoga in kilometres
26. fast mai kitni cs buildings place kr sktay hai?
27. computer science mai sb se achi cheez kya lagi apko
FYP in detail
6 OOP:
1.what is abstract class?
2.abstract class vs interface
3.java mein multiple inheritance kio nae hti?
4.kia hum abstract class mein definition de sakty hy functions
ki?
5.diamond problem kia hti hy?
6.kistrah solve kartay hy ?
class A{
public:
A (){
cout << "cons A" << endl;
}
virtual void print(){
cout << "A" << endl;
}
};
class B: public A{
public:
B (){
cout << "cons B" << endl;
}
virtual void print(){
cout << "B";
}
};
class C: public A, B{
public:
C (){
cout << "cons C" << endl;
}
virtual void print (){
cout << "C";
}
};
int main ()
{
C c;// konsa constructor call hga ? konsa baad mein hga
c.print();// kis ka call karega function?
return 0;
}
7.polymorphism kia hy?
8.overloading kia hy?
9.overriding kia hy ?
class A{
};
class B: public A{
};
A a=new A();
B b= new B();
A c = new B();
kia yai 3ino theek hy?
power ka code using recursion
what is aggregation, composition explain with example.
10.logical question
OS:
11.OS parhi haina?
12.multiprocessing ka idea hy?
13.mutex kia hta hy? kio use kartay hy?
14.semaphore kio use karty hy?
15.critical section hti kia hy? code mein kese hti hy? kia hta hy uske
andar?
Design Patterns:
16.patterns parhe hy?
17.singleton kia hta hy?
code likho
Data structure:
18.linked list kia hti hy?
19.stack ko linked list s implement karo.
20.hash map kia hty hy?
21.complexity btao hash map ki?
22.search in a link list ki complexity kia hti hy?
Database:
23.ERD bnao university, teacher, student, course
relation define karo
24.join kitny trah k hty hy?
25.self join kia hta hy?
example de skty hy self join ki?
26.aik self join dia
ID Name ManagerID
1 Ali 2
2 Iqbal NULL
ismein Manager k name print kar k dou.
27.upar jo erd bnai hy ismein s konse bachay ny sab s zayda
course uthaye huay hy ?
aur second highest kis ny courses liye huay name print karo.
28.candidate key kia hti hy ?
29.primary key kia hti hy?
30.super key kia hti hy?
31.composite key kia hti hy?
32.kia foreign ki hamesha unique hgi?
33.kia composite key hamesha unique hgi?
34.Normalization kio kartay hy?
35.kia normalization k koi drawback b hty hy?
36.indexing kia hti hy?
37.indexing kio use kartay hy?
38.kitni trah ki hti hy?
39.triggers kia hty hy?
40.store procedure kia hty hy?
- if primary key contain unique values to primary key kyun bane jab
kai unique key hai to ? (B/c primary does not contain null values)
- Erd of scenerio (library sai related tha) and us par ek query)
- What is data structure?
- What is design patterns?
- What is Data mining?
- Difference between OOP and OOAD?
- Write Program to reverse string (recursively)?
- Singleton , MVC ,Abstract along with examples
- MVC mein business logic kahn bante hai ?
- What is businees logic?
- Stored Procedure vs function ? Where to use them ?
- What are views? Where to use them ?
- Compostion and Aggregration with examples
- Session vs Cookies (Mujhe nhn ata tha)
- SDLC
- Unit Testing
- Sare projects skim kiye cv pe bari bari pucha jo inhain achai lage
- Teaching ke ke kya faida hwa in improving skills
- websolutions wali job kyun chori
- sab se zyada kaam kis pe kia he?
Acha bhae ab oops pe ajate hain
- Operator vs Function overloading?
- Function overloading vs Function overriding?
- Example de kar samjhain overrriding?
- Polymorphism kya hoti he
- interfaces and abstract classes
- why interfaces then? kyun use karun main?
- access modifier (public, private, protected)
- code likha purai page pe classes main inheritance ho rahi thi,
different scenario btai pucha kab kya output aiga, error ka btaya to
maan nhi rahe thai pahlai end main acknowledge kardia ke haan
error aiga
- constructor btao, default and parametric
Scenario 1:
Pahlai context switching ki baatin puch li thin
Aik object he ismain 100 members hain humhain iski state save
karwani ho kahlo koi game he phir baad main loading main is ko
restore karwana he? kaise karoge?
- static class, static function, static member
- code lika our ispe sawal kiye
- heap, stack and code section our kahan hote hain
- Local var kahan store hota hay
- design pattern nhi parha? chalo singleton to likh dain
- stored procedures kya hote hain, kyun use karun, faida btao
- binary search btao
- array vs linklist
- difference between aggregation and composition
- c# main multiple inheritance nhi hoti magar phir bhi koi tariqa he
karne ka aik btaya to dusra pucha
- session and cookie
- browser main cookie disable kardun ab? kaise session maintain
karoge?
- acha post get ka difference btao
- web pe kaam kia he na example btao kahan kahan use kia our
konse senario main konsa better he?
- craglist ki web main tumnai get lagaya tha user ko ise kya faida?
- credential ko through post hi karun?
- soap and rest, web services, api bla bla
- jis project main web service banai thi wo samjhao
- indexes, faida btao?
- table and virtual table ka diff?
- function and store procedure ka diff?
Scenario 2:
Humhare pas aik table tha hum har dafa 3 se 4 queries lkhte hain
ismain magar aik querry nhi chali ab kya karen? database
inconsistant hojaiga jab dobara chalo ge wohi queries? kaise masla
hal hoga?
Commit kaha tumnai, roll back kaha, transaction kaha sabko explain
karain
Database schema banaya queries likhwaen 2 aik main join lag raha
tha aik main nhi, phir is main se hi 4 scenarios diye our is main 4
result btane thai
Inner join se
left join
right join
full outer join
cross join our outer join ka difference btao
Phir last main 9 balls wali game puchi 2 times main karo lighter
btao.
Phir discussion ki, maina sawal pucha what to see when choosing
first job
Mujhse pucha kahan kahan interview diya, kaafi guide kia.
Folio3 TEST not Interview
17 coding:
Database:
- cottage problem
• Maintainability
• Reusability
1.Abstraction
Abstraction is a process of exposing essential feature of an entity while hiding other irrelevant detail.
2.Encapsulation
Binding of data and code together while hiding the information is called encapsulation.
3.Inheritance
The ability of creating a new class from an existing class
4.Polymorphism
Function overloading and overriding
With abstractions you represent notions and ideas, rather than the concrete way these ideas are implemented.
An abstract class is a class which is declared abstract and can not be instantiated but they can be subclassed.
Abstract Class:
1 - An abstract class can have method body (non-abstract methods).
2 - An abstract class can have instance variables.
3 - An abstract class can have constructor.
4 - An abstract class can have static methods.
5 - You can extends one abstract class.
Interface:
1 - Interface have only abstract methods.
2 - An interface cannot have instance variables.
3 - Interface cannot have constructor.
4 - Interface cannot have static methods.
5 - You can implement multiple interfaces.
- The compilation process where source code is complied to machine code is know as complie time.
- When a complied program is being executed, it is known as runtime.
Compile time per
Runtime per
The short answer is that early (or static) binding refers to compile time binding(Overloading) and late (or dynamic)
binding refers to runtime binding (for example when you use reflection) (Overriding).
Overloading :
- When multiple function with same name but different signatures are defined.
Overriding :
- Same function in child class with different implementation
output: [0]=> the quick brown fox // ab is mai 19 characters hai screen size 20 hai aik aur word add karega to 20
ko
1 8 27 ? 125 216 yeh wala yaad hai mujhay aur bhi thay
exceed kar jayega to tu naya string bnayega
naya string bnayega
Interview # Question
1 1-FYP description
2- FYP erd n how data is saved
3- query on fyp db
3- 4 pillars of OOP
4- overloading n overriding
5- singleton
6- using one for loop join two sorted arrays.
After that 15 min HR interview.
3. polymorphism
4. code to find the duplicate letter in a string
5. link list
6. binary tree
7. depth first search
8. breadth first search
9. agar tree infinite bara hy hoskta hy woh depth mein ho and breadth mein ho tu
kese search karoge element?
10. what is OCR?
11. Diamond Problem? solution?
HR Interview hua 30mins ka.
System's Interview Questions
6 HR interview is going to be in english , so be prepared wink emoticon
Technical-
Fyp related question , libraries , functions etc jo jo kia hai
oop basics
oop Pillars
Polymorphism types , overriding , overloading
Prime numbers code
Session , cookies ,
how to maintain state in web application
truth table ki if then else statement , basically he wanted to see optimized code , but he
didnt ask for me , so agar koi bht easy question ajae to try to write optimized code , not
dirty working code
overloading ki return type change kr den to ???
derived class d = new base(); possible or not , benefits , i asked sir rafi , it is possible but
agar derived ka destructor call hogaya to base ka destrusctor call hone se reh jae ga ,
do check urself ,
-----------------------------------------
Table A has a,b,c .... Table B has 1,2,3
Select * from A,B.... what will be the result !!...
result a1,a2,a3,b1,b2,b3 -> its the query for the cartesian product
------------------------------------------------
Systems 1st Interview Questions
7 1) What are distributed Systems why do we need them.. What are disadvantages
2) What is Cluster
3) Socket Programming k baray me Questions
4) Questions on threads
5) What are Function Signatrue
6) Access modifiers .. What is their use
7) Extends keyword
8) Difference between runtime and compile time errors, how to avoid runtime errors
9) What is JIT
10) Define the use of interface
11) How much have you used database..
12) Explain all types of Join
13) What is Association
14) What is Composition
15) What is the name of Amazon EC2 cloud.. Microsoft? IBM?
16) Name microsoft's Cloud Service
17) Have you used any cloud ?
18) Explain Design Patterns (Shit mene to course hi nahi liya tha :P)
19) Does java support passing by reference?
20) Use of Super in java
21) can a thread be called .start() twice ?
22) what is singleton.....
Answers
-
-
-
https://standardofnorms.wordpress.com/2012/09/02/4-pillars-of-object-oriented-programming/
In this table, the asymptotic notation O(f(n)) means "not exceeding some fixed multiple
of f(n) in the worst case."
Interview # Question
(http://en.wikipedia.org/wiki/Search_data_structure) and also
(http://en.wikipedia.org/wiki/Best,_worst_and_average_case)
Asymptotic amortized worst-case analysis
Unsorted array
Sorted array
Unsorted linked list
Sorted linked list
Self-balancing binary tree
Heap
Hash table
Trie
1 Explain Your FYP.
Explain Inheritance.
What is Virtual Function and describe its advantages.
what is Hash Functions and how we can enter values in hash table.
what is Dictionary.
write a code for Binary Search Tree.
You have an array write a code to find whether the given value is in the array or not.
define its complexity.
can its complexity be reduced? write a code.
writehave
you recursive code
a store for this
in which case.
there are 3 entities a) store. b) product. c)category. create
erd diagram.
there are multiple stores write a query to write all the category names for each store.
How would you create a class of Hash Table?
Write a code to find the largest contiguous sum in an array
Write a code to find whether a string is palindrome or not
public class A {
void method(){
System.out.println("Class A");
}
}
public class B extends A {
void method(){
System.out.println("Class B");
}
int method(){
return 1;
}
}
main(){
// Output the following
A a = (B) new A();
A a1 = (A) new A();
A a2 = (A) new B();
B b = (B) new A();
}
Dictionary(key,value) where key is an object of class A and B previous class. Do we have to
take care of something to use Object as key ?
Given two sql statements which should be executed in in single transaction apply try catch
block.
try{
}catch(e){
}
finally{
//close Database Connection here
}
what happens when something went wrong while closing connection.
Write a function for validating en email address.
What is the complexity of the following
for(int i=0; i< array.length; i++)
{
//some work on whole array here
}
What is the complexity of the following
function f(){
for(int i=0; i< array.length; i++)
{
//some work on whole array here
}
for(int j=0; j< array.length; j++)
{
//some work on whole array here
}
}
What is the difference between factory method and abstract factory pattern.
if you want to perform fastest insertion which data structure you will use
How does run-time binding happen? Whats a virtual table? How does it work?
10 What is a Hash code ?//I said I forgot. He said daikh leina. Yh pata hona chahiyh
11 In sorting algorithms what can be the lowest worst time complexity
12 What will be the time complexity to Search a number in an array
13 What if that array is sorted ? Will it help to lower the complexity?
14 Can you make the searching part better ?
11-14 ----- Iss main woh kaafi ooper se araha thay.
15 Design Pattern parha hay?
Me: Jee sayed yousuf parha rahay hain
He: Tumhari uni main k students ko daikh k toh nhi lagta k unn k students hain
(Bezzati hogyee)
16 Singleton ka code likho
17 Threading ka issue ayega ? . Kesey resolve karogey ?
18 Type of joins?
19 Self join use kar k btao?
20 Doubly aur Singly linked list main differences btao
21 Linked List reverse karnay ka code likh saktay ho?
Me : Yess
He : Likhdo
22 Singly linked list ko reverse karnay main issue kia hay?
23- OOP, DS, DB, DP hogyaa. Theek hay.. Interview hogya hay tumhara
Workforce final interview/discussion with director
1. Aik external library use kr rae ho usme bugs hain i/o p error deta. Usko apne pas
use krna h tmko to kia kroge k sahi chale and crash na ho
2. OS ki batain
Goto vs func call in os
Aik code kese work.krega
Dynamic bind and late bind using external libraries and local code + .class file m late
bind kese show hoga
.class ki batain kia hota kese hota code execute kese hota etc
3. Workforce k baare m kia jante ho.
4. Expected salary
Baqi normal sawal k apne bare m btao plans btao etc
Workforce 1 hour 30 mins interview
6 1 - Explain your FYP.
2 - What's your part in FYP.
3 - Model the following using OOD:
- Forest (Consist of tree)
- Mango Trees
- Apple Trees
4 - public class A {
void method(){
System.out.println("Class A");
}
}
public class B extends A {
void method(){
System.out.println("Class B");
}
int method(){
return 1;
}
}
main(){
// Output the following
A a = (B) new A();
A a1 = (A) new A();
A a2 = (A) new B();
B b = (B) new A();
}
5 - Dictionary(key,value) where key is an object of class A and B previous class.
What we have to take care of something to use Object as key ?
6 - How BFS and DFS works.
7 - Space and time Complexity of BFS and DFS.
8 - What is a thin and thick client?
9 - When to use transactions ?
10 - Given two sql statements which should be executed in in single transaction apply
try catch block.
11 - try{
}catch(e){
}
finally{
//close Database Connection here
}
what happens when something went wrong while closing connection.
12 - Write a function for validating en email address.
13 - What is the complexity of the following
for(int i=0; i< array.length; i++)
{
//some work on whole array here
}
14 - What is the complexity of the following
function f(){
for(int i=0; i< array.length; i++)
{
//some work on whole array here
}
for(int j=0; j< array.length; j++)
{
//some work on whole array here
}
}
16 - What is the complexity of the following:
for(int i=0; i< array.length; i++)
{
for(int i=0; i< array.length; i++)
{
//some work on whole array here
}
}
17 - Which design patterns have you studied?
18 - When there could be a problem while using singleton pattern.
19 - What is the difference between factory method and abstract factory pattern.
20 - Explain Android life cycle.
1-
7 how to detect if a linked list is circular, without going through all the nodes?
2-
code of singleton.
3-
classA
{
func 1(){}
func2(){}
};
classB
{
func2(){}
func3(){}
};
main()
{
A a= new B();
a.fun2(); // ????
}
1- Explain Your FYP.
8 2- Explain Inheritance.
3- What is Virtual Function and describe its advantages.
4- what is Hash Functions and how we can enter values in hash table.
5- what is Dictionary.
6- write a code for Binary Search Tree.
7- You have an array write a code to find whether the given value is in the array or
not.
8- define its complexity.
9- can its complexity be reduced? write a code.
10- write recursive code for this case.
11- you have a store in which there are 3 entities a) store. b) product. c)category.
create erd diagram.
12- there are multiple stores write a query to write all the category names for each store.
Workforce 30-45mins interview
9 Oop concepts:
Composition
Abstraction
Abstraction with casting
DS concepts:
Complexities
Sorting Algos
Code:
Anagram ka code
String to int ka code
Code ko efficient bnana
Design Patterns:
Singleton etc
1. Complexity of linear Search
10 2. Complexity of Binary Search
3. Can we apply binary search in link list
4. Where local variable will be declared ? stack or heap ?
5. If you want to search a name which data structure you will use? hash map, hash
table or dictionary.
6. what is the difference b/w stack and queue
7. if you want to perform fastest insertion which data structure you will use
Answers
Insert Delete
O(n) O(n)
O(n) O(n)
O(1) O(1)
O(1) O(1)
O(1) O(1)
O(1) O(1)
Dictionary is an abstract data type composed of a collection of (key, value) pairs, such
O(1)
that each possible key appears just once in the collection.
O(1)
In object-oriented programing (OOP) inheritance is a feature that represents the "is a"
O(m) O(m)
relationship
Operations
// initiallyit calledbetween
associated different
with low with
= 0,thisclasses.
data
high Inheritance
type
= N-1 allow allows a class to have the same
Explain
behavior as another class and extend or tailor that behavior to provideclass
special
BinarySearch(A[0..N-1], value, low,
It is a function whose behavior can be overridden withinhigh) { an inheriting by aaction for
function
specific
the
withaddition
//the needs.
invariants:
same (http://www.webopedia.com/TERM/I/inheritance.html)
of signature.Advantages
pairs to >the
value collection
A[i] for all i <on
lowlink below
the removal ofvalue pairs<from theall
A[i] for collection
i > high
(http://stackoverflow.com/questions/2391679/why-do-we-need-virtual-methods-in-c)
the modification
if (high < low)of the values of existing pairs
the lookup return ofnot_found
the value associated
// value would withbea inserted
particularatkey
index "low"
for(int
String =i=0;i<arr.length;i++)
(http://en.wikipedia.org/wiki/Associative_array)
midoriginal,(low +reverse
high) / 2= "";
{ Scanner
ifif(arr[i]==no_to_find)
(A[mid] in >= value)
new Scanner(System.in);
http://algs4.cs.princeton.edu/32bst/BST.java.html
{ return
cout<<"no found at index==>"<<i<<endl;}
BinarySearch(A, value, low, mid-1)
}else if (A[mid] < value) a string to check if it is a palindrome");
System.out.println("Enter
N original return=BinarySearch(A,
in.nextLine(); value, mid+1, high)
else
Yesint using
return
length binary
mid search but array must be sorted
= original.length();
}(http://rosettacode.org/wiki/Binary_search)
Make foras ( int
you i =wish
length - 1; i >= 0; i-- )
reverse = reverse + original.charAt(i);
depends on your erd
if (original.equals(reverse))
http://www.algolist.net/Data_structures/Hash_table/Simple_example
System.out.println("Entered string is a palindrome.");
http://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
else
System.out.println("Entered string is not a palindrome.");
local varaibles are created at stack (
http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html )
Stack is LIFO (Last In First Out) the last element you entered would be accessed first
and Queue is FIFO (First in first Out) the element you entered first would be accessed
first.
For a virtual function you need to provide implementation in the base class. However
derived class can override this implementation with its own implementation. Normally ,
for pure virtual functions implementation is not provided. You can make a function pure
virtual with =0 at the end of function declaration. Also, a class containing a pure virtual
function is abstract i.e. you can not create a object of this class.
Describe your role
to be determined
to be determined
to be determined
BFS explores/processes the closest vertices first and then moves outwards away from
the source. Given this, you want to use a data structure that when queried gives you the
oldest element, based on the order they were inserted. A queue is what you need in this
case since it is first-in-first-out(FIFO). Whereas a DFS explores as far as possible along
each branch first and then bracktracks. For this, a stack works better since it is
LIFO(last-in-first-out) (http://stackoverflow.com/questions/3929079/how-can-i-
remember-which-data-structures-are-used-by-dfs-and-bfs)
BFS:
Time complexity is O(|V|) where |V| is the number of nodes,you need to traverse all
nodes.
Space complecity is O(|V|) as well - since at worst case you need to hold all vertices in
the queue.
DFS:
(*) Note that the space complexity and time complexity is a bit different for a tree then for
a general graphs becase you do not need to maintain a visited set for a tree, and |E| =
O(|V|), so the |E| factor is actually redundant.
(http://stackoverflow.com/questions/9844193/what-is-the-time-and-space-complexity-of-
a-breadth-first-and-depth-first-tree-tr)
A thin client (sometimes also called a lean, zero or slim client) is a computer or a
computer program that depends heavily on another computer (its server) to fulfill its
computational roles. A fat client (also called heavy, rich or thick client) is a computer
(client) in client–server architecture or networks that typically provides rich functionality
independent of the central server. Originally known as just a "client" or "thick client
(http://en.wikipedia.org/wiki/Thin_client &&&&& http://en.wikipedia.org/wiki/Fat_client)
Transactions should be used when there is the possibility that either failure to complete
or someone else reading or writing in the middle of your task could cause damage to the
data. These include but are not limited to:
BEGIN TRY
UPDATE [Test].[dbo].[T1]
SET [Title] = N'az2' ,[AVG] = 1
WHERE [dbo].[T1].[Title] = N'az'
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION [Tran1]
END CATCH
GO
to be determined
n
n
n^2
tell your studied pattern
In multithreading there can be a deadlock
http://stackoverflow.com/questions/5739611/differences-between-abstract-factory-pattern-and-factory-method
http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for
class Singleton
{
private static Singleton _instance;
// Constructor is 'protected'
protected Singleton()
{
}
return _instance;
}
}
o(N)
O(log(n))
yes you can use skip list
(https://msdn.microsoft.com/en-us/library/ms379573(v=vs.80).aspx)
already answered above
Dictionary
Alredy answered above
binary search tree (http://stackoverflow.com/questions/17647607/what-data-structure-
supports-fast-insertion-deletion-and-search )
Balance Get at index Search Find minimum Find maximum Space usage
N/A O(1) O(n) O(n) O(n) O(n)
N/A O(1) O(log n) O(1) O(1) O(n)
N/A O(n) O(n) O(n) O(n) O(n)
N/A O(n) O(n) O(1) O(n) O(n)
O(log n) N/A O(log n) O(log n) O(log n) O(n)
O(log n) N/A O(n) O(1) O(n) O(n)
O(n) N/A O(1) O(n) O(n) O(n)
N/A O(n) O(m) O(m) O(m) O(n)
Interview # Question
Set Datastructure
Mutable and Immutable
Builder Design Pattern
Logical Question 1 :
There are three boxes, one contains only apples, one
contains only oranges, and one contains both apples and oranges. The
boxes have been incorrectly labeled such that no label identifies the
actual contents of the box it labels. Opening just one box, and without
looking in the box, you take out one piece of fruit. By looking at the
fruit, how can you immediately label all of the boxes correctly?
Logical Quesiton 2: You have to measure exactly 4 liters of water, but you only have a 3-
liter bottle and a 5-liter bottle.
How do you do it?
get
IP Pooling
And some other questions...
4 Venture Dive
define oop pillars with eg
dif dw abstract and interface
diff bw thread and prcess
what is deadlock
views
manay to many relation in stud andy course
singleton
muteable and imutable string
big o notation
write aprogram which find pair of odd no and returen the index of frist oddin pair handle
all the cases
multiple inhertance in java
constructor
fyp
Answers
-
Encapsulation, Inheritance, Polymorphism, Abstraction
https://standardofnorms.wordpress.com/2012/09/02/4-pillars-of-object-oriented-programming/
Comparable and Icomparable interface
n Question
1 1- What is wi??
Write a detailed code which shows polymorphism.
2- What is Abstract class??
3- Does Interface class is an abstract class??
4- What is Normalization
5-
6- What are
Write a anomalies??
code with correct syntax of reversing string given in char[] array
"hello"
7- Write a code for reversing words order "Hello I am here" to "Here I am
hello"
8- Make ERD
9- Write Query to that ERD which contains Join and aggregate function...
Answers
Interview # Question
2 25 mins interview at SOFTECH WORLD WIDE and 1.5 hours HECTIC Test.
1. FYP in detail.
2. what is query string ?
3. what is [HttpPOST] and [HttpGET] ?
4. [HttpGET] se bhi to POST kr sakty ?
5. Page life cycle of ASP .NET MVC ?
6. What is Address , Binding and Contract in WCF?
7. What is Contract and its type ?
8. What is Application Object in .NET ?
9. What is Decision Tree ?
10. How Business Analysis tool i.e SQL SERVER ANALYSIS SERVICE
work ?
11. Past academic projects done in .NET , define them?
12. What is session ?
13. What if we don't have sessions ? any solution for it
and many other chotay motay questions jo yad nahi ..
25 mins interview at SOFTECH WORLD WIDE
3 Code: Compute nth power of number recursively.
Code: Asked from another guy Reverse a String.
1) What projects have you done state your role.
2) Explain FYP
3) Explain Networking Project #NadeemKafi
4) Explain Working of Hadoop
4)Stack vs Heap http://www.programmerinterview.com/…/difference-between-
st…/
and that's all folks...
delegates
4 swapping code
prime numbers
Interfaces n abstract class ka code sample likhwa bhi sakta hai n whether they inherit
each other or not
fibonacci code
linked list
stacks
queues
memory management
such as stack memory heap memory
recursion
fyp
ur main focus
Softech 1st Interview
5 1- FYP kia hai
2- Basic principles of oop
-abstraction and encapsulation
- polymorphism with example
3- Pass by ref and value
4- Exception handling
5- Code to detect Prime no or not
6- Code for find factorial (both recursive and iterative)
Softech 2nd Interview
6 1-FYP pocha in detail.
2- Meray android project ka pocha in detail
3- diff between enumeration and iterator
4-OOP principles
-Polymorphism,Abstraction,inheritance,Encapsulation
5- types of overloading & overriding
6-differnce between arrays and list
7- jvm
8- jdk
Answers
Interview # Question
min 2 steps.
Interview # Question
4 2nd technical interview at streebo related to database and dwh mostly along with
personal characteristics.. updated....
4
After 2nd interview their will be 1 discussion session and then again a final
interview... smile emoticon
Answers
Abstract may have implemented method, but interface doesn't have any
1 About Fyp
ERD / Implementation of fyp
2,3 joins query
2,3 subqueries
1:m relationship and foreign key
m:m relationship and how many tables and why?
Polymorphism
12 balls ,11 with equal weights ,find the heaviest in 3 turns
what is the angle between the arrows of a clock at 3:15
polymorphism
Logic / Code to Find if a number is power of 2
2 About fyp
Implementation of fyp
Android activity lifecycle
diff btw android activity and fragment
android storage types
Intent in android
Database with two tables (books and author) 1:m relationship
how many tables in 1:m relationship
what is candidate key,composite key
same table with m:n relationship and how many tables in m:n relationship
4 pillars of oop
polymorphism
4 Introduce yourself
You have a 3 Litres and a 5 Litres bucket of water. How will you fill 4 Litres in one of the
bucket
How do you find equilibrium index in an array i.e. the index where sum of its previous and
remaining elements is same
Whats is static? is there any restriction for static functions to use members of class? why?
futre plans
6
3rd interview at Techlogix: You will be interviewed by one of the founders of the
company. Revise your FYP and make sure you can explain its working in detail. No
other technical questions. Just general discussion on life goals and academic life.
Techlogix two technical interview questions
7 First they will ask you to define yourself.
Then ask about FYP in detail. How many members, what technology,members etc
OOP
1. Difference between Abstract and Interface class, when to use which?
What do you prefer between working on new technology or mastering the old.
Hobbies
What you do in leisure time.
Apart from domain you are interested, what else you want to do
After both interview, they ask if I have any questions about the company or so
Techlogix two technical interview questions
8 Define yourself,
Make Library Database System, with two tables, (student and books) and query it
using join
When to normalize and when to denormalize database.
Write program of finding square root of a number.
What are your fav subject,
What technologies have you work on,
When to use stored procedure and when to use user defined procedure in databse.
Why need RDMS.
Why RDMS are slow.
What is your FYP
Make database of your project
How will you prevent race condtion. If you implement a lock, it will not be scalable
anymore.what will you do ?
Define inheritance to a 3 year old child
Define ACID properties of database
9 You have 4 pillars of OOP. What is the feature of programming language that you will want
to add as a 5th pillar of OOP
What is MVC ?
What is Web Service ?
Why Techlogix ?
Any Questions ?
Answers
1
1
1
1
Do mention the questions asked while going for another job switching interview
Question
hile going for another job switching interview
Answer
1
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
armstrong=armstrong*armstrong*armstrong;
result=result+armstrong;
}
if(result==check){
cout<<check<<" is an Armstrong Number";
}
else{ C++ Codes
C++ cout<<check<<"
PROGRAM TO CHECK is NOT GIVEN
an Armstrong
NUMBER Number";
IS ARMSTRONG NUMBER OR NOT
}
return 0;
}
/*
program : Decimal to binary.
description : to convert decimal number between 0 to 255 to binary */
# include <iostream>
#include <math.h>
using namespace std ;
int main()
{
unsigned short int x=0,b=128 ,z=0,a=8 ;
cout<<"please enter the number between 0 and 255 \n";
cin >> x;
if (x>255)
cout<<" out of range ";
else
{
cout << x <<" converted to binary number :" ;
while (a!=0)
{
z=x*b ;
if (z==128)
cout << "1" ;
else
cout << "0";
x=(x << 1);
a-- ;
}
}
cout<<"\n";
system("pause");
return 0 ;
}
Hexadecimal number to Decimal Number
#include"conio.h"
#include"stdio.h"
#include"string.h"
#include"math.h"
int main()
{
char hex[25];
int i,j,num,len,counter=0;
long int sum=0; //value can cross range of int
printf("\nEnter the hexadecimal number: ");
gets(hex);
strupr(hex); //so the program becomes independent of string case
len=strlen(hex);
for(i=len-1;i>=0;i--)
{
if(hex[i]>='0'&&hex[i]<='9')
num=hex[i]-'0'; //the character is number in between 0 to 9
else
{
if(hex[i]>='A'&&hex[i]<='F')
num=hex[i]-55; //the character is either a,b,c,d,e or f
else
{
printf("The Entered number is not hexadecimal number");
getch();// If the character is beyond 'f'
return 1;
}
}
sum=sum+pow(16,counter)*num; //according to formula given by the link
counter++;
}
printf("Hexadecimal conversion of %s to decimal is %ld",hex,sum);
return 0;
}
Binary Tree
class BSTNode
{
private:
int value;
BSTNode *left;
BSTNode *right;
public:
BSTNode (int x)
{
value = x;
left = right = NULL;
}
int GetValue ()
{
return value;
}
BSTNode *leftchild ()
{
return left;
}
BSTNode *rightchild ()
{
return right;
}
void Addleftchild (BSTNode *node)
{
left = node;
}
void Addrightchild (BSTNode *node)
{
right = node;
}
bool isleaf ()
{
return ((left==NULL) && (right==NULL));
}
bool isleftchild(BSTNode *node)
{
bool found = false;
if (node != NULL)
{
if (this->leftchild() == node)
{
return true;
found = true;
}
else
{
return found;
}
}
}
bool isrightchild(BSTNode *node)
{
bool found = false;
if (node != NULL)
{
if (this -> rightchild() == node)
{
return true;
found = true;
}
else
{
return found;
}
}
}
};
class BSTree
{
private:
BSTNode *root;
void PreorderVisit (BSTNode *node)
{
if (node != NULL)
{
Visit (node);
PreorderVisit (node -> leftchild ());
PreorderVisit (node -> rightchild ());
}
}
void Visit (BSTNode *node)
{
cout << node -> GetValue () << " " ;
}
public:
BSTree ()
{
root = NULL;
}
void Add (int x)
{
bool inserted;
BSTNode *node, *curr;
node = new BSTNode (x);
if (root == NULL)
{
root = node;
}
else
{
inserted = false;
curr = root ;
while (!inserted)
{
if (node -> GetValue() < curr -> GetValue())
{
if (curr -> leftchild() == NULL)
{
curr -> Addleftchild (node);
inserted = true;
}
else
{
curr = curr->leftchild ();
}
}
else
{
if (curr->rightchild() == NULL)
{
curr->Addrightchild (node);
inserted = true ;
}
else
{
curr = curr -> rightchild ();
}
}
}
}
}
void PreorderTraversal ()
{
BSTNode *node ;
node = root;
PreorderVisit (node);
}
};
Singly Link List
class LinkNode
{
private:
int info;
LinkNode *link;
public:
LinkNode(int x)
{
info=x;
link=NULL;
}
int GetValue ()
{
return info;
}
LinkNode* next1()
{
return link;
}
void Link (LinkNode *node)
{
link=node;
}
};
class SingleLinkList
{
private:
LinkNode *head;
public:
SingleLinkList()
{
head = NULL;
}
void AddToHead (int x)
{
LinkNode *curr, *node;
if (head == NULL)
{
head = new LinkNode (x);
}
else
{
curr = head;
node = new LinkNode (x);
head = node;
node->Link(curr);
}
}
void DeleteFromHead ()
{
LinkNode *temp;
temp = head;
head = temp->next1();
delete temp;
}
void AddToTail (int x)
{
LinkNode *curr,*node;
curr = head;
node = new LinkNode(x);
if(head == NULL)
{
head = node;
}
else
{
while (curr->next1()!= NULL)
{
curr = curr->next1();
}
curr->Link(node);
node->Link(NULL);
}
}
void DeleteFromTail ()
{
LinkNode *curr, *temp;
curr = head;
while (curr->next1()->next1() != NULL)
{
curr = curr->next1();
}
temp = curr;
temp = temp->next1();
curr->Link(NULL);
delete temp;
}
void SearchList (int x)
{
LinkNode *curr;
int index = 0;
int n = 1;
bool found = false;
curr = head;
while ((curr != NULL) && (!found))
{
index++;
if (curr->GetValue() == x)
{
found = true;
}
else
{
curr = curr->next1();
}
}
if (found == true)
{
cout << "Number " << x << " Is Present At Index " << index << " !!" << endl;
}
else
{
cout << "Number Not Found!!" << endl;
}
}
void CountElements ()
{
LinkNode *curr;
int count = 0;
curr = head;
while (curr != NULL)
{
curr = curr->next1();
count++;
}
cout << "Total Elements In a List Is: " << count << endl;
}
void GetElementAt (int x)
{
LinkNode *curr;
int count = 0;
curr = head;
while (curr != NULL)
{
count++;
curr = curr->next1();
}
if (count > x)
{
LinkNode *temp;
temp = head;
for (int i = 0; i < x ; i++)
{
temp = temp->next1();
}
cout << "At Index " << x << " Element " << temp->GetValue() << " Is Present!!" << endl;
}
else
{
cout << x << " Index Is Not Present!!" << endl;
}
}
void DeleteElement (int x)
{
LinkNode *temp,*curr,*temp2;
int counter = 0;
bool found = false;
temp = head;
while ((temp != NULL) && (!found))
{
counter++;
if (temp->GetValue() == x)
{
found = true;
}
else
{
temp = temp->next1();
}
}
if ((found) && (counter == 1))
{
LinkNode *temp;
temp = head;
head = head->next1();
delete temp;
cout << "The Element With Info " << x << " is Deleted!!" << endl;
}
if ((found)&& (counter > 1))
{
curr = head;
while((curr->next1() != temp) && (curr != temp))
{
curr = curr->next1();
}
temp2 = temp;
temp2 = temp2->next1();
curr->Link(temp2);
delete temp;
cout << "The Element With Info " << x << " Is Deleted!!" << endl;
}
else if (!found)
{
cout << "No Element With Info " << x << " Is Found!!" << endl;
}
}
void InsertSorted (int x)
{
LinkNode *curr, *prev, *node;
bool found = false;
node = new LinkNode (x);
if (head == NULL)
{
head = node;
}
else
{
curr = head;
while ((curr != NULL) && (!found))
{
if (node->GetValue() >= curr->GetValue())
{
prev = curr;
curr = curr->next1();
}
else
{
found = true;
}
}
}
if (curr == head)
{
AddToHead(x);
}
else
{
prev->Link(node);
node->Link(curr);
}
}
void Print ()
{
LinkNode *temp;
temp = head;
while (temp != NULL)
{
cout << temp->GetValue() << " ";
temp = temp->next1();
}
}
};
Doubly Link List
class Node
{
private:
int value;
Node *next;
Node *prev;
public:
Node(int e1)
{
value=e1;
next=NULL;
prev=NULL;
}
int GetValue ()
{
return value;
}
Node* next1()
{
return next;
}
Node* prev1()
{
return prev;
}
void Link (Node *node)
{
next=node;
}
void plink(Node *node)
{
prev=node;
}
};
class DoubleLinkList
{
private:
Node *head;
public:
DoubleLinkList ()
{
head=NULL;
}
void AddToHead (int e1)
{
Node *temp, *node;
if (head == NULL)
{
head = new Node (e1);
}
else
{
temp = head;
node = new Node (e1);
head = node;
node->Link(temp);
temp->plink(node);
}
}
void DeleteFromHead (int e1)
{
Node *temp;
temp=head;
head = temp->next1();
delete temp;
}
void AddToTail (int e1)
{
Node *curr, *node, *temp2;
curr = head;
node = new Node(e1);
if(head == NULL)
{
head = node;
}
else
{
while(curr->next1()!= NULL)
{
curr = curr->next1();
}
curr->Link(new Node(e1));
temp2 = curr->next1();
temp2->plink(curr);
}
}
void DeleteFromTail ()
{
Node *curr, *temp;
curr = head;
while (curr->next1()->next1()!= NULL)
{
curr = curr->next1();
}
temp = curr;
temp = temp->next1();
curr->Link(NULL);
delete temp;
}
void SearchList (int x)
{
Node *curr;
int index = 0;
bool found = false;
curr = head;
while ((curr != NULL) && (!found))
{
index++;
if (curr->GetValue() == x)
{
found = true;
}
else
{
curr = curr->next1();
}
}
if(found == true)
{
cout << "Number " << x << " Is Present At Index " << index << " !!" << endl;
}
else
{
cout << "Number Not Found!!" << endl;
}
}
void CountElements ()
{
Node *curr;
int count = 0;
curr = head;
while (curr != NULL)
{
curr = curr->next1();
count++;
}
cout << "Total Elements In a List Is: " << count << endl;
}
void GetElementAt (int x)
{
Node *curr;
int count = 0;
curr = head;
while(curr != NULL)
{
count++;
curr = curr->next1();
}
if(count > x)
{
Node *temp;
temp = head;
for (int i=0;i<x;i++)
{
temp = temp->next1();
}
cout << "At Index " << x << " Element " << temp->GetValue() << " Is Present!!" << endl;
}
else
{
cout << x << " Index Is Not Present!!" << endl;
}
}
void DeleteElement (int e1)
{
Node *temp, *curr, *temp2;
int counter = 0;
bool found = false;
temp = head;
while ((temp != NULL) && (!found))
{
counter++;
if (temp->GetValue()== e1)
{
found = true;
}
else
{
temp = temp->next1();
}
}
if ((found) && (counter == 1))
{
Node *temp;
temp = head;
head = head->next1();
delete temp;
cout << "The Element With Info " << e1 << " is Deleted!!" << endl;
}
if ((found) && (counter>1))
{
curr = head;
while((curr->next1() != temp) && (curr != temp))
{
curr = curr->next1();
}
temp2 = temp;
temp2 = temp2->next1();
curr->Link(temp2);
temp2->plink(curr);
delete temp;
cout << "The Element With Info " << e1 << " is Deleted!!" << endl;
}
else if (!found)
{
cout << "No Element With Info " << e1 << " Is Found!!" << endl;
}
}
void print ()
{
Node *curr;
curr = head;
while (curr != NULL)
{
cout << curr->GetValue() << endl;
curr = curr->next1();
}
}
};
Stack
#include <iostream>
using namespace std;
const int LIMIT = 10;
class stack
{
private:
int topposition;
int contents [LIMIT];
public:
stack ()
{
topposition = 0;
}
bool Isfull ()
{
if (topposition >= LIMIT)
{
return true;
}
else
{
return false;
}
}
bool Isempty ()
{
if (topposition==0)
{
return true;
}
else
{
return false;
}
}
int stacktop ()
{
if (!Isempty())
{
return contents[topposition -1];
}
}
void push (int x)
{
if (!Isfull())
{
contents [topposition]=x;
topposition ++;
}
}
int pop ()
{
int k = 0;
if (!Isempty())
{
topposition--;
k=contents [topposition];
return k;
}
}
};
int main ()
{
stack s;
s.push (2);
s.push (3);
s.push (4);
cout << "Top Position: " << endl;
cout << s.stacktop() << endl;
cout << "Pop" << endl;
cout << s.pop() << endl;
cout << s.pop() << endl;
cout << s.pop() << endl;
system ("pause");
return 0;
}
Queue
#include <iostream>
using namespace std;
const int LIMIT = 10;
class queue
{
private:
int Qlast;
int Qfirst;
int contents [LIMIT];
public :
queue ()
{
Qlast = 0;
}
bool Isfull ()
{
if (Qlast>=LIMIT)
return true;
else
return false;
}
bool Isempty()
{
if (Qfirst==Qlast)
{
return true;
}
else
{
return false;
}
}
void Insert (int x)
{
if (!Isfull())
{
contents [Qlast] = x;
Qlast++;
}
}
int Remove ()
{
if (!Isempty())
{
Qfirst++;
int k=contents [Qfirst];
return k;
}
}
};
int main ()
{
queue q;
q.Insert (2);
q.Insert (3);
q.Insert (4);
system ("pause");
return 0;
}
if (original.equals(reverse))
System.out.println("Entered string is a palindrome.");
else
System.out.println("Entered string is not a palindrome.");
}
Sort_alphabetical(){
string s = "cbba";
for(int i=0; i<s.length(); i++)
for(int j=i+1; j<s.length(); j++)
if(s[j]<s[i]){
char temp = s[i];
s[i]=s[j]; s[j]=temp;
}
}
int Reverse_numbers(int n) {
int multiply = 10, remainder = 0, result = 0;
while(n>0) {
remainder = n%10;
result = result*multiply + remainder;
n= n/10;
}
return result;
}
if (currP->state == value) {
Node *tempNextP;
tempNextP = currP->next;
int Recursive_factorialfinder(int x)
{
if (x == 1) // HERE 5 is not equal to 1 so goes to else
{
return 1;
}else
{
return x*Recursive_factorialfinder(x-1);
}
}
Recursion Codes
Power Power using Recursion
#include<iostream.h>
#include<conio.h>
int power(int,int);
void main()
{
int x,y,p;
clrscr();
cout<<"\n\n\t calculating power of a number using recursion";
cout<<"\n\n\t Enter base ";
cin>>x;
cout<<"\n\n\t enter index";
cin>>y;
if(y==0)
{
cout<<"\n\n\tpower is 1";
}
if(y<0)
{
y=y*(-1);
p=power(x,y);
cout<<"\n\n\t power is"<<1/p;
}
p=power(x,y);
cout<<"\n\n\t the power is"<<p;
getch();
}
Program:
# include <stdio.h>
Explanation: Recursive function (reverse) takes string pointer (str) as input and calls itself with next location to passed pointer (s
Sum of Digits
#include <iostream>
using namespace std;
int sumdigits (int num)
{
if (num == 0)
{
return 0;
}
else
{
return (num % 10) + sumdigits (num / 10);
}
}
int main ()
{
int n = sumdigits (553);
cout << n ;
return 0;
}
input = 553
output = 13
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
output: 4
Factorial
#include <iostream>
using namespace std;
int main ()
{
int n = factorial (5);
cout << n ;
return 0;
}
output: 120
Recursive Way:
1) Initialize start and end indexes
start = 0, end = n-1
2) Swap arr[start] with arr[end]
3) Recursively call reverse for rest of the array.
printf("\n");
}
Recursive Permutation
#include <iostream>
// full permutation
void perm(int n, int i)
{
if (i == n - 1) // check if reach the end of iteration
{
// print out the iteration
for (int j = 0; j < n; j ++)
{
cout << nums[j];
}
cout << endl;
}
else
{
for (int j = i; j < n; j ++)
{
swap(nums[i], nums[j]); // swap
perm(n, i + 1); // recursive
swap(nums[i], nums[j]); // swap it back
}
}
}
// main entry
int main()
{
int n;
cin >> n;
nums = new int[n]; // declare a dynamic array
for (int i = 0; i < n; i ++)
{
// and fill it with numbers as 1, 2, 3, ... n
nums[i] = i + 1;
}
perm(n, 0);
cin >> n; // pause
return 0;
if (d == 1)
{
return 1;
}
else
{
if (n % d == 0)
{
return 0;
}
else
{
return test_prime(n, d - 1);
}
}
}
second code
#include <iostream>
using namespace std;
int main()
{
isPrime(2);
cout << endl << endl;
isPrime(6);
cout << endl << endl;
isPrime(11);
return 0;
}
Fibonacci Series
#include <iostream>
using namespace std;
int fib(int num)
{
cout << "Finding the fib of " << num << endl;
int main()
{
fib(6);
return 0;
}
Tribonacci Series
#include <iostream>
using namespace std;
int f (int n)
{
if (n<3)
return 1;
if (n>=3)
return f(n-1) + f(n-2) + f(n-3);
}
main()
{
int n;
printf ("Enter a number: ");
scanf ("%d", &n);
printf ("%d\n", f(n));
}
esent!!" << endl;
s Present!!" << endl;
Qfirst = -1;
f with next location to passed pointer (str+1). Recursion continues this way, when pointer reaches ‘\0', all functions accumulated in stack pr
umber" << endl;
ctions accumulated in stack print char at passed location (str) and return one by one.
Interview # Question
1 -About urserlf.
-Fyp.
-ERD.
-Atleast 10 queries.
-Overriding and overloading code.
-Static variable,functions.
-Difference b/w class and struct.
-Different patterns code.
-Normalization.
-DB questions.
-MVC.
-Session and Cookie.
Answers
Interview # Question
3 FYP
Polymorphism
abstraction
inheritance
access modifiers
processes
threads
locks and its types
DB transaction
how to recover transaction if system fails in between
UNION and INTERSECTION based queries
Goodcoresoft interview + test
4 Test :
1)write program for summing up integers like int a = 3456 its sum will be 18
2) write program for counting the occurrence of words in a string " dil dil pakistan
jan jan pakistan"
dil = 2
jan = 2
pakistan = 2
Query part: a table salesperson contains IDs and names of customers and
another table personOrder contains number of orders each customer have placed
Q : write a query to return customer names who have placed more than one
orders
Q : write a query to return customer names starting with 'D' or 'd'
Interview :
define polymorphism, inheritance?
difference between structure and class?
Overriding and overloading?
what is interface ?
why deadlock occurs how we prevent it?
Data structure of OS that maintains memory? <- dont exactly remember it, I
answered heap
abbreviation of LAMP? tongue emoticon
what data structure is used for hashtable, how it works?
Difference between truncate and delete?
when transaction ends?
what rollback does?
Answers
Interview # Question
1
Question
MarketLytics 2nd Interview:
Kinda HR Questions like:
1. kahan se ho orginally?
2. expected salary kitni?
3. suppose agar zindgi m koi restriction na ho to kia karna chahoge?
4. Bike chala letay ho? aur Khi me tongue emoticon ?
6. CS q choose ki aur kese pata chala - ye bohat mast sawal tha aur pechhla bi jaha se
5. 5 saal
mene baad
poory khud kokakaha
interview dekhna
direction chahty kardiya
e change ho ya kuch
phiridea
usnehe kia plan
wohe he?
sawal pooche jo
mene
5. Farigusey
timepoochne ko kahy
m kia kartay ho?grin emoticon
mene indirectly
kaha mostly m wink
Google emoticon
pe hota hoo, kuch parh rha
7. phir
hota narain
koishru hogya, jawab to bht
rhalamba tha mene kaha behavioral PsychoLogy
6. to hu
usne
related,
yakaha
tech
youtube
kia parhty
related,
videos
programming
dekh
ho aur konsi hota hoo..
videos
blogs, tongue
kabi kabi emoticon ?religions,
camparative issi wajayoutube
se mene
ooper
videos nh jawab
me kuch diya tha poora
log hprojects mjhe
jin ki baatein pata tha
achi hoti yhi poochega.. grin emoticon
8. aur bech m kahin ka poocha tha, he
koiwo sunta
aesa hoo,jis
project kafi
m kuch naeeaya
bht maza chezzein
ho?,
pata lagti he..aur etc.
aur aj tak sab se bara project knsa tha? i said i think FYP, aur phir FYP k ooper
discussion.
9. Tools kon kon se use kartay ho ya ache lagty hen...
Answers
Interview # Question
1 TEST OF TEXT
Write a query to retrieve last two rows of the table.
Write query to make indexes of a column.
Why we use indexes and its impact on CRUD.
Difference between
Given an array of allsubqueries, inner
database rows joins, outer
retrieve joins,
last two rows with your fav
programming lang
Given a list of all database rows in C# retrieve last two rows.
Hobby.
Skills rating out of 5 on programming, web, web service, and database.
Given a method write code to get last two rows Using LINQ.
Answers
Interview # Question
1 1. difference b/w final and const
2. defien polymorphism.
3. what is meant
4. Program by static
to make and its
any string use.
a palindrome. (we could do it by reversing and append it
with origanal)
5. Count the number of character in a string with out using predefiend functions.
Answers
Interview # Question
1 osi layers
what is nosql
map reduce (asked because i said it)
2 The easiest interview you will give in ur life. 15 mins. networks parh lena
Answers
http://en.wikipedia.org/wiki/OSI_model
http://en.wikipedia.org/wiki/NoSQL
Interview # Question
Answers
Interview # Question