Oh sorry I didn't include this,
it is a software engineering role - a very general one. Especially the 1st few rounds will be very general (data structures and algorithms and such), so I was interested in a mock interview of that kind.
GrowFastDigital, thanks for the suggestion. But I'm going to be phone screened first, and I wanted to have some phone like mock interviews
From my experience, it isn't really easy to contribute to a not-so active project. I don't know if you will easily get into the flow, by forking any github project. Perhaps, you want to try a slightly large organization? Linux, Ubuntu, Fedora, Mozilla... they have these "where do I start" pages which should pull you along.
The amount of processing to be done is really large. All my implementaions ran far too long.
If you run it all the way through, yes. But you can also bail out as soon as you find a solution that is "good enough" in your judgment.
I don't have any heuristics that will tell me if a solution is "good enough". By good enough I meant one produced by an intuitively convincing greedy algorithm :)
Actually this sounds like a good way to limit your choices: Only consider actions that bring you closer (for some definition of "closer") to connecting the parts, ignoring moves that don't really help.
I've been finding it really hard to write what you say in code. A definition of "closer" is quite complex to me.
If I advance/find out anything more, I'll post here.
Nope I haven't been able to think of a particular strategy. The only thing I was able to do was separate it into components and join the components. This of course uses just turning a non-verex into a vertex (one of those 3 moves).
About the game tree approach, it is just brute force isn't it :)
I don't think it is feasible at all. It would produce the best solution though
Is there a greedy approach? One that would give a decent result?
If "one single connected component" means you're supposed to modify it to be a connected graph, then what does it actually mean to be adding, removing, and moving nodes? There will generally be multiple ways to connect disconnected subgraphs, so if the grid is meaningful, how do you decide which is the "right" connection to make?
Imagine there is a real grid of rooms in each of which may lie of computer. Each computer may communicate with a computer next to it(not diagonally though). In one arrangement it so happens that not all computers are able to communicate with eachother (for obvious reasons of lack of connectivity). Our task is to either:
add new computers to empty rooms
delete computers from some rooms
move a computer from one room to another room next to it
or any combination of the above 3.
Each of those 1,2 and 3 have costs.
We want the minimal cost or atleast a good cost. "The" right connection is the one with least cost.
However if that is hard we could settle with a "good" cost.
Theguitarist, there needs to be some type of visual feedback for people to understand how the feature works. How would the system know when you're done selecting all your pieces of text?
I'm thinking the system finds out when the user hits the Quote button in the editor's menu.
It could be over the course of ten minutes with a five minute break between selections?
Yes, I'm not denying the usefulness of the pop-up. In the above case, it works alright. I'm just talking about the special case when you select some text even while the pop-up is being displayed. Perhaps you could cut short the pop-up there and forget about it? Just deal with the next pop-up like nothing happened before.
Am I missing something?
Well it is important. Not just for display. On a normal graph you could connect 2 vertices with an edge no matter which the 2 vertices are. Here it is only vertices right next to each other can be connected. Each cell in the grid constrains the location of the vertex in it.
The problem wants a solution with the grid structure in mind.
Hope I didn't confuse you further :P
I had complained about this sometime ago and most of it got fixed and the site in general is a lot better.
But there is one thing annoying about that "Insert with the Quote editor button" popup :
Select some text
even while the popup is being shown select some other text
Do 2 many times
When you're done with doing this, I'd expect the popup to be shown one last time for the last text I selected.
But what happens is that it gets shown a lot many times. The problem can be replicated even easily with double-clicking on text.
Though I'm not really knowledgeable here, I think this should be an easy fix.
I watched the 1st lecture in the design and analysis of algorithms course of MIT (Open CourseWare). He starts off from the very basics. He says the purpose of that course is to study efficiency of algorithms. Then he lists what is more important than the efficieny: all the stuff you mentioned (maintainability, readability, simplicity, user experience, etc.) Why study efficiency then? He says it is to buy those more important commodities :)
If one can write an algorithm that is significantly faster than a brute-force one, that is better.
Satisfying the customer is the goal, yes. But there are so many roles that would contribute to that. A UX designer would, a software tester would. But all my peers and companies that recruit interns look for people who can write algorithms that are fast.
I just fail to see the wonderful patterns that arise out of the better(faster) algorithms.
I wonder if solving tons of problems on topcoder, codeforces, etc. would actually help.
Did someone who simply couldn't write efficient code (complexity-wise) before, felt intimidated by people who did, decide to work really hard, try to solve an insane number of problems, actually get better?
I've been in touch with programming since some 4-5 years. Some of my friends who recently picked up C and speak total rubbish about it, solve those hard programming problems. I end up writing a long well polished program that employs brute force, while they get the best algorithm implemented with some really messy code.
I understand programming structures quite well, can read documentation, write understandable code.
Could reading a CLRS and working day and night at topcoder help me?
Which brings me to my next point, how are you going to determine that someone is "searching" on a website? You search on anything, it is just a form that passes that user input.
True. It isn't possible to be sure if it is a search form or some other form.
That is one of the reasons why the staright forward algorithm would fail. So I was asking here for ideas that might meaningfully understand that it is a search. I really don't know the answer to this, and I thought I could find answers here. I asked for help in these issues.
The submission form u use the most is in fact a user name and a password, so - this is, what you thing it is - exactly!
Not sure what you're trying to say. If I wanted usernames and passwords I could have taken that information directly. It is not hard to identify login forms. Why find out if a form is a search form?
Besides why would anyone run such a script? If the script was pulled into the browser's source repo, it would get run, and why would developers pull malicious scripts into their code?
I'm sorry, it's not. May I ask why it sounds like that? Detecting any website as a search engine so the data can be kept inside the user's computer? Anyway it's not.
I is posible to directly read the historydatabase for firefox using php.
Since I am trying to extend a browser's functionality, I do have direct access to that data. My question was different.
I hope I asked the question clearly.
A user searches a lot in a website. That site could be detected as a search engine.
The straight forward way: check how many times he searched. If too many, maybe it is a search engine.
I just asked for ideas that could improve this, and perhaps where this would fail.
you tell me how do you observe form submitions and what website the user is submiting it on,
and I'll tell you absolutely everything else you need to know, I'll even write the original code you are asking for...
If I am working with a browser's source code, I can use their API to observe form submissions, know what website and even maintain a record of previous searches. I am not aware of how to do this from scratch, but I can use those APIs.
I didn't ask for any code. That was why I didn't mention any of this.
I'm asking for ideas. Please tell me.
I'm working on a project where I must observe form submissions in websites and detect a search engine if a form is used consistently.
I don't really want any help with coding this. I just want some ideas for an algorithm.
Like, for example if I were to come to Daniweb and search for something everyday, after sometime I must be suggested to use Daniweb as a search engine.
A typical algorithm would count the number of times I searched in Daniweb and if it exceeds a number, it should detect the Daniweb search form as a search engine. This seems too trivial.
I have not the experience to tell if this would practically work and produce neat results.
Assume I have the technical ability and resources (like form history, databases) to implement any algo.
Why is showAges() a member function? It doesn't really need a current instance (this) to work. It works on an array of objects passed as a arguments, like you said. You might as well make it a non-member function. (Oh, my bad, you were just trying it this way. Sorry)
You should write a constructor function.
You might want to make showAges take an extra parameter, the number of elements in the array being passed and iterate over all the elements of the array as opposed working on just the 1st 3.
The problem with the manager occurs in a public member function of class Client. Do I need to create an instance of the class Client inside the member function? I've never seen that.
No, no. You have IRManager* manager; in your Client class. It should be fine to invoke manager's member functions.
But, in general a static member function cannot directly call a non-static member function. Like here.
And when you say "main" function, you mean Client::_tWinMain. Right?
And the error message right at that line (manager->HangUp();) ?
I read on the web that using tables for layouts is not a good idea or a good convention. So I thought I'd avoid it.
I mean, what I'm creating isn't a data table after all. It is a small grid like you said.