|
say i hard many people like started in interview face question like to find out palindrome word writing program. so is there any web site which show basic question asked for various algo during interview.
i like similar question like palindrome word or number which many people learn during programming with c and c++ for developing logic sense.
anyone can redirect me to those web site from where i can acquire many also like palindrome which people learn during programming and also asked during interview. thanks
tbhattacharjee
|
|
|
|
|
Are you asking for questions to ask people, or for questions that you might be asked in an interview?
|
|
|
|
|
Sorry probably i could not explain properly. i search Google but may be could put right keyword so i am not getting a web site which help peole to learn programming by c,c++ or c# with many logical program like Fibonacci series or palindrome word or number and various kind of sorting etc.
so if anyone know about any web site from where we can see many program is there for learning purpose then please share the url. thanks
tbhattacharjee
|
|
|
|
|
I suggest that you first learn how to communicate in English before trying to program in any other language!
|
|
|
|
|
No, I'm afraid there isn't.
Interviewers can ask the candidate to do anything (within reason, it will be related to the job function in some way) so there is no "set of algorithms" that interviewers have to pick from.
It's not to check if you remember algorithms, to to find out how you think - when you don;t have Google to do it for you!
What the interviewer is looking for is to see how well you handle simple problems (and palindromes are indeed a very simple problem) to see if the way you think fits in to how his company works. Memorizing algorithms won't help you there because the chances are the task will be unrelated to any particular algorithm, but how you implement the things do you know.
So relax, be confident, and think about the task they set - rather than trying to use the thinking of others to get you a job! (Because if you rely on others to pass the interview, you won't last long once in the job - everyone can spot the "dead wood" who can't actually do the work)
You'll be fine!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Sorry probably i could not explain properly. i search Google but may be could not put right keyword so i am not getting a web site which help peole to learn programming by c,c++ or c# with many logical program like Fibonacci series or palindrome word or number and various kind of sorting etc.
so if anyone know about any web site from where we can see many program is there for learning purpose then please share the url. thanks
tbhattacharjee
|
|
|
|
|
Don't focus on tasks: instead learn by doing. Get a book, or a course and do the exercises - they introduce the concepts in a logical sequence, and (hopefully) mean that you understand fully what you are doing before moving on to the next subject.
Trying to find existing programs doesn't help at all in that: you don't learn as much (or as well) by "looking" as you do by "doing".
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: What the interviewer is looking for is to see how well you handle simple problems (and palindromes are indeed a very simple problem) to see if the way you think fits in to how his company works.
To be fair and clear that is what the interviewer thinks that they are doing.
Statistically most of the time such skill tests would work just as well if they handed the interviewee a bag of Legos and ask them to build a car.
|
|
|
|
|
A random array of elements is given. Your program needs to find all the sections(sequences) in the array that are in ascending order, find the sum of those sequences, then find the largest sum and print the largest sum along with the sequence of numbers. For example if the array is like
4, 5, 6, 2, 1, 2, 3, 4, 12, 6, 4, 2, 1, 5, 8, 9
Then ascending sequences in the given array are
· 4,5,6 with sum 15
· 1,2,3,4,12 with sum 22
· 1,5,8,9 with sum 23
So your program should print the sequence 1 5 8 9 and the sum 23, as it’s the largest sum of ascending sequences.
|
|
|
|
|
Your homework is set to test what YOU know. If you can't do it, then talk to your teacher.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sure, I'll help you. The key to solving this issue is to break it down into logical chunks from your requirements.
1. Find all ascending order sequences.
2. For each result from step 1, sum the values
3. Identify the largest out of step 2.
So, you see that you have three logical areas. You know that you have an array and that you start at element 0, so all you need to do to complete step 1 is to check to see if the next value is 1 greater than the current value or if you have reached the end of the list. Store your value in an appropriate data structure and move onto the next. Once you have completed this stage, proceed to break the other stages down into a logical set of steps and solve.
|
|
|
|
|
|
Pete O'Hanlon wrote: see if the next value is 1 greater than the current value It doesn't have to be 1 greater, just greater.
OP said that 1,2,3,4,12 was an example of a correct sequence.
(Ascending vs. sequential)
A positive attitude may not solve every problem, but it will annoy enough people to be worth the effort.
|
|
|
|
|
An excellent point. This is the problem with making assumptions.
|
|
|
|
|
And?
What have you tried?
Where are you stuck?
Why do you think we want to do your homework?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I'd like to see a solution using LINQ!
Regards,
Rob Philpott.
|
|
|
|
|
DataSet ds = new DataSet();
string f = dateTimePicker1.Text.ToString().Trim();
string t = dateTimePicker2.Text.ToString().Trim();
ds = bl.Totall(f,t);
dataGridView1.DataSource = ds.Tables[0];
but there is error :"Cannot find table 0".
plz help me.
|
|
|
|
|
Member 11479040 wrote: ds = bl.Totall(f,t); ..and what's that supposed to be / to do?
|
|
|
|
|
Your code looks like it's expecting a DataSet to be returned from Totall. Whatever goes on in this method should create and append the DataTable to a DataSet that is returned out. BTW, you can drop the initialisation of your DataSet and just call
DataSet ds = bl.Totall(f,t); Also, please use better variable names. I assume f means from and t means to.
|
|
|
|
|
ds.Tables[0]
is where the exception is happening - ds has a an array of tables called Tables .
The exception is being caused by the array being empty. Why it's empty I can't know, this line:
ds = bl.Totall(f,t);
is the closest anyone can get. Setting aside the mis-spelling of "Totall" which you might want to fix, the bl.Totall(...) method isn't returning an array with anything in it - so that method is your problem. As you haven't provided the code for that method, we can't tell why it's returning an empty array. If you want further help, you'll need to post the code for that method and anything else associated with it that is relevant.
|
|
|
|
|
A was looking at now of the projects which describing how to simulate mouse movement and clicking on a certain coordinates.
I wrote this code based on what I learned from that project, it's actually the same..
but it's not working..
if this code is not correct
is there any way of doing that ? and how to implement that..
this the code
[DllImport("User32.dll")]
public static extern void mouse_event(MouseEventType dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
[DllImport("User32.dll")]
public static extern int SetCursorPos(int x, int y);
public enum MouseEventType : int
{
LeftDown = 0x02 , LeftUp= 0x04, RightDown= 0x08, RightUp= 0x10
}
and here is event handler, so when I click the button the mouse supposed to move to the coordinates..
private void button1_Click(object sender, EventArgs e)
{
SetCursorPos(300, 200);
mouse_event(MouseEventType.LeftDown, Cursor.Position.X, Cursor.Position.Y, 20, 20);
mouse_event(MouseEventType.LeftUp, Cursor.Position.X, Cursor.Position.Y, 20, 20);
}
any help in this,,
thanks
|
|
|
|
|
"but it's not working.."
That's not helpful.
What is it doing that you didn't expect, or not doing that you did?
Remember that we can't see your screen, access your HDD, or read your mind - we only get what you tell us to work with!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I only need to move the mouse to any coordinate after clicking on a button, only that is it!
I have a form application contains only a button, when I click the button (as you can see from the handler) I just need the mouse to be moved to any coordinate..
I know It may not difficult, but I couldn't do it till now..
I'm using VS 2012 ultimate..
thanks
|
|
|
|
|
And? What is happening when you run your code?
I really can't see your screen!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
if you mean the code which I written, nothing happens, it's not working at all. when I click the button nothing happens!!
if you mean what I need to get, it's only moving the mouse without touching any thing!!
|
|
|
|
|