Search Results

Search found 1507 results on 61 pages for 'interview'.

Page 24/61 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Where can I learn more about datastructure tricky questions?

    - by Sandbox
    I am relatively new to programming (around 1 year programming C#-winforms). Also, I come from a non CS background (no formal degree) Recently, while being interviewed for a job, I was asked about implementing a queue using a stack. I fumbled and wan't able to answer the question. After, the interview I could do it(had to spend some time). I have learnt (and think that I know it well) basic algorithms in datastructures using the book Data Structures: A Pseudocode Approach with C - Richard F. Gilberg (Author) . I want to know about sites/ books which have such questions along with answers. I think this will allow me to develop my CS specific problem solving skills. Any help is appreciated. BOUNTY: I am looking at some blog/website with datastructure and algorithms Q&A.

    Read the article

  • How can I tell if a candidate is a good Sharepoint Architect / Developer ?

    - by driis
    I need to interview some people for a position as a Sharepoint Architect / Developer role. While I am proficient in .NET, I have worked very little with Sharepoint, so I am unsure how to test the candidates Sharepoint skills. Do you have any suggestions for tests I can throw at the candidates ? Please suggest questions I can ask the candidates; and please specify whether your question is "Must know" knowledge for a Sharepoint developer. Please include the answer to your question.

    Read the article

  • What are good resources to learn Coldfusion for a job application...

    - by NoMoreZealots
    The job title is "ColdFusion Developer." I have bit's HTML and Javascripting experience, but mostly have worked in the "harder" languages such as C and C++ with occational flurries of assembly. I'm currently employeed, but in the current job climate I figure it can't hurt to be looking around and applying for other positions. Plus according to the friend who sent me the job posting, it is suppose to pay "very well." They left my office to work for this company themself so I figure it's a reasonable evaluation of the company. I don't know if there are any free tools that I could use to get my feet wet and bone up for an interview, or what sort of literature is decent for the ColdFusion. Plus any ideas on how to tune a resume for it would also be helpful.

    Read the article

  • Given a string of red and blue balls, find min number of swaps to club the colors together

    - by efficiencyIsBliss
    We are given a string of the form: RBBR, where R - red and B - blue. We need to find the minimum number of swaps required in order to club the colors together. In the above case that answer would be 1 to get RRBB or BBRR. I feel like an algorithm to sort a partially sorted array would be useful here since a simple sort would give us the number of swaps, but we want the minimum number of swaps. Any ideas? This is allegedly a Microsoft interview question according to this.

    Read the article

  • How to remove characters from a string?

    - by masato-san
    Hi, Below is interview question so you cannot relay on the functions that predefined in libraries. Also my answer below set the element to null but there is another ways to solve the problem. Given string $string = "This is a pen", remove "is" so that return value is "Th a pen" (including whitespece). I've tried (shown below) but returned value is not correct. Thanks in advance! function remove_delimiter_from_string(&$string, $del) { for($i=0; $i<strlen($string); $i++) { for($j=0; $j<strlen($del); $j++) { if($string[$i] == $del[$j]) { $string[$i] = $string[$i+$j]; //this grabs delimiter :( } } } echo $string . "\n"; }

    Read the article

  • Is it possible to apply inheritance to a Singleton class?

    - by Bragaadeesh
    Hi, Today I faced one question in interview. Is it possible to apply inheritance concept on Singleton Classes. I said since the constructor is private, we cannot extend that Singleton class (can someone please validate this). Next thing he asked me is to apply inheritance on that Singleton class. So, I made the Singleton's constructor as protected thinking that child's constructor also has be protected. But I was wrong the child can have a modifier either equal to or higher than that. So, I asked him to give a real world example on such a case. He was not able to give me one and said that I cant ask questions and wanted me to tell whether this scenario is possible or not. I went kind of blank. My question here is, Is this possible? Even if its possible, what is the use of it? What real world scenario would demand such a use. Thanks

    Read the article

  • Ideally How many connections I have to open ?

    - by ranjith-kumar-u
    Hi All, Recently I attended interview in java, the interviewer asked a question like below: I have a request which go throgh A,B,C modules and response go back throgh A , in module A I need to talk to database and again in module C I need to talk to database, so in this situation how many connections you will open and where do you close those connections? My Answer: I said that in module A I will open a connection and I will close it then and there, then control go to module B then module C, in module C again I will open one more connection and i will close it again. then he asked me again another question I want to open one connection per one request processing, how can i do this?

    Read the article

  • How to serialize a graph ?

    - by Michael
    This is an interview question: How to serialize a graph ? I saw this answer but I am not sure if this is enough. It looks like a very confusing "open question" and the candidates are probably expected to ask more questions about the requirements: what the nodes and edges are, how they are serialized themselves, is this graph weighted, directed, etc., how many nodes/edges are in the graph.What about the infrastructure ? Is it a plain file system or we should/can use a database ? So, how would you answer this question ?

    Read the article

  • Design Stock Server Application in C++

    - by Avinash
    [Queston asked in ML Interview] Design an server/application which handle multiple incoming stock information ( stock symbol and values ) Server need to store the information in some cache ( need to design the data structure ), There are multiple client connected to server using tcp/ip socket. They will subscribe to particular request say stock symbol XYZ , and may be for more then one. As and when there is change the stock symbol server should broadcast the information to subscribed client. If tcp/ip write failed, server should handle the unregistration of the client. What various data structures will be used and how threading model will be ?

    Read the article

  • How to parse a string to an integer without library functions?

    - by dack
    Hi, I was recently asked this question in an interview: "How could you parse a string of the form '12345' into its integer representation 12345 without using any library functions, and regardless of language?" I thought of two answers, but the interviewer said there was a third. Here are my two solutions: Solution 1: Keep a dictionary which maps '1' = 1, '2' = 2, etc. Then parse the string one character at a time, look up the character in your dictionary, and multiply by place value. Sum the results. Solution 2: Parse the string one character at a time and subtract '0' from each character. This will give you '1' - '0' = 0x1, '2' - '0' = 0x2, etc. Again, multiply by place value and sum the results. Can anyone think of what a third solution might be? Thanks.

    Read the article

  • Where does static variable work in C# page. At Application level or Page Level

    - by Shantanu Gupta
    I had an interview today and every thing was going very good, but then an interviewer asked me a question Where Does Static Variable Work in C#- At Application Level or At Page Level. I was not very much clear about this answer as I only knew that static variables are stored on heap and I didn't knew anything about web related thing about it. Then tried to make me more clear by giving an example that in a page I am using static variable and three users are accessing the page one of the user updates the value of static variable, What value will be visible to remaining two users an old copy or the update will be reflected.

    Read the article

  • Dealbreakers for new programming jobs?

    - by Echostorm
    What might be said or implied at an interview or job posting that should set off alarm bells for a coder? I'm still only a few years in the industry but I already know to look out for excessive red tape and bureaucracy. Cubes and a noisy office also tell me that I'll be both miserable and unproductive and that management does not appreciate what coders need to work well. Edit: The way things are going I'm taking extra time to look at the company's stability. If they depend on a single vendor for their livelihood and could be out of business if the vendor decides they don't really need the service or can do it in-house. What are your dealbreakers?

    Read the article

  • Arrange 0's & 1's in a array

    - by Ganesh M
    This is one of an interview question which I had recently. I would like to know others perception of approach for this problem. Question: You are given a structure which holds an employee details with two elements as int Deptartment and string Name. struct Employee { string Name; int Dept; } You are given details of N Employees among which there are N/2 employees Dept are 0's and N/2 employees dept are 1's arranged in some random order. You need to sort the employee details based on their Dept value and it should be stable i.e., the order of 1s and 0s in the original record should be maintained. For example, given the following sample data: Name Dept X1 0 X2 1 X3 0 X4 1 X5 0 after sorting the result should be: Name Dept X2 1 X4 1 X1 0 X3 0 X5 0 The algorithm should be stable and the complexity should be o(N), with constant space for additional variables (which means sorting should be done in-place).

    Read the article

  • How to find the length of a linked list that is having cycles in it?

    - by Bragaadeesh
    This was one of the interview questions asked. How to find the length of a linked list that is having cycle in it. I know how to calculate whether a linked list has a cycle or not using Hare and Tortoise technique. I even know how to calculate the length by storing the addresses in a hashset. But what I was not able to tell is how to calculate the length of the linked list without using a external space of O(n). Please help me. Thanks.

    Read the article

  • C# Improved algorithm

    - by generixs
    I have been asked at interview (C# 3.0) to provide a logic to remove a list of items from a list. I responded int[] items={1,2,3,4}; List<int> newList = new List<int>() { 1, 2, 3, 4, 5, 56, 788, 9 }; newList.RemoveAll((int i) => { return items.Contains(i); }); 1) The interviewer replied that the algorithm i had employed will gradually take time if the items grow and asked me to give even better and faster one.What would be the efficient algorithm ? 2) How can i achieve the same using LINQ? 3) He asked me to provide an example for Two-Way-Closure? (General I am aware of closure, what is Two-Way-Closure?, I replied there is no such term exists,but he did not satisfy).

    Read the article

  • Microsoft : « Nous ne sommes plus en guerre contre l'open-source », interview de Alfonso Castro, Directeur de la Stratégie Interopérabilité

    Microsoft : « Nous ne sommes plus en guerre contre l'open-source » Interview de Alfonso Castro, Directeur de la Stratégie Interopérabilité chez Microsoft France Sponsor Platinium d'un des plus importants événement Java sur Paris (le What's Next), présent au Salon Solutions Linux du mois dernier, soutien à Node.js annoncé aujourd'hui, Microsoft multiplie les signes d'apaisement et de bonne volonté auprès des communautés open-sources. Ces deux évènements et cette annonce étaient l'occasion de faire le point sur les relations, historiquement assez tendues, entre l'entreprise commerciale Microsoft et les communautés bénévoles de développeurs...

    Read the article

  • Should we tell our expected and current CTC just in mail before interview?

    - by jitendra
    Should we tell our expected and current CTC just in mail before interview? I read on many resume advices "never put salary info in resume" but these day every company ask expected CTC then takes interview. What should i give in reply to this type of mail where company is asking for expected and current CTC before interview? Can they appoint me directly , without interview? Should i ask any other question to company before giving expected and current CTC? Hi, This is Mikel from london I found your resume on a job portal and it's very good .We have very urgent requirements @ london. Requirement1 : Senior Web Designer Experience: min4+yrs Skills:HTML,Adobe Photoshop, Javascript,CSS, Dreamweaver,Accessibility Etc.. If you looking for change just forward your latest resume to [email protected] along with these details Contact Number: Current CTC: Expected CTC: Notice Period: Current Location: Like to Relocate to London (Y/N):

    Read the article

  • What to expect during an interview with a senior development executive?

    - by Umanga
    I passed first two technical interviews at a global e-commerce company for the position of senior software engineer. I was told that there are two more interviews, one with a senior development executive and another with a person from human resources (HR). What kind of questions I should expect during the interview with the senior development executive? Is is technical, high level architecture related, etc.? During HR interviews, is it ok to ask about the work-life balance and actual working hours?

    Read the article

  • SQLAuthority News – Job Interviewing the Right Way (and for the Right Reasons) – Guest Post by Feodor Georgiev

    - by pinaldave
    Feodor Georgiev is a SQL Server database specialist with extensive experience of thinking both within and outside the box. He has wide experience of different systems and solutions in the fields of architecture, scalability, performance, etc. Feodor has experience with SQL Server 2000 and later versions, and is certified in SQL Server 2008. Feodor has written excellent article on Job Interviewing the Right Way. Here is his article in his own language. A while back I was thinking to start a blog post series on interviewing and employing IT personnel. At that time I had just read the ‘Smart and gets things done’ book (http://www.joelonsoftware.com/items/2007/06/05.html) and I was hyped up on some debatable topics regarding finding and employing the best people in the branch. I have no problem with hiring the best of the best; it’s just the definition of ‘the best of the best’ that makes things a bit more complicated. One of the fundamental books one can read on the topic of interviewing is the one mentioned above. If you have not read it, then you must do so; not because it contains the ultimate truth, and not because it gives the answers to most questions on the subject, but because the book contains an extensive set of questions about interviewing and employing people. Of course, a big part of these questions have different answers, depending on location, culture, available funds and so on. (What works in the US may not necessarily work in the Nordic countries or India, or it may work in a different way). The only thing that is valid regardless of any external factor is this: curiosity. In my belief there are two kinds of people – curious and not-so-curious; regardless of profession. Think about it – professional success is directly proportional to the individual’s curiosity + time of active experience in the field. (I say ‘active experience’ because vacations and any distractions do not count as experience :)  ) So, curiosity is the factor which will distinguish a good employee from the not-so-good one. But let’s shift our attention to something else for now: a few tips and tricks for successful interviews. Tip and trick #1: get your priorities straight. Your status usually dictates your priorities; for example, if the person looking for a job has just relocated to a new country, they might tend to ignore some of their priorities and overload others. In other words, setting priorities straight means to define the personal criteria by which the interview process is lead. For example, similar to the following questions can help define the criteria for someone looking for a job: How badly do I need a (any) job? Is it more important to work in a clean and quiet environment or is it important to get paid well (or both, if possible)? And so on… Furthermore, before going to the interview, the candidate should have a list of priorities, sorted by the most importance: e.g. I want a quiet environment, x amount of money, great helping boss, a desk next to a window and so on. Also it is a good idea to be prepared and know which factors can be compromised and to what extent. Tip and trick #2: the interview is a two-way street. A job candidate should not forget that the interview process is not a one-way street. What I mean by this is that while the employer is interviewing the potential candidate, the job seeker should not miss the chance to interview the employer. Usually, the employer and the candidate will meet for an interview and talk about a variety of topics. In a quality interview the candidate will be presented to key members of the team and will have the opportunity to ask them questions. By asking the right questions both parties will define their opinion about each other. For example, if the candidate talks to one of the potential bosses during the interview process and they notice that the potential manager has a hard time formulating a question, then it is up to the candidate to decide whether working with such person is a red flag for them. There are as many interview processes out there as there are companies and each one is different. Some bigger companies and corporates can afford pre-selection processes, 3 or even 4 stages of interviews, small companies usually settle with one interview. Some companies even give cognitive tests on the interview. Why not? In his book Joel suggests that a good candidate should be pampered and spoiled beyond belief with a week-long vacation in New York, fancy hotels, food and who knows what. For all I can imagine, an interview might even take place at the top of the Eifel tower (right, Mr. Joel, right?) I doubt, however, that this is the optimal way to capture the attention of a good employee. The ‘curiosity’ topic What I have learned so far in my professional experience is that opinions can be subjective. Plus, opinions on technology subjects can also be subjective. According to Joel, only hiring the best of the best is worth it. If you ask me, there is no such thing as best of the best, simply because human nature (well, aside from some physical limitations, like putting your pants on through your head :) ) has no boundaries. And why would it have boundaries? I have seen many curious and interesting people, naturally good at technology, though uninterested in it as one  can possibly be; I have also seen plenty of people interested in technology, who (in an ideal world) should have stayed far from it. At any rate, all of this sums up at the end to the ‘supply and demand’ factor. The interview process big-bang boils down to this: If there is a mutual benefit for both the employer and the potential employee to work together, then it all sorts out nicely. If there is no benefit, then it is much harder to get to a common place. Tip and trick #3: word-of-mouth is worth a thousand words Here I would just mention that the best thing a job candidate can get during the interview process is access to future team members or other employees of the new company. Nowadays the world has become quite small and everyone knows everyone. Look at LinkedIn, look at other professional networks and you will realize how small the world really is. Knowing people is a good way to become more approachable and to approach them. Tip and trick #4: Be confident. It is true that for some people confidence is as natural as breathing and others have to work hard to express it. Confidence is, however, a key factor in convincing the other side (potential employer or employee) that there is a great chance for success by working together. But it cannot get you very far if it’s not backed up by talent, curiosity and knowledge. Tip and trick #5: The right reasons What really bothers me in Sweden (and I am sure that there are similar situations in other countries) is that there is a tendency to fill quotas and to filter out candidates by criteria different from their skill and knowledge. In job ads I see quite often the phrases ‘positive thinker’, ‘team player’ and many similar hints about personality features. So my guess here is that discrimination has evolved to a new level. Let me clear up the definition of discrimination: ‘unfair treatment of a person or group on the basis of prejudice’. And prejudice is the ‘partiality that prevents objective consideration of an issue or situation’. In other words, there is not much difference whether a job candidate is filtered out by race, gender or by personality features – it is all a bad habit. And in reality, there is no proven correlation between the technology knowledge paired with skills and the personal features (gender, race, age, optimism). It is true that a significantly greater number of Darwin awards were given to men than to women, but I am sure that somewhere there is a paper or theory explaining the genetics behind this. J This topic actually brings to mind one of my favorite work related stories. A while back I was working for a big company with many teams involved in their processes. One of the teams was occupying 2 rooms – one had the team members and was full of light, colorful posters, chit-chats and giggles, whereas the other room was dark, lighted only by a single monitor with a quiet person in front of it. Later on I realized that the ‘dark room’ person was the guru and the ultimate problem-solving-brain who did not like the chats and giggles and hence was in a separate room. In reality, all severe problems which the chatty and cheerful team members could not solve and all emergencies were directed to ‘the dark room’. And thus all worked out well. The moral of the story: Personality has nothing to do with technology knowledge and skills. End of story. Summary: I’d like to stress the fact that there is no ultimately perfect candidate for a job, and there is no such thing as ‘best-of-the-best’. From my personal experience, the main criteria by which I measure people (co-workers and bosses) is the curiosity factor; I know from experience that the more curious and inventive a person is, the better chances there are for great achievements in their field. Related stories: (for extra credit) 1) Get your priorities straight. A while back as a consultant I was working for a few days at a time at different offices and for different clients, and so I was able to compare and analyze the work environments. There were two different places which I compared and recently I asked a friend of mine the following question: “Which one would you prefer as a work environment: a noisy office full of people, or a quiet office full of faulty smells because the office is rarely cleaned?” My friend was puzzled for a while, thought about it and said: “Hmm, you are talking about two different kinds of pollution… I will probably choose the second, since I can clean the workplace myself a bit…” 2) The interview is a two-way street. One time, during a job interview, I met a potential boss that had a hard time phrasing a question. At that particular time it was clear to me that I would not have liked to work under this person. According to my work religion, the properly asked question contains at least half of the answer. And if I work with someone who cannot ask a question… then I’d be doing double or triple work. At another interview, after the technical part with the team leader of the department, I was introduced to one of the team members and we were left alone for 5 minutes. I immediately jumped on the occasion and asked the blunt question: ‘What have you learned here for the past year and how do you like your job?’ The team member looked at me and said ‘Nothing really. I like playing with my cats at home, so I am out of here at 5pm and I don’t have time for much.’ I was disappointed at the time and I did not take the job offer. I wasn’t that shocked a few months later when the company went bankrupt. 3) The right reasons to take a job: personality check. A while back I was asked to serve as a job reference for a coworker. I agreed, and after some weeks I got a phone call from the company where my colleague was applying for a job. The conversation started with the manager’s question about my colleague’s personality and about their social skills. (You can probably guess what my internal reaction was… J ) So, after 30 minutes of pouring common sense into the interviewer’s head, we finally agreed on the fact that a shy or quiet personality has nothing to do with work skills and knowledge. Some years down the road my former colleague is taking the manager’s position as the manager is demoted to a different department. Reference: Feodor Georgiev, Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, Readers Contribution, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Maximum number of characters using keystrokes A, Ctrl+A, Ctrl+C and Ctrl+V

    - by munda
    This is an interview question from google. I am not able to solve it by myself. Can somebody shed some light? Write a program to print the sequence of keystrokes such that it generates the maximum number of character 'A's. You are allowed to use only 4 keys: A, Ctrl+A, Ctrl+C and Ctrl+V. Only N keystrokes are allowed. All Ctrl+ characters are considered as one keystroke, so Ctrl+A is one keystroke. For example, the sequence A, Ctrl+A, Ctrl+C, Ctrl+V generates two A's in 4 keystrokes. Ctrl+A is Select All Ctrl+C is Copy Ctrl+V is Paste I did some mathematics. For any N, using x numbers of A's , one Ctrl+A, one Ctrl+C and y Ctrl+V, we can generate max ((N-1)/2)2 number of A's. For some N M, it is better to use as many Ctrl+A's, Ctrl+C and Ctrl+V sequences as it doubles the number of A's. The sequence Ctrl+A, Ctrl+V, Ctrl+C will not overwrite the existing selection. It will append the copied selection to selected one.

    Read the article

  • Leveraging hobby experience to get a job

    - by Bernard
    Like many other's I began programming at an early age. I started when I was 11 and I learned C when I was 14 (now 26). While most of what I did were games just to entertain myself I did everything from low level 2D graphics, and binary I/O, to interfacing with free API's, custom file systems, audio, 3D animations, OpenGL, web sites, etc. I worked on a wide variety of things trying to make various games. Because of this experience I have tested out of every college level C/C++ programming course I have ever been offered. In the classes I took, my classmates would need a week to do what I finished in class with an hour or two of work. I now have my degree now and I have 2 years of experience working full time as a web developer however I would like to get back into C++ and hopefully do simulation programming. Unfortunately I have yet to do C++ as a job, I have only done it for testing out of classes and doing my senior project in college. So most of what I have in C++ is still hobby experience and I don't know how to best convey that so that I don't end up stuck doing something too low level for me. Right now I see a job offer that requires 2 years of C++ experience, but I have at least 9 (I didn't do C++ everyday for the last 14 years). How do I convey my experience? How much is it truly worth? and How do I get it's full value? The best thing that I can think of is a demo and a portfolio, however that only comes into play after an interview has been secured. I used a portfolio to land my current job. All answers and advice are appreciated.

    Read the article

  • algorithm to generate maximum number of character 'A' using keystrokes 'A', CTRL + 'A', CTRL + 'C' and CTRL + 'V'

    - by munda
    This is an interview question from google. I am not able to solve it by myself. Can somebody throw some light? The question goes like this. Write a program to print the sequence of keystrokes such that it generates the maximum number of character 'A's. You are allowed to use only 4 keys: 'A', CTRL + 'A', CTRL + 'C' and CTRL + 'V'. Only N keystrokes are allowed. All CTRL+ characters are considered as one keystroke, so CTRL+A is one keystroke. e.g.: A, ctrl+A, ctrl+C, ctrl+V generates two As in 4 keystrokes. Edit: CTRL + A is Select All CTRL + C is copy CTRL + V is paste I did some mathematics. For any N, using x numbers of A's , one CTRL+A, one CTRL+C and y CTRL+V, we can generate max ((N-1)/2)^2 numbers of A's. But for some N M, it is better to use as many ^A, ^C and ^V as it doubles the number of As. Edit 2: ^A, ^V and ^C will not overwrite on the existing selection but it will append the copied selection to selected one.

    Read the article

  • Factorial function - design and test.

    - by lukas
    I'm trying to nail down some interview questions, so I stared with a simple one. Design the factorial function. This function is a leaf (no dependencies - easly testable), so I made it static inside the helper class. public static class MathHelper { public static int Factorial(int n) { Debug.Assert(n >= 0); if (n < 0) { throw new ArgumentException("n cannot be lower that 0"); } Debug.Assert(n <= 12); if (n > 12) { throw new OverflowException("Overflow occurs above 12 factorial"); } //by definition if (n == 0) { return 1; } int factorialOfN = 1; for (int i = 1; i <= n; ++i) { //checked //{ factorialOfN *= i; //} } return factorialOfN; } } Testing: [TestMethod] [ExpectedException(typeof(OverflowException))] public void Overflow() { int temp = FactorialHelper.MathHelper.Factorial(40); } [TestMethod] public void ZeroTest() { int factorialOfZero = FactorialHelper.MathHelper.Factorial(0); Assert.AreEqual(1, factorialOfZero); } [TestMethod] public void FactorialOf5() { int factOf5 = FactorialHelper.MathHelper.Factorial(5); Assert.AreEqual(120,factOf5); } [TestMethod] [ExpectedException(typeof(ArgumentException))] public void NegativeTest() { int factOfMinus5 = FactorialHelper.MathHelper.Factorial(-5); } I have a few questions: Is it correct? (I hope so ;) ) Does it throw right exceptions? Should I use checked context or this trick ( n 12 ) is ok? Is it better to use uint istead of checking for negative values? Future improving: Overload for long, decimal, BigInteger or maybe generic method? Thank you

    Read the article

  • Algorithm to determine indices i..j of array A containing all the elements of another array B

    - by Skylark
    I came across this question on an interview questions thread. Here is the question: Given two integer arrays A [1..n] and B[1..m], find the smallest window in A that contains all elements of B. In other words, find a pair < i , j such that A[i..j] contains B[1..m]. If A doesn't contain all the elements of B, then i,j can be returned as -1. The integers in A need not be in the same order as they are in B. If there are more than one smallest window (different, but have the same size), then its enough to return one of them. Example: A[1,2,5,11,2,6,8,24,101,17,8] and B[5,2,11,8,17]. The algorithm should return i = 2 (index of 5 in A) and j = 9 (index of 17 in A). Now I can think of two variations. Let's suppose that B has duplicates. This variation doesn't consider the number of times each element occurs in B. It just checks for all the unique elements that occur in B and finds the smallest corresponding window in A that satisfies the above problem. For example, if A[1,2,4,5,7] and B[2,2,5], this variation doesn't bother about there being two 2's in B and just checks A for the unique integers in B namely 2 and 5 and hence returns i=1, j=3. This variation accounts for duplicates in B. If there are two 2's in B, then it expects to see at least two 2's in A as well. If not, it returns -1,-1. When you answer, please do let me know which variation you are answering. Pseudocode should do. Please mention space and time complexity if it is tricky to calculate it. Mention if your solution assumes array indices to start at 1 or 0 too. Thanks in advance.

    Read the article

  • In the meantime, to be or not to be ... productive!

    - by Jan Kuboschek
    I just moved back to Europe from the US after living there for 7 years. Apart from major adjustment issues, I'm currently looking for a job over here. I'm mainly interested in (IT) Consulting and, since these jobs typically require programming knowledge, such as Java, I'm trying to think of something productive to write (perhaps to demo my skills) while I'm waiting for my interviews (starting in two weeks. Folks here are a bit slower than in the US apparently...). I graduated from college about a year and a half ago and have a 4 year degree in international management/economics and about 3/4 of a 2 year degree in computer science finished. I've written my fair share of web software over the years, but nothing concrete that I could show, especially not in Java. Now, I've never had the problem of not having any idea what to write. Basic games I could write, but I'm not sure how well that'll come over when I walk into my interview and say "hey, I was bored. Take a look at my multiplayer space invaders game! Wanna try beating me??". Any thoughts? I browsed SourceForge the other day to find a nice little project to contribute to, but decided that I don't want to commit to someone else's project at this time. Any ideas, perhaps from someone who has been, or currently is, in a similar position would be much appreciated. Oh, and lastly: Instead of developing a program or two to demonstrate my skills, I could spend my time brushing up on UML and Perl. Any suggestions regarding that? Writing a demo vs. learning something new?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >