Interview questions
Software Developer interview questions – page 17
945 questions. Tap “Show answer” to check yourself.
-
How the memory is structured (heap, stack, etc). He wrote a program and asked which variables would be stored where etc. As I mentioned that I like Algorithms, he then went on to Algos
-
Data compression: Given a string "aabbbccc", save it as "a2b3c3". Here, I was asked to write a pseudocode, followed by a code in C++, optimize it and then all the testcases. Eg. "aabcc" would become "a2bc2" and not "a2b1c2"
-
You're in the center of a circular pond, with an *intelligent* lion at the circumference - intelligent implies you can't trivially fool it. Given that, your swimming speed = x, lion's running speed on land = 4x, your running speed on land = 4x, Devise an escape strategy so that you can safely escape. Is escape possible?
-
Given a pointer to the root of a binary tree, find whether the left and right subtrees are mirror images of each other
-
Given a string INPUT, find the longest repeating substring
-
2 magnesium strips and a matchbox are given. Each burns in 60 minutes, with no relation between length burnt and time. Calculate 45 min
-
You have 3 baskets- one containing apples, one oranges and the last containing both. All baskets are incorrectly labelled.You can pick *one* fruit from *any one* basket and are supposed to correctly label all of them
-
Given a bit pattern (in an integer INPUT), and another pattern (in an integer PATTERN, with a number n signifying the number of trailing bits to be considered as pattern - remaining bits are zero. Example: PATTERN=00000110, n=3 represents "110") Find the number of occurences of PATTERN inside INPUT
-
Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2 Solution is O(n^2) Write code and testcases
-
Find the height og a binary tree without recursion. Write code and testcases
-
Tower of hanoi?
-
Circular queues, binary trees, recursion
-
Recursion, heap and stack management
-
Memory protection in OS?
-
You have a lot of small integers in an array. You have to multiply all of them. You need not worry about overflow and range, you have enough support for that. What can you do to speed up the multiplication on your machine?
-
Design a data structure for excel spreadsheet?
-
OS support for parallelism
-
They started with something I did not even think of, Images fundamentals. Making images blurry, making them shaggy
-
Operating on images in parallel
-
Hardware engines support for parallelism
-
Preprocessor directives,volatile keyword
-
Virtual pointer table,operator overloading,friend functions,semaphores
-
Diamond heirarchy problem
-
Fibonacci series.(:P)
-
Find space and time complexity for a recursive function(he wrote it)
-
Program to check whether your machine is little endian or big endian
-
Print something before execution of main()(use static objects)
-
Memory allocation for static varibles(when,which segment etc)
-
Given an integer(consider 4 bytes) find which byte is zero
-
Concept of virtual destructors,runtime polymorphism