Prove that p^2 – 1 is Divisible by 24

Problem: Prove that p2 – 1 is divisible by 24 if p is a prime number greater than 3? Solution: The most elementary proof , without explicitly mentioning any number theory: out of the three consecutive numbers p–1, p, p+1, one of them must be divisible by 3; also, since the neighbors of p are Read More →

Count Pairs of Numbers with a Given Difference K

Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Return count of such pairs. Example k=4 and a[]={7,623,19,10,11,9,3,15} Output should be : 6 Pairs can be: 7,11 7,3 6,10 19,23 15,19 15,11 Solution: Time Complexity: O(NLogN) Space Complexity: O(1)

Find Buy/Sell Prices in Array of Stock Values to Maximize Profit

Problem: You have given a stock prices for next 10 days. Find out: max benefit in best time complexity in buy and sell 1 share ? Condition: Share must be sold any day after buying date. For ex: Share price in thousands 5 1 4 6 7 8 4 3 7 9 Max benefit 9 – 1 Read More →

Nagarro Interview Questions – Set 2

Round 1: Aptitude test : 2 papers 40+6 questions 20 question was on reasoning (Moderate) 20+6 was maths questions (difficulty level was good) Round 2 : Telephonic round on the spot: 1. Tell me about yourself? 2. Define Automation framework? 3. Difference between High severity and low severity with example, what is important as QA point Read More →

Number of Trailing Zeros in Factorial of a Number

Write a program to output the number of consecutive trailing zeros in the factorial of a number? Solution: 1. The number of trailing zeros in a number is equivalent to the power of 10 in the factor of that number. 2. The number power of 10 in the factors is the same as the minimum Read More →

Myntra Interview Questions – Set 2

Profile: Backend Software Developer Process: 5 technical ( 3 rounds+ SVP round + CTO round ) + 1 HR Interview Question at Myntra Round 1: Q1. Change Binary tree so that parent node is the sum of root nodes. Q2. Reverse a linkedlist ? Q3. Given an array of +ve and -ve numbers , have to rearrange them Read More →

Possible Paths across a Rectangular Grid

Rectangular Grid

Problem: Consider a rectangular grid of 4×3 with lower  left corner named as A and upper right corner named B. Suppose that starting point is A and you can move one step up(U) or one step right(R) only. This is continued until B is reached. How many different paths from A to B possible ? Now let’s Read More →

Quikr Interview Questions – Set 2

Quikr Interview Questions for Developer Profile Location: Mumbai Written Test: One problem statement was given: You have been given stack of documents that have already been processed and some that have not. your task is to classify these documents into one of the eight categories: [1,2,3..8]. However you notice that there are already large amount Read More →

Quikr Interview Questions – Set 1

Company: Quikr Profile: Software Developer Profile, Bangalore location Round 1: Q1. Given a no K and an array. Find pair of elements whose sum is equal to given no K. Q2. If there is a website run by 2 servers. These 2 servers balances the load using Load Balancer. So, if 1 session is created Read More →

Linux Commands – Set 2

An L-Z Index of the Bash command line for Linux. L less Display output one screen at a time let Perform arithmetic on shell variables • link Create a link to a file ln Create a symbolic link to a file local Create variables • locate Find files logname Print current login name logout Exit Read More →

Linux Commands – Set 1

An A-K Index of the Bash command line for Linux. A alias Create an alias apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian/Ubuntu) aptitude Search for and install software packages (Debian/Ubuntu) aspell Spell Checker awk Find and Replace text, database sort/validate/index B basename Strip directory and suffix from Read More →

MakeMyTrip Interview Questions – Set 1

MakeMyTrip Interview Questions Q1. find out the subset of an array of continuous positive numbers from a larger array whose sum of of the elements is larger in comparision to other subset. eg: {1,2 5 -7, 2 5} .The two subarrays are {1,2,5} {2,5} and the ans is {1,2, 5} as its sum is larger Read More →