Questions tagged [interview-questions]

This tag is for questions that came up in an interview.

Filter by
Sorted by
Tagged with
0
votes
1answer
171 views

Clockwise rotate a matrix in Scala

Given a matrix, clockwise rotate elements in it. Examples: ...
0
votes
1answer
60 views

Custom indexOf for strings javascript with regex

I was wondering how efficient my code is creating custom indexOf for strings in JavaScript using regex instead of looping with a for statement the whole way in most ...
0
votes
1answer
52 views

find if one string is a valid anagram of another , in scala

Question is taken from leet code. Problem Given two strings s and t , write a function to determine if t is an anagram of s. Examples ...
0
votes
1answer
216 views

Reversing the vowels in a String

Given a string, reverse only the vowels present in it and print the resulting string. Input: First line of the input file contains an integer T denoting the number of test ...
0
votes
3answers
1k views

Move last node of the linked list to the front

Description: Given a linked list move the last node to the front. For example: 10 20 30 40 -> 40 10 20 30 Code: ...
0
votes
1answer
68 views

Generate power sets given a set of elements in java

For an array of length n, the possible number of subsets is Math.pow(2, n). for each value between 0 and Math.pow(2, n), see the index at which the bit is set, and include the corresponding number in ...
0
votes
1answer
128 views

Pascal Triangle c# code space complexity

can you give me your impression of my implementation of Pascal triangle problem? I'm especially interested in space complexity evaluation thank you all! ...
0
votes
1answer
183 views

Checking if a number is palindrome or not in Java

Got this question in a technical interview and here is my solution: ...
0
votes
1answer
60 views

Replacing all the 'u' with specific character that is given by the user

I got this question for a Junior Software Developer interview. And came up with this solution in Java: ...
0
votes
2answers
46 views

Expand spreadsheet ranges to lists of cells in Scala

Problem Spreadsheet cells are referenced by column and row identifiers. Columns are labeled with alphabetical characters, starting with "A", "B", "C", ...; rows are numbered from 1 in ascending ...
0
votes
1answer
65 views

Nodejs Interview - API calls and exchange rate

I did an initial technical phone screening with this company which went ok, they then sent me a programming exercise to complete and send back to them. The goal of the exercise: -take input as a ...
0
votes
2answers
628 views

Check if array contains contiguous integers with duplicates allowed in Java

Given an array of n integers(duplicates allowed). Print “Yes” if it is a set of contiguous integers else print “No”. INPUT: The first line consists of an integer T i.e. the number of test ...
0
votes
1answer
335 views

Adding comments to images

I'm working on an interview code sample in Javascript, which is not my first language. The task is simple enough: Given a webpage with a variety of images, allow the users to add comments. The code ...
0
votes
1answer
7k views

Find the intersection of ArrayList elements inside an ArrayList

So the structure is {{Dog,Cat,Human},{Human,Dog,Whale,rabbit,Cow},{Monkey,Human,Dog}}. Output should be: Dog,Human. I have to ...
0
votes
1answer
417 views

Deep copy linked list with a random pointer

I had this as an interview question through phone through an online text editor. The input is a linked list and in addition to a next pointer there is a random pointer that can point to any node ...
0
votes
1answer
675 views

Rearrange String such that similar characters are placed at least 'K' distance apart

So I was asked this in an interview, and I had to write this code on a white board. Sadly I couldn't complete the code :( . I've realized that writing code on white board is completely different ...
0
votes
3answers
195 views

Counting occupants in each HouseHold provided large file of comma seperated personnel records

I was given the below Exercise as part of a coding Exercise to do at home for a technical interview, and I did not get through past this round. I would like to get some input on what i could have ...
0
votes
1answer
263 views

Taking a node in rootA and finding a clone node in other tree

I was asked this as an interview question. I was also asked to assume that there is a function which can compare and say two nodes are identical. I would like to implement that function as well. I'm ...
0
votes
2answers
822 views

Given points on a 2D plane, find line that passes through the most points

Could someone give some feedbacks from perspective of oo design and coding style on the following codes: Question: Given n points on a 2D plane, find the Line with maximum number of points that lie ...
-1
votes
2answers
66 views

Given an integer number, invert its bits. You cannot use the ~ operator

Here is my code: ...
-1
votes
1answer
2k views

Determining whether a string can be rearranged into a palindrome

For a string, count the number of occurences of each character. If at most one character has odd count then the string can be a palindrome else it's not. ...
-1
votes
1answer
1k views

Maximum Difference in an Array [closed]

Maintain a minimum and max difference as we scan the input array. ...
-1
votes
1answer
99 views

Ad-exchange bidder exercise for a job interview

This was a straightforward test for a junior level position. The README.md estimated completion should take 45 minutes. Provided were class and function stubs to complete and several unit tests which ...
-1
votes
2answers
256 views

Two-sum solution in JavaScript [closed]

I was given this question during an interview. It is similar to two sum problems and I would like to ask for feedback for my solution. Merging 2 Packages Given a package with a weight limit ...
-1
votes
1answer
76 views

How to use C to solve Two Sum correctly? [closed]

Two Sum Problem: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may ...
-2
votes
3answers
7k views

Comparing 2 ints without using comparative operators

I was looking for questions that might be asked in a technical interview and I found this one: Write a function that determines if two integers are equal without using any comparative operators. I'...
-2
votes
3answers
133 views

Interview project to redesign a website for a property

I'm applying for a UI/UX position at a company that makes software for landlords, apartments, property managers, etc. After the interview the hiring manager gave me a project to work on. These are the ...
-2
votes
1answer
73 views

Finding Closest Sibling in a BST efficiently

Trying to print the closest sibling in a BST. How can I improve on this algorithm in terms of space/time efficiency? Please point out any potential bugs too! I'd appreciate that. ...
-2
votes
1answer
4k views

Find the GCD for given array of elements [closed]

I had faced a interview question to find the gdc(greatest common divisor) for an integer array of element in optimised way : ...
-3
votes
1answer
203 views

Implemented Stack using array

I'm going to job interviews soon. How I can improve my coding style and write better code? ...
-4
votes
1answer
518 views

Jumps of a pawn - Java interview [closed]

I have just attended a code test of some code testing site, and I think one question seems easy but I didn't get a high correctness, so if anyone can review this code snippet, I would appreciate it. ...