Posts

Showing posts from January, 2022

Bitwise operator

 &:  if a&1 then last digit of a will always same as in  previous a. a^1= compliment (a),  a^0=a, (diff bit =a) a^a=0, (same bit =0) coversion : Decimal --> n base = keep divide by base  exp : (17)D = ()2 =  ....... n base --> decimal = multiply each digit with the power of base and add them.   exp: 1* 2^3 + 0*2^2 + 0 * 2*1+ 1*2^0=.. Left shift : a<<b = a* (2^b) Right shift :  a>>b = a/(2^b) unique no. in duplicate array : xor all elements find ith bit of a no. n = n & (1<<n-1) set ith bit  = n | (1<<n-1) reset ith bit= !(1<<n-1) Find position of rightmost set bit negative no. in binary= 1st bit (MSB) = if 0 (+ve), id 1(-ve) neg no. by 2's compliment : find compliment of no. ..then add +1 1 byte range = -128 to 127 (total 256 no. can be stored..2^7) because we ignore 1st bit formula of range = -2^(n-1) to 2^(n-1) -1 find uniq no. in odd repeating no. array find nth magic no. find no. of digit in...

Time complexity

 Time complexity is not the time taken by a computer. It is a function that gives a relationship about time will (grows) increase as increase the input. Notation: Big o notation : f(x) < = g(x) little big o nation : f(x) < g(x)  [strictly] big omega notation : f(x) >= g(x) little big omega notation: f(x) > g(x) [strictly] big theta notation: g(x) < f(x) <g(x)        if f(x) = 3x+2, g(x) = n Space complexity :  actual space(input) + auxiliary space (extra space) SC for recursive function= height of the tree (path) because all the same level functions do not come in that stack at the same time.

Intellect Interview Experience

Image
            Intellect global Hiring Challenge Hello, this is jaya and in this post, I'm going to share my interview experience of intellect Design.        Basically, Intellect hires through Hackathon event, which was conducted on the D2C platform. There were multiple rounds : Online Quiz:   This round only asked java(Core+advance) fundamentals and some DSA based questions. There were 30 minutes to solve 25 questions. It was an elimination round, candidates who scored 70% and above were moved further to the next round. Demo Hackathon: It wasn't an elimination round, but it's mandatory to attempt, so we will be comfortable with the coding platform. Hackathon:    Basically, it was a coding challenge for one hour where they were given two coding questions based on DSA, during the contest we can write code only in java language, we couldn't switch the programming language. the first question was easy to moderate level, where ...