I have a log that consists of more than 100 million lines. Each line is just a data about user login, login time, etc. I want to sort them based on user login, and then if there is a tie based on login time, etc. However, I have limited memory, so don't think of storing all of them in an array. The memory can only hold n data where n is much smaller than 100 millions. You can access the disk though although it is much slower. How will you do it so that it is as efficient as possible?
Engineer Software Interview Questions
511,683 engineer software interview questions shared by candidates
I have three water jugs, one with 10 liters another with 5 and another with 6, how do i get 8 liters on the first one?
Given an array of int[] like 1,2,3 Find the next largest integer than can be made with these digits (e.g.: 2,1,3)
List of n number with k numbers missing. How do you identify the missing numbers? What is the run time?
Given an array a contains all digits 0-9 a = [1, 4, 2, 1] # which represents 1421 Add one to the number and return the array return a = [1, 4, 2, 2] # which represents 1422
Except experience related questions I was asked coding question and I was supposed to write the solution to the problem in any programming language in a simple web-based code editor. The question was: given and array of positive integers and another integer find whether there is a consecutive range in the array, so that the sum of integers in the range is equal to the given number. They put an emphasis on delivering working, efficient solution. In my opinion this kind of interview requires a thorough preparation.
Given a string, remove all chars from the string that are present in say another string called filter.
Given sorted arrays of length n and 2n with n elements each, merge first array into second array.
Write a function to determine if a bin tree is a valid BST. I wrote a fully working solution in 3-5 minutes. It was also the most optimal but maybe because she needed to kill time, she asked me to rewrite it in what she thought was optimal (her reasoning didn't make much sense). Then she asked me for time and space requirements of the solutions. I said O(n) for both which is correct but she insisted that the space requirement was O(logn) which is wrong.
Print a binary tree level by level
Viewing 711 - 720 interview questions