Software development engineer Interview Questions in United Kingdom | Glassdoor.co.uk

Software development engineer Interview Questions in United Kingdom

243

software development engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

The questions were not very difficult but you really need to have all the concepts crystal-clear and be ready to apply them successfully. One of the questions was "how to count the letters in this string:" "The quick brown fox jumps over the lazy dog";

12 Answers

public static int countWords(String str){ if(str == null || str.isEmpty()) return 0; int count = 0; for(int e = 0; e < str.length(); e++){ if(str.charAt(e) != ' '){ count++; while(str.charAt(e) != ' ' && e < str.length()-1){ e++; } }else{ e++; } } return count; }

Sorry, the above version has an error!!!!!!!!!!!!!!!!!!!!!!!! concider this one: public static int countWords(String str){ if(str == null || str.isEmpty()) return 0; int count = 0; for(int e = 0; e < str.length(); e++){ if(str.charAt(e) != ' '){ count++; while(str.charAt(e) != ' ' && e < str.length()-1){ e++; } } } return count; }

# That's why i love Python: len(re.findall('[a-zA-Z]', s))

The first coding question was to determine whether a list of integers with size N, contains all the numbers from one to N.

7 Answers

1. How to achieve automatic type conversion from type X to type Y? a. X can define the member function operator Y() b. a) or b) can be used c. Y can define the constructor Y(const X&) d. none of the above 2. class Coordinate{ int x; int y; public: Coordinate(int a=0, int b=0) { x=a; y=b; }; }; What are the values for the following object: Coordinate point(10); a. x=10,y=0 b. x=0,y=10 c. x=10,y=10 d. x=0,y=0 3. What type of argument can the following function take : Void foo(); a. any number or type of arguments b. a character c. an integer d. no an integer argument of any type 4. Consider the following function declarations in a header file: void doit(char *, int); int doit(char *) ; float doit(float, float) ; Which of the following declarations cannot follow in the same header: a. void doit(int, char *); b. int doit(int) ; c. float doit(char *) ; d. int doit(int, int) ;

3 Answers

Connect nodes at the same level in a binary tree

3 Answers

why do you want to join nokia?

3 Answers

Are you married? Do you have any kids? Where do you live?

2 Answers

write a function to find the n-th fibonacci number

2 Answers

Asked question: Using an already implemented method Rand5() that generates a random integer between the ranges 1-5 uniformly. Using this method, implement a a new method that returns a random integer in the range 1-7 uniformly, i.e. Rand7(). Basically this is Rejection Sampling Algorithm. See http://leetcode.com/2010/11/rejection-sampling.html

2 Answers

Explain your roles and responsibilities

1 Answer

13. What is the result of executing the code fragment below? // suitable #includes class Text { public: Text(const std::string &text) : data(new char[text.size() + 1000]) { std::copy(text.begin(), text.end(), data); } ~Text() { delete [] data; } void print() const { std::cout << data << std::endl; } private: char *data; }; int main(int, char *[]) { Text outer("hello"); { const Text inner("world"); outer = inner; } outer.print(); return 0; } a. prints "hello" b. prints "world", but there is a buffer overflow in the constructor c. prints "world", no problems anywhere d. none of the above 14. For some class Value, which of the following fragments is the preferred way of writing the declaration of the equality operator? a. extern bool operator==(const Value &lhs, const Value &rhs); b. class Value { public: bool operator==(const Value &other); }; c. class Value { public: bool operator==(const Value *other); }; d. class Value { public: bool operator==(const Value &other) const; }; 15. Consider the following line of code: C c1 = c2; What method is called ? a. Assignment operator b. Copy constructor c. Both d. None of the above 16. Consider the following code: struct A { int i; }; class B { int j; } a. A::i is publicly accessible b. B:i is publicly accessible c. both the above are true d. Neither the above are true

1 Answer
110 of 243 Interview Questions