Comprehensive Guide to DSA and OOP Concepts
Comprehensive Guide to DSA and OOP Concepts
double x= 12.0; pillars of OOP (PIEA)(Polimorphism, draw association(ERD) between entities Measure 4 L water from a jar of 3L and
double y=3.0; Inheritance, Encapsulation,
Types of inheritance? Abstraction)
Difference b/wof givenentity
bridge scenario 5L.
You have given 25 horses and have to
you receive a link list and an integer n, Multiple and multilevel Inheritance 4th max salary? why did you use distinct find top
Two 3 inare
trains minimum
[Link]
towards each fiveother
you have
Delete to reverse
a node list in chunks of n!!
of BST. multiple inheritance is not supported by in query?
why any other
indexing? makeway to find 4th
an index? max?
which with have
you a speed of 80KM/h.
to correctly label,There is a
3 wrongly
Merge two sorted arrays into new array.? every Desginlanguage!
Patterns?why? diamond problem? column do you prefer for indexing?
join vs subquery labeled bags in 1 try (pick 1
pick 1 heavy ball from 8 balls in 2 ball from any
reverse a linked list? using any data What is Singleton pattern? how do you Join query on 3 tables attempts
Two trains are moving towards each other
structure?
reverse linked list in O(1) space implement it?
Abstract Factory vs Factory method? Right outer join using left outer join. with have
you a speed
twoof 200KM/h.
candles, eachThere is a on
can burn
complexity?
You receive a sorted array. i.e: 1,3,5,6,7,9 MVC Difference between Put and Patch. both
Thereends. Each
is a 50 candle
story takeand
building 60 you
minutes
have
and a target
Based on given = 8 number,
you needprint
to return
even the
or defines pillars of OOP by an Example? What is header in https request. two boiled
4 Pills and eggs. name the
Blind person minimum floor
problem
odd.
Find No if elsebetween
distance or ternaryto operator.
nodes in a BST. use of "virtual" keyword? Difference between Get and Post,
Populate a BST from a given unsorted types of polymorphism? Can we do GET, POST, PUT, DELETE
array. a nested array. e.g Input: [1, 2, [3, why OOP?
Flatten using
Default POST only?
port of http and https.
4, 5, Intersection
Find [6]], 7, 8] Point in Linked List why Inheritence? define indexing? table has million of
Check whether the link list is a palindrome Print Even or Odd without using the record
cluster with index?
or non does
cluster indexing helpful
index
ornumber
a not? k, sum and an array is given, modulo
Real lifeoperator.
examplesCan use if statement.
of OOP's Pillars triggers
you have to find whether the sum of
You are in middle of link list, and you have Difference between Abstraction & store procedures
to remove
Product of the node
Array you itself
except are pointing to Encapsulation
types of polymorphism ACID
Operator Overloading and Operator transaction
There is a linkedlist consist of nodes. Overriding
- Function overloading and function Views
struct Nodeof linked list in O(N)
find middle overriding
Print Even or Odd without using the write query to return 2nd last record of
modulo operator. Can use if statement. table
Detect and Remove Cycle in Linked List. can we achieve overloading in child class 4 maximum salary
shallow vs deep copy find maximum salary for each department
Mirror the BST friend function ? why we use friend SQL constraints
function?
if, can we replace right join with left join
Pre Order Traversal 1. Level order traversal of a binary tree. difference between group by and
BFS traversal Why we need Interface and Abstract order are
there by sql
multiple stores which have
classes
Why we use static functions multiple
scalar andproducts,
aggregate multiple products
functions
twoSum problem with O(n) time Difference between compisition
complexity
sum of all the nodes of binary tree assosiation and aggregation assosiation
write a function such that if we pass 100 it
returns
you have101
to and if wedata
transfer passfrom
1012it returns
databases
delete nodeA and B to a fixed size array.
return nth to last node
return 2nd last node
Delete node whose whose address is
given
There is a linkedlist consist of nodes.
struct
In whatNode
type of data to be searched,
traversal
you haveofa BST will bearray
unsorted in worst
fromcase.
1 to
100 withTraversal
InOrder one numberusingmissing,
Recursionfind that
Find all non repeating elements from
Array O(N)
FInd 2nd largest number in array using 1
loop
Find frequency of characters in string .
time complexity
Vendor machineshould be O(n)
cash return and space
algorithm.
Types of Data Structures
You are just given the pointer to a node of
a singly
Move alllinkedList,
zeroes in an youarray
havetotothe
remove it.
left size
in O(n)a function foo(x) which get an
Write
integera (it
Write code cantobefind
12 wether
or 18 just), return
the tree is 12
balaned
Name allorthe
notoperations
? which takes
contant time we
Algo to detect can perform
prime number on a
count the occurrence of number in an
array with time complexity should not be
$
what is the difference in == and === in JavaScript
working of joins through venn diagram
center a div in such a way that it should remain responsive
count the occurrence of number in a array and sort the numbers in such a way that number with highest occurrence
Fyp stack questions: For react JS , can we update the prop in child component which is passed by parent compone
difference between Margin and padding
er with highest occurrence come first and so on
assed by parent component
Arbisoft 2022 Arbisoft 2022 Coding Test
Arbisoft 2023 Arbisoft 2023 Coding Test
OOP DSA TEAM FIT INTERVIEW DB
Overloading vs Overriding [1,2,3,4,5]
Given ==> return
a string, [120,60,40,30,24]
a dictionary without using
containing divideof instances of
number Introduce Yourselfstack you choose and why?
which technology Joins
Dry run the given oop code each word Confict
How didwhile selectingthe
you selected technology.
FYP group? Is it just a group of behavior of left outer join
Factory method Validate whether
Remove two binary
last Nth node in linktrees arethat
list (for mirror
theyofmade
each meother
design the friends
Is thereor any
any particular
group memberreason?
that is irritating? How do you Left outer join query on tables
Shallow copy vs deep copy, write its code whole list class) handle
Is therehim?
any major conflict with your teammates you have ACID properties
Static Members Check and remove cycle in link list faced during your FYP. Design Schema for Food panda
Singleton and Factory Pattern Along with cod Dry run a recursive code What
If you are
are your
givenweakness?
a chance toYour strengths?
change one thing in Pakistan Design Schema for Car booking app
Which sorting algorithm costs less if array is partially sorted? then
Your what
Dream will5 that be? What's
companies, the Are
if any? solution you specific
you too have?
define classes for animals in a zoo. Which sorting algorithm performs minimum number of swaps? about theincompany
anything your FYPyou want
that youto join?to change if you are
want Patient, Doctor, Appointment schema + SQL queries on that
pillars of oop x 2 taken back at the
Personalitites thattime of making
inspired you toFYP group
do programming? Their What is table?
check awether
given array ofa string
stringsisfind
palindrome or not (asked
longest common prefix4 different methods) name
Whereand reason!
do you see yourself in the future? Any goals you How many keys?
Object vs class x 2 (["flower","flow","flight"] => "fl") want to accomplish? What is Primary key?
Implement
Read CSV undo redo
file with functionality
student details, sort it by any column that user Implement undo redo functionality
Runtime and Compile time errors? specifies, and return ids Normaliztion
A linked list contains even and odd numbers. Balance the linked list by
Oop real-world example deleting node suchon that it contains Draw ERD for a restaurant
Given productivity scale 1-100 ofequal number
persons formofa even
teamandsuchodd
that the
Polymorphism real-world example numbers.
difference between the sum of collective productivity of teams has Write a query on above designed database
Draw class diagram for a restaurant minimum
Find difference.
kth maximum Read input
element from from
[Link] and is
What take
theteam
time size from user.
complexity of
the algorithm
Delete a nodeyouof apresented?
linked list but you do not have the head pointer. You
only have the refernce of the node that should be deleted.
Array vs Linked List
common difference value being 1. For example (2,3,4) is the valid team,
and (5,6,8)
minimum is not. of necessary deletions on the linked list so that the
number
end
Findstate of node
ith-last your linked list islist,
in a linked in ascending ordermethods
with 3 different or descending
(worst,order.
better,
best)
Find if two Binary trees are mirror of each other
Write insert function for BST
Find runtime and compile time errors in a given code.
Cohesion (code example)
Coupling (code example)
Pillars of OOP
Through how many ways classes can be related in OOP
Aggregation (example in real life + code implementation )
Composition (example in real life + code implementation )
Association (example in real life + code implementation )
Polymorphism (example in real life + code implementation )
A database query is slow. What could be the reasons?
Indexing
Clustered Indexing
Agile Development
SCRUM
Normalization
Design Patterns
Disadvantages of Inheritance
How to map many to many in database
DSA Full Loop Assessment Final Interview
Return the triplet whose sum is maximum in an array" with "Return the triplet(consecutive) whose sum is maximum in anFind First smallest missing natural number from an unsorted array. In a square grid of 10x10, you have to find a path from 0,0 to 9,9 x2
A binary tree is given, and we alter the Node class, and add a new member "Node * next" , you have to initilize this member with either
null, or the the right node in same level Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against
Howandoopponent
you findby alternating
height turns.
of a binary In each
tree? x2 turn, a player selects either the first or last coin from the r
Reverse last n nodes in link list Find the nth number in Fibonnaci Sequence. Find kth largest number in array, cost sould be less than O(kN)
A string is given containing parenthesis, valid or invalid, you have to return the max sum of consecutive valid braces Find the third highest node in BST using O(1) space and in O(n) time
Return the count of maximum nodes in a root to leaf path DeleteAnsectors
Note: the last occurence of an element
will also include the node from a linked
itself list of parents of the nodes.
+ the chain Verify if a binary tree is BST or not?
Delete last occurrence of an item(number) from a singly linked list Follow Up: What if the duplicate nodes are present in the binary tree Remove nodes with duplicate values in a sorted link list
Find
4:"D",the
....,count of distinct
26:"Z"}. Samplenumber
Tests: ofForpairs
n=1 in=>an array whose
Output: A, For product is equalB,
n=2 => Output: to For
a number
n=26 => K. Output:
Note: (a,Z,b)For
==n=27
(b, a)=> Output: AA, For n=52
=> Output: AZ, For n=703 => Output: AAA and so on.
Given an array/string print all possible palindromes.
Find the first repetition in linked list
Given a linked list and a chunk size, reverse the linked list in chunks example 1,2,3,4,5,6,7,8,9 -----> 3,2,1,6,5,4,9,8,7
Given two binary trees, create a new tree that at every node contains sum of corresponding nodes of other two binary trees.
Given a binary tree and a value n we have to check if sum of values from root to leaf nodes exist that matches the given value n
Given a string we have to return first non repeating character e.g. Input: 'Educative' Output: d, Input: 'Banana' Output: B
Given a link list we have to remove duplicate nodes in unsorted list in O(N)
Write function that take n as a parameter and return prime numbers equal to n.
Given a string we have to return frequency of every word in string
DFS,BFS
Find the nearest
Two linked multiple
list heads are to x in the
given, eachtable of n. for
of which example
represent n= 4,negative
a non x = 9, output = 8, number,
reversed handle negative
you need inputs as well
to return a linked list that is equal to
the sum
Write of numbers
a function that represented
finds out if a by the number
given two inputis linked
stronglist. for example:
or not, a numberll1is =strong
1->0->2,
if thell2sum
= 2->1->5, ll to be returned
of the factorial = 3->1->7
of its digits is equal to the
number itself, e.g 145 is a strong number because 1!+4!+5!=145
Write a function that will rotate left a linkedlist by n
Write a function that finds the path in a binary tree that has the greatest sum.⁸
Find indxes of 2 numbers whose sum is equal to given number in array O(n)
You have given a sorted array of unknown size how would you search an element from array
Find 3rd maximum from BST without Recusrion
Find 2nd maximum from binary tree (NOT BST)
Given a value N print its fibonacci value
Mirror the binary tree
There is an 2d array (like maze) which have some blocked indexes ,You have to find path to specific value K in array
Find a first missing Natural Number from an Array (unsorted)
Find all the possible paths in maze from source to destination.
Rotate the linklist to left upto N rotation. if 1 2 3 4 5 is linklist and n= 2, then it become 3 4 5 1 2
Find max value
You have given in binary tree.
a linklist, which contains even and odd value in data. write a function that reverse the consecutive even node whose value
are even. and don't alter the odd node. for example, 1 2 3 4 6 8 9 10 12 7, then after reverse, linklist should be 1 2 3 8 6 4 9 12 10 7.
Write a function that finds max sum of unsorted Array, no consecutive elements involve (dynamic programming)
Sort a linked list
Given a binary tree return the longest path from root to leaf as an array of nodes
Given an string s = "{{}}[(]))aabb" and and array = ["()", "{}","[]", "ab"] return balanced or unbalanced for each pair e.g. (): "unbalanced", {}:
"balanced, []: "balanced",
all the numbers ab:"balanced"
represented by all [Link].g.
O(n)A and without
binary using
tree has stack queue
following three paths 1) 1->7 2) 1->9->2 3) 1->9->9 than answer should be
17+192+199 = 408
Input is an array of integars. Add all the elements in an resultant array from the input array such that all the elements after that element is less than it.
Input is an array. Length of the array represents the count of sticks. Each index represents the length of the sticks. Return how many
unique triangles can be formed using it Side Note: A triangle can only be formed when one length is less than the sum of other two
(c<a+b)
Flatten a multi-level linked list
Red
Write Team Technical
a program Interview
in C to take input #2 int result = xSample
from user + y; Answers
and add 2 numbers }
Are there any problems with this program Yes, integer overflow
Explain integer overflows Integer overflow - Wikipedia
Whichare
Why languages are vulnerable
integer overflows to integer
considered a overfMainly C, C++ and Assemblies
vulnerability. Answer with examples Give examples of array OOB, BoFs, underwrites etc.
How would you mitigate this vulnerability in ass Explain how you would deal with it
How would you mitigate this vulnerability in C? Write a sample C code and explain
underwrites etc.
The first test was on triplebyte and had 2 main parts first test is identical for everyone as far as I know
General Coding Logic Test
I choose python and they tested various concepts of python like set properties, dictionary behaviours, even one question was from threading and sorting list of dicts
Coding Exercise Quiz
Return the sum of duplicate number and missing number from an unsorted list of integers from 1 to len(array) i.e. [1,2,2,4] will return 2 + 3 = 5
Count the non-palindromic letter in a string e.g. abba = 0 abcdba = 2
Third question was this one [Link]
Omlime Test: [Link]
w?usp=share_link
Given an array of inetgers, display all subsets.(power set)
Find distance between two nodes of a binary tree.
Given two arrays num and index, sort both arrays according to the index array.
Java is platform specific
Cpp is not platform specific
What is platform specific
what is JVM,JRD
Pass by reference and pass by value
Copy constructor object is passed by value or reference why ?
where is copy constructor called implicitly
can we make constructor private how will we make object of such class
static variable and method
when software is opened what 3 types of memories are made
process vs thread
two airplanes a and b with the speed of 500 and 700km/h go from lhr to karachi and karachi to lhr respectively at o
in what situations link list and array and trees are used
occurrence of a char in a string can be found by which data structure optimally
Normalisation
Disadvantages od Normalisation
make a table in non normalised form
how to remove many to many
left join
Draw many to many relation simple ERD
sigalton pattern
diff b/w mac ad IP
upcasting and downcasting
diff b/w http and https
nt which one will be closer to lhr
Design Patterns
Singleton Pattern
Difference between Proxy and Prototype design Pattern
Adapter Pattern
Polymorphism
Static and Dynamic Polymorphism
Overriding
Difference b/w overloading and overriding
Inheritance
Type of inheritance
Access Modifier/ Specifier
Diff b/w Abstraction and Encapsulation
Diff b/w Abstract Class and Interface
Diffference between class and struct
Can we declare a static class
Normalization
Why Normalization is necessary?
Can there exist a situation where denormalization is required instead of normalization no
Can we store a binary tree in db no
How many tables we require to store a binary tree in table
How we can regenerate a binary tree from that table
First, 2nd and 3rd Form of Normalization
Partial Dependency
Transitive Dependency
Indexing
Clustered and unclustered indexing
OS
Directed Acyclic Graph
Shared Resources
Mutual Exclusion
Binary Semaphore
Context Switching
If a process is interrupted during execution where its state and variables moved to ______ ?
Composition vs aggregation
Schema of Instagram
Find Absolute Difference of Sum of left and right diagonals of square matrix?
Given an unsorted array of size n, array contains integers ranging from 1,n except only one [Link] that integer
Given two arrays sort them and merge them in a new array
Get Details of those Employees who are getting more than average salary
Print Negative and Positive Numbers in Array in alternative manner
Find Duplicate Elements in Array
Palindrome String
Print Stack in Reverse Order
Kth Maximum Element in Array
[Link] number is 342567 then sum is 3+4+2+5+6+7=27 as sum not done
single digit, then 2+7=9
Find middle node of link list in O(n)
Count the length of linked list
Print in order travel of given tree
Difference between public & protected Inheritance
Transaction dependency
How we limit to create not more than 10 objects
Difference between binary tree & binary search tree
Factory Pattern Real life example
Façade pattern
Difference between factory & abstract factory pattern
purpose of abstract class
D/W overloading & overidding
Given table, apply query
Question about FYP
Why we use indexing?
Type of inheritance
What is mutex
Program to find and zombieofprocess?
the height the binary tree through recurrsion
and iterative method
Program to reverse the string while the special characters holds
the position For example: Input ab@k,w output wk@b,a
Find loop in linklist and remove it
Covert decimal number to binary
Find the third highest salary (database question)
Write a program that count frequency of all alphabets in a string and multiply non-zero frequencies.
Basic OOP questions
Normalize a database, make ERD
Array based problem solving question
Analytical question
About FYP and your role
Prefered technologies to work
What do you know about company
Technical Interview (Final)
Tell me
Tell me about
about your
yourself,
FYP,your interests
What's (technical
your role and roleand generally)
of other team members. Introduce
return: yourself
{1.5, and
2.5, 3.5, your FYP. Reason to chose the tech stack.
4.5};
Recommendation: Critically analyze your FYP before the interview and prepare for the common questions that can be asked regarding your FYP
What are blockchain, cryptocurrency, and cloud computing Write pseudo code of how will you write a software for Card game using principles and pillars of OOP
How do we measure the volume of the cylinder? What is the surface area of the cylinder, What is a cuboid? How will you sort an array in-place with least time complexity?
How will you explain OOP to someone new to programming? Difference between LinkedList and Arrays.
Tell me about your schooling, Intermediate, marks.
Why did you choose Computer Science? Why PUCIT? Have you ever regretted your decision of choosing computer science as a career?
-Where
Do youdohave
you an
see yourself
interest in the coming
in current affairs?2-3
Do years.
you know about Russia Ukraine conflict
-- What
In which Backend
is the Programming
probability of winninglanguage
the toss ifyou
thehave worked?
captain chooses Head? -FYP, Tech Stack
Polymorphism + its implementation
- What is the probability of winning two consecutive tosses? - class
- List vs struct who have not submitted their fine of July.
students
sense patterned region of disk, it displays 1 on screen and sense plain region, it displays 0. You have to find if the disk moving is - List students
- Difference + sum
between of total
array andfine of July
linked list
clockwise or anticlockwise. - Write code
Identify whichtobutton
identify whether
turns the given
on which light. linked list is a circular linked list?
In which region Russia falls? You can only go in the room twice.
Name five countries in Europe.
Semaphores in OS
Why many
How sky is ballons
blue? would fit in this room, if given the volume of it and room. Note: placing balloons onto top of each other left some
space, how would you manage that in your calculations.
what is GDP
Who is the President of Pakistan, and the Finance minister.
OOP
If you are in a desert, create a UML diagram (showing the four pillars of OOP) of whatever you see.
Difference between abstract class and interface?
Can we create member variables in interfaces?
Can we define methods in abstract class?
What is Abstraction?
If a parent class has protected member variables and a child class inherits it and then another class inherits the child class, so can the grandchild class will be able to access the grandparent memebers?
DB
Map many to many relations without a junction table?
What are stored procedures?
What are the benefits of stored procedures?
What are triggers?
Difference between stored procedures and triggers?
What is sequence?
What is 3rd Normal Form?
Disadvantages of Normalizaton?
What is indexing and why we use indexing?
Can we create an index on primary key?
Disadvantages of indexing?
What is referential integrity?
What is cascade?
DSA
What is DFS and BFS?
Applications of DFS and BFS?
Difference between Hashmap and TreeMap?
Pseudocode of finding center node from a linked list? (in a single loop)
Pseudocode of removing duplicates from a linked list?
Difference between implementing an adjacency list with a vector of vector and a vector of the list?
Pseudocode to detect a cycle in a graph?
JS
What is defer?
What are promises?
Can we create a synchronous function using promises?
How to find out the datatype of a variable?
If a variable is intialized as a string in global scope and then assigned a int value in a method and then a bool value in a method is this a valid operations in JS?
4 sections