The interview-questions tag has no wiki summary.
0
votes
0answers
21 views
Optimizing this query based search
We have two N-bit numbers (0< N< 100000). We have to perform q queries (0< q<500000) over these numbers. The query can be of following three types:
set_a idx x: Set A[idx] to x, where 0 ...
1
vote
2answers
100 views
FizzBuzz implementation
The common FizzBuzz implementation I saw is using a check for % 15 for printing "FizzBuzz"
Would you let me know if there is anything wrong / better with this approach?
public class FizzBuzz {
...
2
votes
0answers
106 views
Java: Find the smallest integer not in the list - Memory Efficiency
This is a fairly popular interview question that I conceptually understand but have never really attempted to implement. In other similar implementations of this in Java I have seen they typically ...
-1
votes
1answer
209 views
Project Euler Problem 13
Hi.
I'm a novice C programmer. I'm trying to solve problem 13 but I feel as if my solution isn't as elegant as it could be. Can you please help me by providing me with advice on how to solve this ...
2
votes
7answers
244 views
Optimize an Anagram Checker
Two words are anagrams of each other if they contain the same letters, ie pots == stop
I'm working through interview questions.
The easiest way to check is to sort both words, then compare. But ...
2
votes
2answers
104 views
Can i improve my algorithm/code?
Question: You are given an array that represents bills in certain currency (For example 1, 2, 5, 10) and an amount, for example 17. You should output the number of possible combinations of bills that ...
2
votes
2answers
111 views
Better implementation of a simplified regular expression engine?
Task:
On an alphabet set [a-z], a simplified regular expression is much simpler than the normal regular expression.
It has only two meta characters: '.' and '*'.
'.' -- exact one arbitrary ...
4
votes
3answers
226 views
Converting int value to String without using toString and parseInt method
I am studying about the converting int to string and string to int without using toString and parseInt method.
I already made methods. However, I don't believe that my way of doing was the best.
I ...
2
votes
2answers
197 views
Ways to improve my coding test FizzBuzz solution for a TDD role?
I had an interview recently where I was asked to produce the traditional FizzBuzz solution:
Output a list of numbers from 1 to 100.
For all multiples of 3 and 5, the number is replaced ...
2
votes
1answer
258 views
PHP Fizz Buzz interview question code
Reading Jeff Atwood's "Why Can't Programmers.. Program?" led me to think that almost all of the solutions would not be something I would want in my own code-base. The Fizz Buzz program specification ...
2
votes
3answers
300 views
What is the security issue in this code?
I was asked how this code has a security risk. Does anyone have any ideas what it is? I am new on the security topic and don't know what to look for.
String DBdriver = "com.ora.jdbc.Driver";
String ...
13
votes
2answers
729 views
Interview screw up after this piece of code
I was screwed up after submitting this piece of work. But I have no feedback to know what "BAD" things inside this block of code.
The requirements are like this:
Connect to the server on a ...
3
votes
1answer
308 views
Sample finite-state machine interview question
We have interviewees write sample code, but now want them to modify some simple working code. I came up with the following proposal; it is a syntax-directed interpreter implemented with a table-driven ...
36
votes
15answers
4k views
Critique requested on the program to output the names without repetitions with the number of occurrences in order of decreasing repetitions.
A short while ago, I have submitted a coding exercise to a
potential employer. The response came back the next
morning and you can guess what it was from the subject
of this post.
I am not ...
1
vote
4answers
391 views
bounded blocking Queue
Can someone please review this code for me. I have not implemented all the methods for simplicity.
/**
* Implements a blocking bounded queue from a given non-blocking unbounded queue ...