How to write an evaluator for a string like "(1+3 * ( 5 / 4)) and get a numeric result.
Engineer Software Interview Questions
512,223 engineer software interview questions shared by candidates
Connect Four is a game where two players take turns dropping their color discs into a vertically suspended grid. The game ends when a player adds a disc to the playing grid that connects four discs of their color. The connected discs can be in a horizontal, vertical or diagonal line. Write a function to be called after every turn that returns true if the game is over (and false otherwise).
Give an example of real world scenario where you see inheritance?
You have 16 race horses and a racetrack which only fits 4 horses at one time. Find the top 4 horses in the fewest number of races.
Find the maximum product of 3 numbers in a list.
Merge 2 sorted arrays A and B Result should end up in B, which has available space for all items Utilize the space in B, not using temporary arrays Result in sorted array in B A { 2, 5, 8, 12, 15} B { 3, 5, 7, 9, , , , , , }
You have two intersecting linked lists. Describe a function that returns a pointer to the node where they intersect.
1) I have class hierarchy and should create array of different instances of this hierarchy. They asked me to write a function which iterates this array and executes different methods according to the instance class. I suggested that downcasting is a bad idea and that it can violate Liskov substitution rule of the SOLID principles, and this problem should be solved using collections and generics, but they did not accept this answer 2) Create Queue N size using only N size array. 3) some Java concurrency related questions: synchronized volatile, atomic, etc....
sort an array N consists of four numbers, each number can be repeated k times, where k < n. Example: sort 1111144422223 to 1111122223444. Try to be as efficient as you can, not just O(n^2)
Given an array of unique non-negative integers, {A1,…,An}, and a positive integer, X, write a function that finds all pairs of numbers in the array that sum to X”. You are given an integer array nums sorted in ascending order (with distinct values), and an integer target. Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).” Take a singly-linked list, and reorder in such a way that the first element points to the last element, second element points to second-to-last element, and so on.
Viewing 1781 - 1790 interview questions