Find nth Fibonacci Number in the Fibonacci sequence?

In the Fibonacci sequence, the first two numbers are 0 and 1 and each number after that is the sum of the previous two numbers in the sequence. So, the sequence looks like this: 0, 1, 1, 2, 3, 5, 8, 13, 21… and so on. The “0″ in the sequence is considered to be Read More →

Clustered and Non Clustered Index

In SQL Server database there are mainly two types of indexes, Clustered index and Non Clustered index. For those, who are not aware of benefits of Index or why we use index in database, they help in making your SELECT query faster. you must index on columns which are frequently used in WHERE clause of Read More →

C Programming Quiz – Set 2

Proramming Questions & Answers – Who should Practice these C Questions? – Anyone wishing to sharpen their skills on C programming language – Anyone preparing for aptitude test in C (both objective type test and C coding written test) – Anyone preparing for interviews (campus/off-campus interviews, walk-in interview and company interviews) #1: What is the Read More →

Operating System Interview Questions – Set 2

Operating System Questions and Answers – This set of Operating System MCQs will be useful for interview preparations for experienced people. #1: The two steps of a process execution are : (choose two) a) I/O Burst b) CPU Burst c) Memory Burst d) OS Burst Show Answer Answer: a and b Explanation: none. #2: Scheduling Read More →

Operating System Interview Questions – Set 1

Operating System Questions and Answers – This set of Operating System MCQs will be useful for interview preparations for experienced people. #1: A system is in the safe state if a) the system can allocate resources to each process in some order and still avoid a deadlock b) there exist a safe sequence c) both Read More →

C Programming Quiz – Set 1

Proramming Questions & Answers – You should practice these quizzes to improve your C programming skills needed for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive exams. #1: Which is valid C expression? a) int my_num = 100,000; b) int my_num = 100000; c) int my num = 1000; Read More →

Computer Networks Quiz – Set 2

Computer Networks Questions & Answers – #1: Physical or logical arrangement of network is a) Topology b) Routing c) Networking d) None of the mentioned Show Answer Answer: a Explanation: None #2: This topology requires multipoint connection a) Star b) Mesh c) Ring d) Bus Show Answer Answer: d Explanation: None #3: Expand WAN a) Read More →

Computer Networks Quiz – Set 1

Computer Networks Questions & Answers – #1: Transport layer aggregates data from different applications into a single stream before passing it to a) network layer b) data link layer c) application layer d) physical layer Show Answer Answer: a Explanation: None #2: Which one of the following is a transport layer protocol used in internet? Read More →

Bharti SoftBank (HIKE) Interview Questions – Set 2

Written Test 1. The test consisted of 10 MCQ’s on Aptitude and 10 MCQ’s on C programming. 2. It also consisted of 2 programming questions which were easy. Technical Interview: Q1. Find the mirror image of a binary tree. Q2. Maximum length path between any two nodes in a tree. Q3. A question on Btrees? Read More →

Merging 2 Arrays without using Extra Space

Given two sorted arrays, A and B. Write a method merging the elements of B into A in sorted order. Assume A has a large enough buffer at the end to hold all of B’s elements. Solution: Suppose we want to merge two arrays a1 and a2. a1 has n elements and has space for Read More →

Largest Difference in an Array

You have an array of integers: int[] A = { 10, 3, 6, 8, 9, 4, 3 }; My goal is to find the largest difference between A[Q] and A[P] such that Q > P. If P = 1 and Q = 4 diff = A[Q] – A[P] diff = 9 – 3 diff = Read More →

Minimum Distance Between Array Elements

Given a non-negative integer array, Find the minimum distance between 2 distinct elements of A. Minimum Distance is defined as if P != Q then |(A[P] – A[Q])| Solution: Time Complexity: O(N)